diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/inode.c | 2 | ||||
-rw-r--r-- | security/selinux/hooks.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/security/inode.c b/security/inode.c index 8e7ca62078ab..131a3c49f766 100644 --- a/security/inode.c +++ b/security/inode.c | |||
@@ -203,7 +203,7 @@ void securityfs_remove(struct dentry *dentry) | |||
203 | mutex_lock(&parent->d_inode->i_mutex); | 203 | mutex_lock(&parent->d_inode->i_mutex); |
204 | if (positive(dentry)) { | 204 | if (positive(dentry)) { |
205 | if (dentry->d_inode) { | 205 | if (dentry->d_inode) { |
206 | if (S_ISDIR(dentry->d_inode->i_mode)) | 206 | if (d_is_dir(dentry)) |
207 | simple_rmdir(parent->d_inode, dentry); | 207 | simple_rmdir(parent->d_inode, dentry); |
208 | else | 208 | else |
209 | simple_unlink(parent->d_inode, dentry); | 209 | simple_unlink(parent->d_inode, dentry); |
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); |