confile: add clearer for lxc.aa_profile

parent 6bd86308
...@@ -85,6 +85,7 @@ static int clr_config_kmsg(const char *, struct lxc_conf *); ...@@ -85,6 +85,7 @@ static int clr_config_kmsg(const char *, struct lxc_conf *);
static int set_config_lsm_aa_profile(const char *, const char *, struct lxc_conf *); static int set_config_lsm_aa_profile(const char *, const char *, struct lxc_conf *);
static int get_config_lsm_aa_profile(const char *, char *, int, struct lxc_conf *); static int get_config_lsm_aa_profile(const char *, char *, int, struct lxc_conf *);
static int clr_config_lsm_aa_profile(const char *, struct lxc_conf *);
static int set_config_lsm_aa_incomplete(const char *, const char *, struct lxc_conf *); static int set_config_lsm_aa_incomplete(const char *, const char *, struct lxc_conf *);
static int get_config_lsm_aa_incomplete(const char *, char *, int, struct lxc_conf *); static int get_config_lsm_aa_incomplete(const char *, char *, int, struct lxc_conf *);
...@@ -218,12 +219,12 @@ static int set_config_limit(const char *, const char *, struct lxc_conf *); ...@@ -218,12 +219,12 @@ static int set_config_limit(const char *, const char *, struct lxc_conf *);
static int get_config_limit(const char *, char *, int, struct lxc_conf *); static int get_config_limit(const char *, char *, int, struct lxc_conf *);
static struct lxc_config_t config[] = { static struct lxc_config_t config[] = {
{ "lxc.arch", set_config_personality, get_config_personality, clr_config_personality, }, { "lxc.arch", set_config_personality, get_config_personality, clr_config_personality, },
{ "lxc.pts", set_config_pts, get_config_pts, clr_config_pts, }, { "lxc.pts", set_config_pts, get_config_pts, clr_config_pts, },
{ "lxc.tty", set_config_tty, get_config_tty, clr_config_tty, }, { "lxc.tty", set_config_tty, get_config_tty, clr_config_tty, },
{ "lxc.devttydir", set_config_ttydir, get_config_ttydir, clr_config_ttydir, }, { "lxc.devttydir", set_config_ttydir, get_config_ttydir, clr_config_ttydir, },
{ "lxc.kmsg", set_config_kmsg, get_config_kmsg, clr_config_kmsg, }, { "lxc.kmsg", set_config_kmsg, get_config_kmsg, clr_config_kmsg, },
{ "lxc.aa_profile", set_config_lsm_aa_profile, get_config_lsm_aa_profile, NULL }, { "lxc.aa_profile", set_config_lsm_aa_profile, get_config_lsm_aa_profile, clr_config_lsm_aa_profile, },
{ "lxc.aa_allow_incomplete", set_config_lsm_aa_incomplete, get_config_lsm_aa_incomplete, NULL }, { "lxc.aa_allow_incomplete", set_config_lsm_aa_incomplete, get_config_lsm_aa_incomplete, NULL },
{ "lxc.se_context", set_config_lsm_se_context, get_config_lsm_se_context, NULL }, { "lxc.se_context", set_config_lsm_se_context, get_config_lsm_se_context, NULL },
{ "lxc.cgroup", set_config_cgroup, get_config_cgroup, NULL }, { "lxc.cgroup", set_config_cgroup, get_config_cgroup, NULL },
...@@ -2828,10 +2829,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) ...@@ -2828,10 +2829,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
free(c->rootfs.bdev_type); free(c->rootfs.bdev_type);
c->rootfs.bdev_type = NULL; c->rootfs.bdev_type = NULL;
} else if (strcmp(key, "lxc.aa_profile") == 0) {
free(c->lsm_aa_profile);
c->lsm_aa_profile = NULL;
} else if (strcmp(key, "lxc.aa_allow_incomplete") == 0) { } else if (strcmp(key, "lxc.aa_allow_incomplete") == 0) {
c->lsm_aa_allow_incomplete = 0; c->lsm_aa_allow_incomplete = 0;
...@@ -4100,3 +4097,10 @@ static inline int clr_config_kmsg(const char *key, struct lxc_conf *c) ...@@ -4100,3 +4097,10 @@ static inline int clr_config_kmsg(const char *key, struct lxc_conf *c)
c->kmsg = 0; c->kmsg = 0;
return 0; return 0;
} }
static inline int clr_config_lsm_aa_profile(const char *key, struct lxc_conf *c)
{
free(c->lsm_aa_profile);
c->lsm_aa_profile = NULL;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment