Skip to content

Commit

Permalink
fanotify: Return EPERM when a process is not privileged
Browse files Browse the repository at this point in the history
The appropriate error code when privileged operations are denied is
EPERM, not EACCES.

Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Eric Paris <[email protected]>
  • Loading branch information
Andreas Gruenbacher authored and eparis committed Aug 27, 2010
1 parent 0fb8562 commit a2f13ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/notify/fanotify/fanotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a2f13ad

Please sign in to comment.