mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-31 03:01:48 +00:00
confile: add clearer for lxc.init_cmd
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
832fb63a0b
commit
8e90af3ecb
@ -230,6 +230,7 @@ static int clr_config_environment(const char *, struct lxc_conf *);
|
||||
|
||||
static int set_config_init_cmd(const char *, const char *, struct lxc_conf *);
|
||||
static int get_config_init_cmd(const char *, char *, int, struct lxc_conf *);
|
||||
static int clr_config_init_cmd(const char *, struct lxc_conf *);
|
||||
|
||||
static int set_config_init_uid(const char *, const char *, struct lxc_conf *);
|
||||
static int get_config_init_uid(const char *, char *, int, struct lxc_conf *);
|
||||
@ -315,7 +316,7 @@ static struct lxc_config_t config[] = {
|
||||
{ "lxc.monitor.unshare", set_config_monitor, get_config_monitor, clr_config_monitor, },
|
||||
{ "lxc.group", set_config_group, get_config_group, clr_config_group, },
|
||||
{ "lxc.environment", set_config_environment, get_config_environment, clr_config_environment, },
|
||||
{ "lxc.init_cmd", set_config_init_cmd, get_config_init_cmd, NULL },
|
||||
{ "lxc.init_cmd", set_config_init_cmd, get_config_init_cmd, clr_config_init_cmd, },
|
||||
{ "lxc.init_uid", set_config_init_uid, get_config_init_uid, NULL },
|
||||
{ "lxc.init_gid", set_config_init_gid, get_config_init_gid, NULL },
|
||||
{ "lxc.ephemeral", set_config_ephemeral, get_config_ephemeral, NULL },
|
||||
@ -2771,10 +2772,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
|
||||
if (strncmp(key, "lxc.limit", 9) == 0) {
|
||||
ret = lxc_clear_limits(c, key);
|
||||
|
||||
} else if (strcmp(key, "lxc.init_cmd") == 0) {
|
||||
free(c->init_cmd);
|
||||
c->init_cmd = NULL;
|
||||
|
||||
} else if (strcmp(key, "lxc.init_uid") == 0) {
|
||||
c->init_uid = 0;
|
||||
|
||||
@ -4225,3 +4222,10 @@ static inline int clr_config_environment(const char *key, struct lxc_conf *c)
|
||||
{
|
||||
return lxc_clear_environment(c);
|
||||
}
|
||||
|
||||
static inline int clr_config_init_cmd(const char *key, struct lxc_conf *c)
|
||||
{
|
||||
free(c->init_cmd);
|
||||
c->init_cmd = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user