提交 9e5a1ca0 编写于 作者: W wujing 提交者: lifeng68

generate lxc.selinux.mount_context field

Signed-off-by: Nwujing <wujing50@huawei.com>
上级 4c2820b9
...@@ -2460,6 +2460,25 @@ out_free: ...@@ -2460,6 +2460,25 @@ out_free:
return ret; return ret;
} }
static int trans_oci_file_selinux(const oci_runtime_config_linux *l, struct lcr_list *conf)
{
struct lcr_list *node = NULL;
int ret = -1;
if (l->mount_label != NULL) {
node = create_lcr_list_node("lxc.selinux.mount_context", l->mount_label);
if (node == NULL) {
goto out;
}
lcr_list_add_tail(conf, node);
}
ret = 0;
out:
return ret;
}
/* trans oci linux */ /* trans oci linux */
struct lcr_list *trans_oci_linux(const oci_runtime_config_linux *l, char **seccomp_conf) struct lcr_list *trans_oci_linux(const oci_runtime_config_linux *l, char **seccomp_conf)
{ {
...@@ -2521,12 +2540,19 @@ struct lcr_list *trans_oci_linux(const oci_runtime_config_linux *l, char **secco ...@@ -2521,12 +2540,19 @@ struct lcr_list *trans_oci_linux(const oci_runtime_config_linux *l, char **secco
// seccomp // seccomp
if (l->seccomp != NULL && seccomp_conf != NULL) { if (l->seccomp != NULL && seccomp_conf != NULL) {
ret = trans_oci_seccomp(l->seccomp, seccomp_conf); ret = trans_oci_seccomp(l->seccomp, seccomp_conf);
if (ret) { if (ret != 0) {
goto out_free; goto out_free;
} }
} }
// selinux mount label
ret = trans_oci_file_selinux(l, conf);
if (ret != 0) {
goto out_free;
}
return conf; return conf;
out_free: out_free:
lcr_free_config(conf); lcr_free_config(conf);
free(conf); free(conf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册