mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
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 <behlendorf1@llnl.gov> Closes #1832
This commit is contained in:
parent
a168788053
commit
227bc96951
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user