SELinux: return EOPNOTSUPP not ENOTSUPP
authorEric Paris <eparis@redhat.com>
Fri, 16 Nov 2007 21:35:56 +0000 (16:35 -0500)
committerJames Morris <jmorris@namei.org>
Fri, 16 Nov 2007 23:38:16 +0000 (10:38 +1100)
ENOTSUPP is not a valid error code in the kernel (it is defined in some
NFS internal error codes and has been improperly used other places).  In
the !CONFIG_SECURITY_SELINUX case though it is possible that we could
return this from selinux_audit_rule_init().  This patch just returns the
userspace valid EOPNOTSUPP.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
include/linux/selinux.h

index d1b7ca6c1c57af517e0b1f00b7e97f4c78c0c1d9..6080f73fc85f0b5555f973b606984ecc77ddefe2 100644 (file)
@@ -136,7 +136,7 @@ static inline int selinux_audit_rule_init(u32 field, u32 op,
                                           char *rulestr,
                                           struct selinux_audit_rule **rule)
 {
                                           char *rulestr,
                                           struct selinux_audit_rule **rule)
 {
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
 
 static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)
 }
 
 static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)