Skip to content

Commit

Permalink
confile: cleanup set_config_apparmor_allow_incomplete()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 15, 2020
1 parent 399ea23 commit 095be41
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lxc/confile.c
Expand Up @@ -1381,16 +1381,19 @@ static int set_config_apparmor_allow_incomplete(const char *key,
struct lxc_conf *lxc_conf,
void *data)
{
int ret;

if (lxc_config_value_empty(value)) {
lxc_conf->lsm_aa_allow_incomplete = 0;
return 0;
}

if (lxc_safe_uint(value, &lxc_conf->lsm_aa_allow_incomplete) < 0)
return -1;
ret = lxc_safe_uint(value, &lxc_conf->lsm_aa_allow_incomplete);
if (ret)
return ret;

if (lxc_conf->lsm_aa_allow_incomplete > 1)
return -1;
return ret_errno(EINVAL);

return 0;
}
Expand Down

0 comments on commit 095be41

Please sign in to comment.