Skip to content

Commit

Permalink
TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR()
Browse files Browse the repository at this point in the history
Use d_is_dir() rather than d_inode and S_ISDIR().  Note that this will include
fake directories such as automount triggers.

Signed-off-by: David Howells <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
dhowells authored and Al Viro committed Feb 22, 2015
1 parent 729b8a3 commit e656a8e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions security/tomoyo/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,11 +905,9 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1,
!tomoyo_get_realpath(&buf2, path2))
goto out;
switch (operation) {
struct dentry *dentry;
case TOMOYO_TYPE_RENAME:
case TOMOYO_TYPE_LINK:
dentry = path1->dentry;
if (!dentry->d_inode || !S_ISDIR(dentry->d_inode->i_mode))
if (!d_is_dir(path1->dentry))
break;
/* fall through */
case TOMOYO_TYPE_PIVOT_ROOT:
Expand Down

0 comments on commit e656a8e

Please sign in to comment.