aboutsummaryrefslogtreecommitdiff
path: root/security/integrity/evm/evm_posix_acl.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-09-15 09:53:38 +1000
committerJames Morris <jmorris@namei.org>2011-09-15 09:53:38 +1000
commit8de6ac7f58a22fdab399fbe97763e465ea49c735 (patch)
tree46104451c69f5270fcc11137aecff012a2ecf612 /security/integrity/evm/evm_posix_acl.c
parent843d183cdd816549b73e6bd3ae07f64adddf714b (diff)
parentfb788d8b981fa55603873416882f8dcf835e7924 (diff)
Merge branch 'next-evm' of git://github.com/mzohar/linux-evm into next
Diffstat (limited to 'security/integrity/evm/evm_posix_acl.c')
-rw-r--r--security/integrity/evm/evm_posix_acl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/security/integrity/evm/evm_posix_acl.c b/security/integrity/evm/evm_posix_acl.c
new file mode 100644
index 00000000000..b1753e98bf9
--- /dev/null
+++ b/security/integrity/evm/evm_posix_acl.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2011 IBM Corporation
+ *
+ * Author:
+ * Mimi Zohar <zohar@us.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 2 of the License.
+ */
+
+#include <linux/module.h>
+#include <linux/xattr.h>
+
+int posix_xattr_acl(char *xattr)
+{
+ int xattr_len = strlen(xattr);
+
+ if ((strlen(XATTR_NAME_POSIX_ACL_ACCESS) == xattr_len)
+ && (strncmp(XATTR_NAME_POSIX_ACL_ACCESS, xattr, xattr_len) == 0))
+ return 1;
+ if ((strlen(XATTR_NAME_POSIX_ACL_DEFAULT) == xattr_len)
+ && (strncmp(XATTR_NAME_POSIX_ACL_DEFAULT, xattr, xattr_len) == 0))
+ return 1;
+ return 0;
+}