Commit a2f13ad0 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Eric Paris

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: default avatarAndreas Gruenbacher <agruen@suse.de>
Signed-off-by: default avatarEric Paris <paris@paris.rdu.redhat.com>
parent 0fb85621
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment