Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
98bc993f
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
98bc993f
编写于
8月 02, 2008
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] get rid of nameidata in audit_tree
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
421748ec
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
24 deletion
+24
-24
kernel/audit_tree.c
kernel/audit_tree.c
+24
-24
未找到文件。
kernel/audit_tree.c
浏览文件 @
98bc993f
...
...
@@ -532,7 +532,7 @@ void audit_trim_trees(void)
list_add
(
&
cursor
,
&
tree_list
);
while
(
cursor
.
next
!=
&
tree_list
)
{
struct
audit_tree
*
tree
;
struct
nameidata
nd
;
struct
path
path
;
struct
vfsmount
*
root_mnt
;
struct
node
*
node
;
struct
list_head
list
;
...
...
@@ -544,12 +544,12 @@ void audit_trim_trees(void)
list_add
(
&
cursor
,
&
tree
->
list
);
mutex_unlock
(
&
audit_filter_mutex
);
err
=
path_lookup
(
tree
->
pathname
,
0
,
&
nd
);
err
=
kern_path
(
tree
->
pathname
,
0
,
&
path
);
if
(
err
)
goto
skip_it
;
root_mnt
=
collect_mounts
(
nd
.
path
.
mnt
,
nd
.
path
.
dentry
);
path_put
(
&
nd
.
path
);
root_mnt
=
collect_mounts
(
path
.
mnt
,
path
.
dentry
);
path_put
(
&
path
);
if
(
!
root_mnt
)
goto
skip_it
;
...
...
@@ -580,19 +580,19 @@ void audit_trim_trees(void)
}
static
int
is_under
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
,
struct
nameidata
*
nd
)
struct
path
*
path
)
{
if
(
mnt
!=
nd
->
path
.
mnt
)
{
if
(
mnt
!=
path
->
mnt
)
{
for
(;;)
{
if
(
mnt
->
mnt_parent
==
mnt
)
return
0
;
if
(
mnt
->
mnt_parent
==
nd
->
path
.
mnt
)
if
(
mnt
->
mnt_parent
==
path
->
mnt
)
break
;
mnt
=
mnt
->
mnt_parent
;
}
dentry
=
mnt
->
mnt_mountpoint
;
}
return
is_subdir
(
dentry
,
nd
->
path
.
dentry
);
return
is_subdir
(
dentry
,
path
->
dentry
);
}
int
audit_make_tree
(
struct
audit_krule
*
rule
,
char
*
pathname
,
u32
op
)
...
...
@@ -618,7 +618,7 @@ void audit_put_tree(struct audit_tree *tree)
int
audit_add_tree_rule
(
struct
audit_krule
*
rule
)
{
struct
audit_tree
*
seed
=
rule
->
tree
,
*
tree
;
struct
nameidata
nd
;
struct
path
path
;
struct
vfsmount
*
mnt
,
*
p
;
struct
list_head
list
;
int
err
;
...
...
@@ -637,11 +637,11 @@ int audit_add_tree_rule(struct audit_krule *rule)
/* do not set rule->tree yet */
mutex_unlock
(
&
audit_filter_mutex
);
err
=
path_lookup
(
tree
->
pathname
,
0
,
&
nd
);
err
=
kern_path
(
tree
->
pathname
,
0
,
&
path
);
if
(
err
)
goto
Err
;
mnt
=
collect_mounts
(
nd
.
path
.
mnt
,
nd
.
path
.
dentry
);
path_put
(
&
nd
.
path
);
mnt
=
collect_mounts
(
path
.
mnt
,
path
.
dentry
);
path_put
(
&
path
);
if
(
!
mnt
)
{
err
=
-
ENOMEM
;
goto
Err
;
...
...
@@ -690,29 +690,29 @@ int audit_tag_tree(char *old, char *new)
{
struct
list_head
cursor
,
barrier
;
int
failed
=
0
;
struct
nameidata
nd
;
struct
path
path
;
struct
vfsmount
*
tagged
;
struct
list_head
list
;
struct
vfsmount
*
mnt
;
struct
dentry
*
dentry
;
int
err
;
err
=
path_lookup
(
new
,
0
,
&
nd
);
err
=
kern_path
(
new
,
0
,
&
path
);
if
(
err
)
return
err
;
tagged
=
collect_mounts
(
nd
.
path
.
mnt
,
nd
.
path
.
dentry
);
path_put
(
&
nd
.
path
);
tagged
=
collect_mounts
(
path
.
mnt
,
path
.
dentry
);
path_put
(
&
path
);
if
(
!
tagged
)
return
-
ENOMEM
;
err
=
path_lookup
(
old
,
0
,
&
nd
);
err
=
kern_path
(
old
,
0
,
&
path
);
if
(
err
)
{
drop_collected_mounts
(
tagged
);
return
err
;
}
mnt
=
mntget
(
nd
.
path
.
mnt
);
dentry
=
dget
(
nd
.
path
.
dentry
);
path_put
(
&
nd
.
path
);
mnt
=
mntget
(
path
.
mnt
);
dentry
=
dget
(
path
.
dentry
);
path_put
(
&
path
);
if
(
dentry
==
tagged
->
mnt_root
&&
dentry
==
mnt
->
mnt_root
)
follow_up
(
&
mnt
,
&
dentry
);
...
...
@@ -733,7 +733,7 @@ int audit_tag_tree(char *old, char *new)
list_add
(
&
cursor
,
&
tree
->
list
);
mutex_unlock
(
&
audit_filter_mutex
);
err
=
path_lookup
(
tree
->
pathname
,
0
,
&
nd
);
err
=
kern_path
(
tree
->
pathname
,
0
,
&
path
);
if
(
err
)
{
put_tree
(
tree
);
mutex_lock
(
&
audit_filter_mutex
);
...
...
@@ -741,15 +741,15 @@ int audit_tag_tree(char *old, char *new)
}
spin_lock
(
&
vfsmount_lock
);
if
(
!
is_under
(
mnt
,
dentry
,
&
nd
))
{
if
(
!
is_under
(
mnt
,
dentry
,
&
path
))
{
spin_unlock
(
&
vfsmount_lock
);
path_put
(
&
nd
.
path
);
path_put
(
&
path
);
put_tree
(
tree
);
mutex_lock
(
&
audit_filter_mutex
);
continue
;
}
spin_unlock
(
&
vfsmount_lock
);
path_put
(
&
nd
.
path
);
path_put
(
&
path
);
list_for_each_entry
(
p
,
&
list
,
mnt_list
)
{
failed
=
tag_chunk
(
p
->
mnt_root
->
d_inode
,
tree
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录