Re: [patch 06/14] hfsplus: remove hfsplus_permission()
From: Miklos Szeredi
Date: Fri May 23 2008 - 11:49:54 EST
> > > Yes. Roman, if you care about details about the files as directories
> > > look in the reiser4 threads as it did something quite similar.
> >
> > I was afraid this would come up. :)
> > I only need something much simpler, I don't need to create/move/unlink
> > anything, I only need a lookup+open.
>
> Doesn't matter. As long as filesystem has hard links and allows
> lookup on these, userspace can screw up the kernel. Badly.
And so I strongly suggest this patch as well. Apparently this feature
is not even used by anybody, otherwise somebody would have noticed
when Trond's fix broke execute permission checking on regular files...
Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>
---
fs/hfsplus/inode.c | 44 --------------------------------------------
1 file changed, 44 deletions(-)
Index: linux-2.6/fs/hfsplus/inode.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/inode.c 2008-05-22 18:27:02.000000000 +0200
+++ linux-2.6/fs/hfsplus/inode.c 2008-05-23 17:42:49.000000000 +0200
@@ -142,49 +142,6 @@ struct dentry_operations hfsplus_dentry_
.d_compare = hfsplus_compare_dentry,
};
-static struct dentry *hfsplus_file_lookup(struct inode *dir, struct dentry *dentry,
- struct nameidata *nd)
-{
- struct hfs_find_data fd;
- struct super_block *sb = dir->i_sb;
- struct inode *inode = NULL;
- int err;
-
- if (HFSPLUS_IS_RSRC(dir) || strcmp(dentry->d_name.name, "rsrc"))
- goto out;
-
- inode = HFSPLUS_I(dir).rsrc_inode;
- if (inode)
- goto out;
-
- inode = new_inode(sb);
- if (!inode)
- return ERR_PTR(-ENOMEM);
-
- inode->i_ino = dir->i_ino;
- INIT_LIST_HEAD(&HFSPLUS_I(inode).open_dir_list);
- init_MUTEX(&HFSPLUS_I(inode).extents_lock);
- HFSPLUS_I(inode).flags = HFSPLUS_FLG_RSRC;
-
- hfs_find_init(HFSPLUS_SB(sb).cat_tree, &fd);
- err = hfsplus_find_cat(sb, dir->i_ino, &fd);
- if (!err)
- err = hfsplus_cat_read_inode(inode, &fd);
- hfs_find_exit(&fd);
- if (err) {
- iput(inode);
- return ERR_PTR(err);
- }
- HFSPLUS_I(inode).rsrc_inode = dir;
- HFSPLUS_I(dir).rsrc_inode = inode;
- igrab(dir);
- hlist_add_head(&inode->i_hash, &HFSPLUS_SB(sb).rsrc_inodes);
- mark_inode_dirty(inode);
-out:
- d_add(dentry, inode);
- return NULL;
-}
-
static void hfsplus_get_perms(struct inode *inode, struct hfsplus_perm *perms, int dir)
{
struct super_block *sb = inode->i_sb;
@@ -269,7 +226,6 @@ static int hfsplus_file_release(struct i
}
static const struct inode_operations hfsplus_file_inode_operations = {
- .lookup = hfsplus_file_lookup,
.truncate = hfsplus_file_truncate,
.setxattr = hfsplus_setxattr,
.getxattr = hfsplus_getxattr,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/