TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR()
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 <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
729b8a3dee
commit
e656a8eb2e
|
@ -905,11 +905,9 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1,
|
||||||
!tomoyo_get_realpath(&buf2, path2))
|
!tomoyo_get_realpath(&buf2, path2))
|
||||||
goto out;
|
goto out;
|
||||||
switch (operation) {
|
switch (operation) {
|
||||||
struct dentry *dentry;
|
|
||||||
case TOMOYO_TYPE_RENAME:
|
case TOMOYO_TYPE_RENAME:
|
||||||
case TOMOYO_TYPE_LINK:
|
case TOMOYO_TYPE_LINK:
|
||||||
dentry = path1->dentry;
|
if (!d_is_dir(path1->dentry))
|
||||||
if (!dentry->d_inode || !S_ISDIR(dentry->d_inode->i_mode))
|
|
||||||
break;
|
break;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case TOMOYO_TYPE_PIVOT_ROOT:
|
case TOMOYO_TYPE_PIVOT_ROOT:
|
||||||
|
|
Loading…
Reference in New Issue