JFS: Need to be root to create files with security context
authorIan Dall <ian@beware.dropbear.id.au>
Wed, 13 Jul 2005 14:15:18 +0000 (09:15 -0500)
committerDave Kleikamp <shaggy@austin.ibm.com>
Wed, 13 Jul 2005 14:15:18 +0000 (09:15 -0500)
It turns out this is due to some inverted logic in xattr.c

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
fs/jfs/xattr.c

index fdd8f3f5a72f3cc85386424cc4531b6de613ee95..554ec739e49b9d41f6f35cecefcb03164b177d44 100644 (file)
@@ -790,12 +790,12 @@ static int can_set_xattr(struct inode *inode, const char *name,
                 */
                return can_set_system_xattr(inode, name, value, value_len);
 
-       if(strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) != 0)
+       if(strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0)
                return (capable(CAP_SYS_ADMIN) ? 0 : -EPERM);
 
 #ifdef CONFIG_JFS_SECURITY
        if (strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN)
-           != 0)
+           == 0)
                return 0;       /* Leave it to the security module */
 #endif