Commit 1b2f6ef9 by Christian Brauner Committed by Stéphane Graber

conf/ile: use lxc_safe_uint() in config_kmsg()

parent 99e746b9
...@@ -329,7 +329,7 @@ struct lxc_conf { ...@@ -329,7 +329,7 @@ struct lxc_conf {
int haltsignal; // signal used to halt container int haltsignal; // signal used to halt container
int rebootsignal; // signal used to reboot container int rebootsignal; // signal used to reboot container
int stopsignal; // signal used to hard stop container int stopsignal; // signal used to hard stop container
int kmsg; // if 1, create /dev/kmsg symlink unsigned int kmsg; // if 1, create /dev/kmsg symlink
char *rcfile; // Copy of the top level rcfile we read char *rcfile; // Copy of the top level rcfile we read
// Logfile and logleve can be set in a container config file. // Logfile and logleve can be set in a container config file.
......
...@@ -1270,9 +1270,11 @@ static int config_ttydir(const char *key, const char *value, ...@@ -1270,9 +1270,11 @@ static int config_ttydir(const char *key, const char *value,
static int config_kmsg(const char *key, const char *value, static int config_kmsg(const char *key, const char *value,
struct lxc_conf *lxc_conf) struct lxc_conf *lxc_conf)
{ {
int v = atoi(value); if (lxc_safe_uint(value, &lxc_conf->kmsg) < 0)
return -1;
lxc_conf->kmsg = v; if (lxc_conf->kmsg > 1)
return -1;
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