Skip to contentSkip to conversation

fanotify: Return EPERM when a process is not privileged

PATCH New Andreas Gruenbacher 1 participant 1 message Aug 24, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fanotify: Return EPERM when a process is not privileged

The appropriate error code when privileged operations are denied is EPERM, not EACCES.

---
 fs/notify/fanotify/fanotify_user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/notify/fanotify/fanotify_user.c +1 -1
index c3a5742..4d7f7cb 100644
@@ -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;
Signature · 1 line
1.7.1