int inherit_ns_fd[LXC_NS_MAX];
- int start_auto;
- int start_delay;
+ unsigned int start_auto;
+ unsigned int start_delay;
int start_order;
struct lxc_list groups;
int nbd_idx;
struct lxc_conf *lxc_conf)
{
if(strcmp(key, "lxc.start.auto") == 0) {
- lxc_conf->start_auto = atoi(value);
+ if (lxc_safe_uint(value, &lxc_conf->start_auto) < 0)
+ return -1;
+ if (lxc_conf->start_auto > 1)
+ return -1;
return 0;
}
else if (strcmp(key, "lxc.start.delay") == 0) {
- lxc_conf->start_delay = atoi(value);
+ if (lxc_safe_uint(value, &lxc_conf->start_delay) < 0)
+ return -1;
return 0;
}
else if (strcmp(key, "lxc.start.order") == 0) {
- lxc_conf->start_order = atoi(value);
+ if (lxc_safe_int(value, &lxc_conf->start_order) < 0)
+ return -1;
return 0;
}
SYSERROR("Unknown key: %s", key);