提交 a2f13ad0 编写于 作者: A Andreas Gruenbacher 提交者: 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: NAndreas Gruenbacher <agruen@suse.de>
Signed-off-by: NEric Paris <paris@paris.rdu.redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册