aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Thode <[email protected]>2013-11-06 15:54:54 -0600
committerBrian Behlendorf <[email protected]>2013-11-14 14:28:35 -0800
commit227bc96951c020a6ea16dbb244901d65d5ee4ba1 (patch)
tree2aee7a1c4da213a6df0f8afeb33a23b40cf394f6
parenta16878805388c4d96cb8a294de965071d138a47b (diff)
Fixes (extends) support for selinux xattrs to more inode types
Properly initialize SELinux xattrs for all inode types. The initial implementation accidentally only did this for files. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1832
-rw-r--r--module/zfs/zpl_inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c
index 98420b2fe..8f0fdaffe 100644
--- a/module/zfs/zpl_inode.c
+++ b/module/zfs/zpl_inode.c
@@ -137,6 +137,7 @@ zpl_mknod(struct inode *dir, struct dentry *dentry, zpl_umode_t mode,
error = -zfs_create(dir, dname(dentry), vap, 0, mode, &ip, cr, 0, NULL);
if (error == 0) {
+ VERIFY0(zpl_xattr_security_init(ip, dir, &dentry->d_name));
VERIFY0(zpl_init_acl(ip, dir));
d_instantiate(dentry, ip);
}
@@ -176,6 +177,7 @@ zpl_mkdir(struct inode *dir, struct dentry *dentry, zpl_umode_t mode)
error = -zfs_mkdir(dir, dname(dentry), vap, &ip, cr, 0, NULL);
if (error == 0) {
+ VERIFY0(zpl_xattr_security_init(ip, dir, &dentry->d_name));
VERIFY0(zpl_init_acl(ip, dir));
d_instantiate(dentry, ip);
}
@@ -286,8 +288,10 @@ zpl_symlink(struct inode *dir, struct dentry *dentry, const char *name)
zpl_vap_init(vap, dir, S_IFLNK | S_IRWXUGO, cr);
error = -zfs_symlink(dir, dname(dentry), vap, (char *)name, &ip, cr, 0);
- if (error == 0)
+ if (error == 0) {
+ VERIFY0(zpl_xattr_security_init(ip, dir, &dentry->d_name));
d_instantiate(dentry, ip);
+ }
kmem_free(vap, sizeof(vattr_t));
crfree(cr);