]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fanotify: Return EPERM when a process is not privileged
authorAndreas Gruenbacher <agruen@suse.de>
Tue, 24 Aug 2010 10:58:54 +0000 (12:58 +0200)
committerEric Paris <eparis@redhat.com>
Fri, 27 Aug 2010 23:59:42 +0000 (19:59 -0400)
The appropriate error code when privileged operations are denied is
EPERM, not EACCES.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Eric Paris <paris@paris.rdu.redhat.com>
fs/notify/fanotify/fanotify_user.c

index b966b7230f4752b7ce759b64850b96ca9c641cbd..5ed8e58d7bfc316f44c056e6208c3787dbc5f445 100644 (file)
@@ -641,7 +641,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
                __func__, flags, event_f_flags);
 
        if (!capable(CAP_SYS_ADMIN))
-               return -EACCES;
+               return -EPERM;
 
        if (flags & ~FAN_ALL_INIT_FLAGS)
                return -EINVAL;