confile: add getter for lxc.ephemeral

parent dfeb7e42
...@@ -204,6 +204,8 @@ static int set_config_init_gid(const char *, const char *, struct lxc_conf *); ...@@ -204,6 +204,8 @@ 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 get_config_init_gid(struct lxc_container *, const char *, char *, int);
static int set_config_ephemeral(const char *, const char *, struct lxc_conf *); static int set_config_ephemeral(const char *, const char *, struct lxc_conf *);
static int get_config_ephemeral(struct lxc_container *, const char *, char *, int);
static int set_config_no_new_privs(const char *, const char *, struct lxc_conf *); static int set_config_no_new_privs(const char *, const char *, struct lxc_conf *);
static int set_config_limit(const char *, const char *, struct lxc_conf *); static int set_config_limit(const char *, const char *, struct lxc_conf *);
...@@ -275,7 +277,7 @@ static struct lxc_config_t config[] = { ...@@ -275,7 +277,7 @@ static struct lxc_config_t config[] = {
{ "lxc.init_cmd", set_config_init_cmd, get_config_init_cmd, 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_uid", set_config_init_uid, get_config_init_uid, NULL},
{ "lxc.init_gid", set_config_init_gid, get_config_init_gid, NULL}, { "lxc.init_gid", set_config_init_gid, get_config_init_gid, NULL},
{ "lxc.ephemeral", set_config_ephemeral, NULL, NULL}, { "lxc.ephemeral", set_config_ephemeral, get_config_ephemeral, NULL},
{ "lxc.syslog", set_config_syslog, get_config_syslog, NULL}, { "lxc.syslog", set_config_syslog, get_config_syslog, NULL},
{ "lxc.no_new_privs", set_config_no_new_privs, NULL, NULL}, { "lxc.no_new_privs", set_config_no_new_privs, NULL, NULL},
{ "lxc.limit", set_config_limit, NULL, NULL}, { "lxc.limit", set_config_limit, NULL, NULL},
...@@ -2722,9 +2724,7 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv, ...@@ -2722,9 +2724,7 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
{ {
const char *v = NULL; const char *v = NULL;
if (strcmp(key, "lxc.ephemeral") == 0) if (strcmp(key, "lxc.no_new_privs") == 0)
return lxc_get_conf_int(c, retv, inlen, c->ephemeral);
else if (strcmp(key, "lxc.no_new_privs") == 0)
return lxc_get_conf_int(c, retv, inlen, c->no_new_privs); return lxc_get_conf_int(c, retv, inlen, c->no_new_privs);
else if (strcmp(key, "lxc.limit") == 0) // all limits else if (strcmp(key, "lxc.limit") == 0) // all limits
return lxc_get_limit_entry(c, retv, inlen, "all"); return lxc_get_limit_entry(c, retv, inlen, "all");
...@@ -3994,3 +3994,10 @@ static int get_config_init_gid(struct lxc_container *c, const char *key, ...@@ -3994,3 +3994,10 @@ static int get_config_init_gid(struct lxc_container *c, const char *key,
return lxc_get_conf_int(c->lxc_conf, retv, inlen, return lxc_get_conf_int(c->lxc_conf, retv, inlen,
c->lxc_conf->init_gid); c->lxc_conf->init_gid);
} }
static int get_config_ephemeral(struct lxc_container *c, const char *key,
char *retv, int inlen)
{
return lxc_get_conf_int(c->lxc_conf, retv, inlen,
c->lxc_conf->ephemeral);
}
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