Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
31617ddf
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
31617ddf
编写于
1月 16, 2017
作者:
J
John Johansen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apparmor: add fn to lookup profiles by fqname
Signed-off-by:
N
John Johansen
<
john.johansen@canonical.com
>
上级
3b0aaf58
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
7 deletion
+38
-7
security/apparmor/include/policy.h
security/apparmor/include/policy.h
+2
-0
security/apparmor/include/policy_ns.h
security/apparmor/include/policy_ns.h
+5
-5
security/apparmor/policy.c
security/apparmor/policy.c
+29
-0
security/apparmor/policy_ns.c
security/apparmor/policy_ns.c
+2
-2
未找到文件。
security/apparmor/include/policy.h
浏览文件 @
31617ddf
...
...
@@ -180,6 +180,8 @@ struct aa_profile *aa_find_child(struct aa_profile *parent, const char *name);
struct
aa_profile
*
aa_lookupn_profile
(
struct
aa_ns
*
ns
,
const
char
*
hname
,
size_t
n
);
struct
aa_profile
*
aa_lookup_profile
(
struct
aa_ns
*
ns
,
const
char
*
name
);
struct
aa_profile
*
aa_fqlookupn_profile
(
struct
aa_profile
*
base
,
const
char
*
fqname
,
size_t
n
);
struct
aa_profile
*
aa_match_profile
(
struct
aa_ns
*
ns
,
const
char
*
name
);
ssize_t
aa_replace_profiles
(
void
*
udata
,
size_t
size
,
bool
noreplace
);
...
...
security/apparmor/include/policy_ns.h
浏览文件 @
31617ddf
...
...
@@ -46,11 +46,11 @@ struct aa_ns_acct {
* @uniq_id: a unique id count for the profiles in the namespace
* @dents: dentries for the namespaces file entries in apparmorfs
*
* An aa_ns defines the set profiles that are searched to determine
*
which profile to attach to a task. Profiles can not be shared between
* a
a_nss and profile names within a namespace are guaranteed to be
*
unique. When profiles in separate namespaces have the same name they
*
are NOT considered
to be equivalent.
* An aa_ns defines the set profiles that are searched to determine
which
*
profile to attach to a task. Profiles can not be shared between aa_ns
* a
nd profile names within a namespace are guaranteed to be unique. When
*
profiles in separate namespaces have the same name they are NOT considered
* to be equivalent.
*
* Namespaces are hierarchical and only namespaces and profiles below the
* current namespace are visible.
...
...
security/apparmor/policy.c
浏览文件 @
31617ddf
...
...
@@ -498,6 +498,35 @@ struct aa_profile *aa_lookup_profile(struct aa_ns *ns, const char *hname)
{
return
aa_lookupn_profile
(
ns
,
hname
,
strlen
(
hname
));
}
struct
aa_profile
*
aa_fqlookupn_profile
(
struct
aa_profile
*
base
,
const
char
*
fqname
,
size_t
n
)
{
struct
aa_profile
*
profile
;
struct
aa_ns
*
ns
;
const
char
*
name
,
*
ns_name
;
size_t
ns_len
;
name
=
aa_splitn_fqname
(
fqname
,
n
,
&
ns_name
,
&
ns_len
);
if
(
ns_name
)
{
ns
=
aa_findn_ns
(
base
->
ns
,
ns_name
,
ns_len
);
if
(
!
ns
)
return
NULL
;
}
else
ns
=
aa_get_ns
(
base
->
ns
);
if
(
name
)
profile
=
aa_lookupn_profile
(
ns
,
name
,
n
-
(
name
-
fqname
));
else
if
(
ns
)
/* default profile for ns, currently unconfined */
profile
=
aa_get_newest_profile
(
ns
->
unconfined
);
else
profile
=
NULL
;
aa_put_ns
(
ns
);
return
profile
;
}
/**
* replacement_allowed - test to see if replacement is allowed
* @profile: profile to test if it can be replaced (MAYBE NULL)
...
...
security/apparmor/policy_ns.c
浏览文件 @
31617ddf
...
...
@@ -226,7 +226,7 @@ static void __ns_list_release(struct list_head *head);
/**
* destroy_ns - remove everything contained by @ns
* @ns: n
s
to have it contents removed (NOT NULL)
* @ns: n
amespace
to have it contents removed (NOT NULL)
*/
static
void
destroy_ns
(
struct
aa_ns
*
ns
)
{
...
...
@@ -276,7 +276,7 @@ static void __ns_list_release(struct list_head *head)
}
/**
* aa_alloc_root_ns - allocate the root profile namesp
ca
e
* aa_alloc_root_ns - allocate the root profile namesp
ac
e
*
* Returns: %0 on success else error
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录