aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-08-08 20:31:03 -0400
committerJames Morris <jmorris@namei.org>2011-08-08 20:31:03 -0400
commit5a2f3a02aea164f4f59c0c3497772090a411b462 (patch)
treed3ebe03d4f97575290087843960baa01de3acd0a /fs/xfs
parent1d568ab068c021672d6cd7f50f92a3695a921ffb (diff)
parent817b54aa45db03437c6d09a7693fc6926eb8e822 (diff)
Merge branch 'next-evm' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/ima-2.6 into next
Conflicts: fs/attr.c Resolve conflict manually. Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index b9c172b3fbbe..37194607162d 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -94,37 +94,38 @@ xfs_mark_inode_dirty(
94 mark_inode_dirty(inode); 94 mark_inode_dirty(inode);
95} 95}
96 96
97
98int xfs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
99 void *fs_info)
100{
101 const struct xattr *xattr;
102 struct xfs_inode *ip = XFS_I(inode);
103 int error = 0;
104
105 for (xattr = xattr_array; xattr->name != NULL; xattr++) {
106 error = xfs_attr_set(ip, xattr->name, xattr->value,
107 xattr->value_len, ATTR_SECURE);
108 if (error < 0)
109 break;
110 }
111 return error;
112}
113
97/* 114/*
98 * Hook in SELinux. This is not quite correct yet, what we really need 115 * Hook in SELinux. This is not quite correct yet, what we really need
99 * here (as we do for default ACLs) is a mechanism by which creation of 116 * here (as we do for default ACLs) is a mechanism by which creation of
100 * these attrs can be journalled at inode creation time (along with the 117 * these attrs can be journalled at inode creation time (along with the
101 * inode, of course, such that log replay can't cause these to be lost). 118 * inode, of course, such that log replay can't cause these to be lost).
102 */ 119 */
120
103STATIC int 121STATIC int
104xfs_init_security( 122xfs_init_security(
105 struct inode *inode, 123 struct inode *inode,
106 struct inode *dir, 124 struct inode *dir,
107 const struct qstr *qstr) 125 const struct qstr *qstr)
108{ 126{
109 struct xfs_inode *ip = XFS_I(inode); 127 return security_inode_init_security(inode, dir, qstr,
110 size_t length; 128 &xfs_initxattrs, NULL);
111 void *value;
112 unsigned char *name;
113 int error;
114
115 error = security_inode_init_security(inode, dir, qstr, (char **)&name,
116 &value, &length);
117 if (error) {
118 if (error == -EOPNOTSUPP)
119 return 0;
120 return -error;
121 }
122
123 error = xfs_attr_set(ip, name, value, length, ATTR_SECURE);
124
125 kfree(name);
126 kfree(value);
127 return error;
128} 129}
129 130
130static void 131static void