security: move LSM xattrnames to xattr.h
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 1 Jul 2010 19:07:43 +0000 (15:07 -0400)
committerJames Morris <jmorris@namei.org>
Mon, 2 Aug 2010 05:34:57 +0000 (15:34 +1000)
Make the security extended attributes names global. Updated to move
the remaining Smack xattrs.

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
include/linux/capability.h
include/linux/xattr.h
security/selinux/hooks.c
security/smack/smack.h

index 39e5ff512fbeab16280345eb3e54beb78e8ed0e7..90012b9ddbf3e5f999983bf7d2f6e388a99d25a1 100644 (file)
@@ -49,9 +49,6 @@ typedef struct __user_cap_data_struct {
 } __user *cap_user_data_t;
 
 
-#define XATTR_CAPS_SUFFIX "capability"
-#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
-
 #define VFS_CAP_REVISION_MASK  0xFF000000
 #define VFS_CAP_REVISION_SHIFT 24
 #define VFS_CAP_FLAGS_MASK     ~VFS_CAP_REVISION_MASK
index 0cfa1e9c4cc152239895304d67c6d1500cff7044..f1e5bde4b35acbab2a0a5a525d59dde6e017cc61 100644 (file)
 #define XATTR_USER_PREFIX "user."
 #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
 
+/* Security namespace */
+#define XATTR_SELINUX_SUFFIX "selinux"
+#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
+
+#define XATTR_SMACK_SUFFIX "SMACK64"
+#define XATTR_SMACK_IPIN "SMACK64IPIN"
+#define XATTR_SMACK_IPOUT "SMACK64IPOUT"
+#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
+#define XATTR_NAME_SMACKIPIN   XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
+#define XATTR_NAME_SMACKIPOUT  XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
+
+#define XATTR_CAPS_SUFFIX "capability"
+#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
+
 struct inode;
 struct dentry;
 
index 0f524b7d102ed5cea85af96619381c9f73a6932a..85338f0c048127f317ec25e158ae439eb8a542ab 100644 (file)
@@ -87,9 +87,6 @@
 #include "netlabel.h"
 #include "audit.h"
 
-#define XATTR_SELINUX_SUFFIX "selinux"
-#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
-
 #define NUM_SEL_MNT_OPTS 5
 
 extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm);
index c6e9acae72e4b74b9e75f037845e54b61fce6163..43ae747a5aa4e60746fdc7cdb15ec5cd3bb42b52 100644 (file)
@@ -123,16 +123,6 @@ struct smack_known {
 #define SMK_FSHAT      "smackfshat="
 #define SMK_FSROOT     "smackfsroot="
 
-/*
- * xattr names
- */
-#define XATTR_SMACK_SUFFIX     "SMACK64"
-#define XATTR_SMACK_IPIN       "SMACK64IPIN"
-#define XATTR_SMACK_IPOUT      "SMACK64IPOUT"
-#define XATTR_NAME_SMACK       XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
-#define XATTR_NAME_SMACKIPIN   XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
-#define XATTR_NAME_SMACKIPOUT  XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
-
 #define SMACK_CIPSO_OPTION     "-CIPSO"
 
 /*