Commit 64b7bd70 by Christian Brauner Committed by Stéphane Graber

confile: use lxc_safe_u/int in config_init_{u,g}id

parent 104b6a3a
...@@ -1060,14 +1060,24 @@ static int config_init_cmd(const char *key, const char *value, ...@@ -1060,14 +1060,24 @@ static int config_init_cmd(const char *key, const char *value,
static int config_init_uid(const char *key, const char *value, static int config_init_uid(const char *key, const char *value,
struct lxc_conf *lxc_conf) struct lxc_conf *lxc_conf)
{ {
lxc_conf->init_uid = atoi(value); unsigned int init_uid;
if (lxc_safe_uint(value, &init_uid) < 0)
return -1;
lxc_conf->init_uid = init_uid;
return 0; return 0;
} }
static int config_init_gid(const char *key, const char *value, static int config_init_gid(const char *key, const char *value,
struct lxc_conf *lxc_conf) struct lxc_conf *lxc_conf)
{ {
lxc_conf->init_gid = atoi(value); unsigned int init_gid;
if (lxc_safe_uint(value, &init_gid) < 0)
return -1;
lxc_conf->init_gid = init_gid;
return 0; 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