reiser4-remove-rwx-perm-plugin.patch]
PATCH 1/3 reiser4-remove-rwx-perm-plugin.patch]
From: Hans Reiser <[email protected]>
Security plugin duplicating LSM is removed.
Signed-off-by Vladimir V. Saveliev <[email protected]>
fs/reiser4/init_super.c | 2 - fs/reiser4/plugin/dir_plugin_common.c | 4 -- fs/reiser4/plugin/inode_ops.c | 40 +++++----------------- fs/reiser4/plugin/security/perm.c | 61 ++++------------------------------ fs/reiser4/plugin/security/perm.h | 13 ------- 5 files changed, 20 insertions(+), 100 deletions(-)
fs/reiser4/init_super.c renamed from fs/reiser4/init_super.c~reiser4-remove-rwx-perm-plugin +1 -1
@@ -626,7 +626,7 @@ static struct { }, [PSET_PERM] = { .type = REISER4_PERM_PLUGIN_TYPE, - .id =RWX_PERM_ID + .id =NULL_PERM_ID }, [PSET_FORMATTING] = { .type = REISER4_FORMATTING_PLUGIN_TYPE,
fs/reiser4/plugin/dir_plugin_common.c renamed from fs/reiser4/plugin/dir_plugin_common.c~reiser4-remove-rwx-perm-plugin +0 -4
@@ -488,10 +488,6 @@ int lookup_name(struct inode *parent, /*assert ("vs-1486" , dentry->d_op == &get_super_private (parent->i_sb)->ops.dentry); - result =perm_chk (parent, lookup, parent, dentry); -if (result !=0 ) -return 0 ; - name = dentry->d_name.name; len = dentry->d_name.len;
fs/reiser4/plugin/inode_ops.c renamed from fs/reiser4/plugin/inode_ops.c~reiser4-remove-rwx-perm-plugin +10 -30
@@ -150,14 +150,6 @@ int link_common(struct dentry *existing,return RETERR (-EISDIR ); } -/* check permissions */ - result =perm_chk (parent, link, existing, parent, newname); -if (result !=0 ) { -context_set_commit_async (ctx); -reiser4_exit_context (ctx); -return result; - } - parent_dplug =inode_dir_plugin (parent);memset (&entry,0 ,sizeof entry);
@@ -438,20 +430,18 @@ void *follow_link_common(struct dentry *return NULL ; } -/* this is common implementation of vfs's permission method of struct -inode_operations -*/ -int permission_common (struct inode *inode/* object */ , -int mask,/* mode bits to check permissions for */ +/** +* permission_common - permission of inode operations +* @inode: inode to check permissions for +* @mask: mode bits to check permissions for +* @nameidata: +* +* Uses generic function to check for rwx permissions. +*/ +int permission_common (struct inode *inode,int mask,struct nameidata *nameidata) { -/* reiser4_context creation/destruction removed from here, -because permission checks currently don't require this. - -Permission plugin have to create context itself if necessary. */ -assert ("nikita-1687" , inode !=NULL ); - -return perm_chk (inode, mask, inode, mask); +return generic_permission (inode, mask,NULL ); }static int setattr_reserve (reiser4_tree *);
@@ -597,11 +587,6 @@ static int do_create_vfs_child(reiser4_oassert ("nikita-1418" , parent !=NULL );assert ("nikita-1419" , dentry !=NULL ); -/* check permissions */ - result =perm_chk (parent, create, parent, dentry, data); -if (result !=0 ) -return result; -/* check, that name is acceptable for parent */ par_dir =inode_dir_plugin (parent); if (par_dir->is_name_acceptable &&
@@ -901,11 +886,6 @@ static int unlink_check_and_grab(struct/* object being deleted should have stat data */ assert ("vs-949" , !inode_get_flag (child,REISER4_NO_SD )); -/* check permissions */ - result =perm_chk (parent, unlink, parent, victim); -if (result !=0 ) -return result; -/* ask object plugin */ if (fplug->can_rem_link !=NULL && !fplug->can_rem_link (child))return RETERR (-ENOTEMPTY );
fs/reiser4/plugin/security/perm.c renamed from fs/reiser4/plugin/security/perm.c~reiser4-remove-rwx-perm-plugin +8 -53
78 lines not on this page · raw message
fs/reiser4/plugin/security/perm.h renamed from fs/reiser4/plugin/security/perm.h~reiser4-remove-rwx-perm-plugin +1 -12
@@ -65,19 +65,8 @@ typedef struct perm_plugin {int (*rename_ok) (struct inode * old_dir,struct dentry * old, struct inode * new_dir, struct dentry * new); } perm_plugin; -/* NIKITA-FIXME-HANS: I really hate things like this that kill the ability of Meta-. to work. Please eliminate this macro, exce */ -/* call ->check_ok method of perm plugin for inode */ -#define perm_chk (inode, check, ...) \ -({ \ - perm_plugin *perm; \ - \ - perm = inode_perm_plugin(inode); \ - (perm == NULL || perm->check ## _ok == NULL) ? \ - 0 : \ - perm->check ## _ok(__VA_ARGS__); \ -}) -typedef enum {RWX_PERM_ID ,LAST_PERM_ID }reiser4_perm_id ; +typedef enum {NULL_PERM_ID ,LAST_PERM_ID }reiser4_perm_id ;/* __REISER4_PERM_H__ */ #endif
_