struct lxc_list hooks[NUM_LXC_HOOKS];
char *lsm_aa_profile;
- int lsm_aa_allow_incomplete;
+ unsigned int lsm_aa_allow_incomplete;
char *lsm_se_context;
int tmp_umount_proc;
char *seccomp; // filename with the seccomp rules
static int config_lsm_aa_incomplete(const char *key, const char *value,
struct lxc_conf *lxc_conf)
{
- int v = atoi(value);
+ if (lxc_safe_uint(value, &lxc_conf->lsm_aa_allow_incomplete) < 0)
+ return -1;
- lxc_conf->lsm_aa_allow_incomplete = v == 1 ? 1 : 0;
+ if (lxc_conf->lsm_aa_allow_incomplete > 1) {
+ ERROR("Wrong value for lxc.lsm_aa_allow_incomplete. Can only be set to 0 or 1");
+ return -1;
+ }
return 0;
}
if (!value || strlen(value) == 0)
return 0;
- if (value[0] >= '0' && value[0] <= '9')
- newlevel = atoi(value);
- else
+ if (value[0] >= '0' && value[0] <= '9') {
+ if (lxc_safe_int(value, &newlevel) < 0)
+ return -1;
+ } else {
newlevel = lxc_log_priority_to_int(value);
+ }
// store these values in the lxc_conf, and then try to set for
// actual current logging.
lxc_conf->loglevel = newlevel;