History

SELinux: Use d_is_positive() rather than testing dentry->d_inode

Use d_is_positive() rather than testing dentry->d_inode in SELinux to get rid of direct references to d_inode outside of the VFS.

David Howells committed 11 years ago

Commit 2c616d41 parent 88025651 file · +2 −2Browse files

Unified · Split

security/selinux/hooks.c+2−2
@@ -1822,12 +1822,12 @@ static inline int may_rename(struct inode *old_dir, · 1821 unmodified lines
18221822
18231823 ad.u.dentry = new_dentry;
18241824 av = DIR__ADD_NAME | DIR__SEARCH;
1825− if (new_dentry->d_inode)
1825+ if (d_is_positive(new_dentry))
18261826 av |= DIR__REMOVE_NAME;
18271827 rc = avc_has_perm(sid, new_dsec->sid, SECCLASS_DIR, av, &ad);
18281828 if (rc)
18291829 return rc;
1830− if (new_dentry->d_inode) {
1830+ if (d_is_positive(new_dentry)) {
18311831 new_isec = new_dentry->d_inode->i_security;
18321832 new_is_dir = S_ISDIR(new_dentry->d_inode->i_mode);
18331833 rc = avc_has_perm(sid, new_isec->sid,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t