2
0
mirror of git://github.com/lxc/lxc synced 2025-09-01 08:13:45 +00:00

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

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
This commit is contained in:
Christian Brauner
2016-10-28 20:05:07 +02:00
parent 3590152f01
commit 226dc30e4f
2 changed files with 3 additions and 2 deletions

View File

@@ -350,7 +350,7 @@ struct lxc_conf {
int nbd_idx; int nbd_idx;
/* unshare the mount namespace in the monitor */ /* unshare the mount namespace in the monitor */
int monitor_unshare; unsigned int monitor_unshare;
/* set to true when rootfs has been setup */ /* set to true when rootfs has been setup */
bool rootfs_setup; bool rootfs_setup;

View File

@@ -1176,7 +1176,8 @@ static int config_monitor(const char *key, const char *value,
struct lxc_conf *lxc_conf) struct lxc_conf *lxc_conf)
{ {
if(strcmp(key, "lxc.monitor.unshare") == 0) { if(strcmp(key, "lxc.monitor.unshare") == 0) {
lxc_conf->monitor_unshare = atoi(value); if (lxc_safe_uint(value, &lxc_conf->monitor_unshare) < 0)
return -1;
return 0; return 0;
} }
SYSERROR("Unknown key: %s", key); SYSERROR("Unknown key: %s", key);