Browse Source

fanotify: Return EPERM when a process is not privileged

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>
Andreas Gruenbacher 14 years ago
parent
commit
a2f13ad0ba
1 changed files with 1 additions and 1 deletions
  1. 1 1
      fs/notify/fanotify/fanotify_user.c

+ 1 - 1
fs/notify/fanotify/fanotify_user.c

@@ -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;