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:
@@ -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;
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user