]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf/ile: use lxc_safe_uint() in config_monitor()
authorChristian Brauner <christian.brauner@canonical.com>
Fri, 28 Oct 2016 18:05:07 +0000 (20:05 +0200)
committerChristian Brauner <christian.brauner@canonical.com>
Tue, 22 Nov 2016 02:41:17 +0000 (03:41 +0100)
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/conf.h
src/lxc/confile.c

index 156b67372ecaf21c1fcb0ed910dc44f82efdf9f3..3a23f55a1a70ba19ab6f6587cb0779680b4a593f 100644 (file)
@@ -350,7 +350,7 @@ struct lxc_conf {
        int nbd_idx;
 
        /* unshare the mount namespace in the monitor */
-       int monitor_unshare;
+       unsigned int monitor_unshare;
 
        /* set to true when rootfs has been setup */
        bool rootfs_setup;
index 72d46609bccd0205a1a234042a91f9982d3c90c5..614baacf667156820a356ab6c09121b58def31e4 100644 (file)
@@ -1176,7 +1176,8 @@ static int config_monitor(const char *key, const char *value,
                          struct lxc_conf *lxc_conf)
 {
        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;
        }
        SYSERROR("Unknown key: %s", key);