Skip to content

Commit

Permalink
confile: add getter for lxc.init_gid
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner authored and stgraber committed Jul 16, 2017
1 parent 88c2c00 commit da2bb1b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/lxc/confile.c
Expand Up @@ -189,6 +189,8 @@ static int set_config_init_uid(const char *, const char *, struct lxc_conf *);
static int get_config_init_uid(struct lxc_container *, const char *, char *, int);

static int set_config_init_gid(const char *, const char *, struct lxc_conf *);
static int get_config_init_gid(struct lxc_container *, const char *, char *, int);

static int set_config_ephemeral(const char *, const char *, struct lxc_conf *);

static struct lxc_config_t config[] = {
Expand Down Expand Up @@ -258,7 +260,7 @@ static struct lxc_config_t config[] = {
{ "lxc.environment", set_config_environment, get_config_environment, NULL},
{ "lxc.init_cmd", set_config_init_cmd, get_config_init_cmd, NULL},
{ "lxc.init_uid", set_config_init_uid, get_config_init_uid, NULL},
{ "lxc.init_gid", set_config_init_gid, NULL, NULL},
{ "lxc.init_gid", set_config_init_gid, get_config_init_gid, NULL},
{ "lxc.ephemeral", set_config_ephemeral, NULL, NULL},
};

Expand Down Expand Up @@ -2481,9 +2483,7 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
{
const char *v = NULL;

if (strcmp(key, "lxc.init_gid") == 0)
return lxc_get_conf_int(c, retv, inlen, c->init_gid);
else if (strcmp(key, "lxc.ephemeral") == 0)
if (strcmp(key, "lxc.ephemeral") == 0)
return lxc_get_conf_int(c, retv, inlen, c->ephemeral);
else return -1;

Expand Down Expand Up @@ -3669,3 +3669,10 @@ static int get_config_init_uid(struct lxc_container *c, const char *key,
return lxc_get_conf_int(c->lxc_conf, retv, inlen,
c->lxc_conf->init_uid);
}

static int get_config_init_gid(struct lxc_container *c, const char *key,
char *retv, int inlen)
{
return lxc_get_conf_int(c->lxc_conf, retv, inlen,
c->lxc_conf->init_gid);
}

0 comments on commit da2bb1b

Please sign in to comment.