From cccfa758322cd943e2c5fc57bc6e57e3659feaad Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Tue, 30 May 2017 04:41:17 +0200 Subject: [PATCH] confile: config_lsm_aa_incomplete() Signed-off-by: Christian Brauner --- src/lxc/confile.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 894327dd8..a688875c7 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1443,16 +1443,21 @@ static int config_lsm_aa_profile(const char *key, const char *value, } static int config_lsm_aa_incomplete(const char *key, const char *value, - struct lxc_conf *lxc_conf) + struct lxc_conf *lxc_conf) { - if (config_value_empty(value)) + /* Set config value to default. */ + if (config_value_empty(value)) { + lxc_conf->lsm_aa_allow_incomplete = 0; return 0; + } + /* Parse new config value. */ if (lxc_safe_uint(value, &lxc_conf->lsm_aa_allow_incomplete) < 0) return -1; 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"); + ERROR("Wrong value for lxc.lsm_aa_allow_incomplete. Can only " + "be set to 0 or 1"); return -1; } -- 2.47.3