[PATCH] Remove security_inode_post_create/mkdir/symlink/mknod hooks
This patch removes the inode_post_create/mkdir/mknod/symlink LSM hooks as they are obsoleted by the new inode_init_security hook that enables atomic inode security labeling. If anyone sees any reason to retain these hooks, please speak now. Also, is anyone using the post_rename/link hooks; if not, those could also be removed. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
此提交包含在:
16
fs/namei.c
16
fs/namei.c
@@ -1316,10 +1316,8 @@ int vfs_create(struct inode *dir, struct dentry *dentry, int mode,
|
||||
return error;
|
||||
DQUOT_INIT(dir);
|
||||
error = dir->i_op->create(dir, dentry, mode, nd);
|
||||
if (!error) {
|
||||
if (!error)
|
||||
fsnotify_create(dir, dentry->d_name.name);
|
||||
security_inode_post_create(dir, dentry, mode);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1635,10 +1633,8 @@ int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
|
||||
|
||||
DQUOT_INIT(dir);
|
||||
error = dir->i_op->mknod(dir, dentry, mode, dev);
|
||||
if (!error) {
|
||||
if (!error)
|
||||
fsnotify_create(dir, dentry->d_name.name);
|
||||
security_inode_post_mknod(dir, dentry, mode, dev);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1708,10 +1704,8 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
|
||||
|
||||
DQUOT_INIT(dir);
|
||||
error = dir->i_op->mkdir(dir, dentry, mode);
|
||||
if (!error) {
|
||||
if (!error)
|
||||
fsnotify_mkdir(dir, dentry->d_name.name);
|
||||
security_inode_post_mkdir(dir,dentry, mode);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1947,10 +1941,8 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, i
|
||||
|
||||
DQUOT_INIT(dir);
|
||||
error = dir->i_op->symlink(dir, dentry, oldname);
|
||||
if (!error) {
|
||||
if (!error)
|
||||
fsnotify_create(dir, dentry->d_name.name);
|
||||
security_inode_post_symlink(dir, dentry, oldname);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
新增問題並參考
封鎖使用者