diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2008-05-21 13:15:03 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 20:53:13 -0400 |
commit | 1bd5191d9f5d1928c4efdf604c4164b04bb88dbe (patch) | |
tree | a0395f9e5a05c093ee3f5f1d816b2a053bad1f5c /fs/hpfs | |
parent | 9043476f726802f4b00c96d0c4f418dde48d1304 (diff) |
[patch 05/14] hpfs: dont call permission()
hpfs_unlink() calls permission() prior to truncating the file. HPFS
doesn't define a .permission method, so replace with explicit call to
generic_permission().
This is equivalent, except that devcgroup_inode_permission() and
security_inode_permission() are not called.
The truncation is just an implementation detail of the unlink, so
these security checks are unnecessary.
I suspect that even calling generic_permission() is unnecessary, since
we shouldn't mind if the file isn't writable. But I leave that to the
maintainer to decide.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/namei.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index d256559b4104..d9c59a775449 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c | |||
@@ -415,7 +415,7 @@ again: | |||
415 | d_drop(dentry); | 415 | d_drop(dentry); |
416 | spin_lock(&dentry->d_lock); | 416 | spin_lock(&dentry->d_lock); |
417 | if (atomic_read(&dentry->d_count) > 1 || | 417 | if (atomic_read(&dentry->d_count) > 1 || |
418 | permission(inode, MAY_WRITE, NULL) || | 418 | generic_permission(inode, MAY_WRITE, NULL) || |
419 | !S_ISREG(inode->i_mode) || | 419 | !S_ISREG(inode->i_mode) || |
420 | get_write_access(inode)) { | 420 | get_write_access(inode)) { |
421 | spin_unlock(&dentry->d_lock); | 421 | spin_unlock(&dentry->d_lock); |