diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 79f2c2cb68ad..4d1a54190388 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -1799,7 +1799,7 @@ static inline int may_rename(struct inode *old_dir, | |||
1799 | 1799 | ||
1800 | old_dsec = old_dir->i_security; | 1800 | old_dsec = old_dir->i_security; |
1801 | old_isec = old_dentry->d_inode->i_security; | 1801 | old_isec = old_dentry->d_inode->i_security; |
1802 | old_is_dir = S_ISDIR(old_dentry->d_inode->i_mode); | 1802 | old_is_dir = d_is_dir(old_dentry); |
1803 | new_dsec = new_dir->i_security; | 1803 | new_dsec = new_dir->i_security; |
1804 | 1804 | ||
1805 | ad.type = LSM_AUDIT_DATA_DENTRY; | 1805 | ad.type = LSM_AUDIT_DATA_DENTRY; |
@@ -1829,7 +1829,7 @@ static inline int may_rename(struct inode *old_dir, | |||
1829 | return rc; | 1829 | return rc; |
1830 | if (d_is_positive(new_dentry)) { | 1830 | if (d_is_positive(new_dentry)) { |
1831 | new_isec = new_dentry->d_inode->i_security; | 1831 | new_isec = new_dentry->d_inode->i_security; |
1832 | new_is_dir = S_ISDIR(new_dentry->d_inode->i_mode); | 1832 | new_is_dir = d_is_dir(new_dentry); |
1833 | rc = avc_has_perm(sid, new_isec->sid, | 1833 | rc = avc_has_perm(sid, new_isec->sid, |
1834 | new_isec->sclass, | 1834 | new_isec->sclass, |
1835 | (new_is_dir ? DIR__RMDIR : FILE__UNLINK), &ad); | 1835 | (new_is_dir ? DIR__RMDIR : FILE__UNLINK), &ad); |