]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: cleanup set_config_apparmor_allow_nesting()
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 13:48:33 +0000 (14:48 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 14:40:49 +0000 (15:40 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 7dfd984230be9aa5182c9e3c97932ca6ff0f3e16..373d0d6f038d7b2a75e949b5a64a1a53c09ea636 100644 (file)
@@ -1484,14 +1484,17 @@ static int set_config_apparmor_allow_nesting(const char *key,
                                             struct lxc_conf *lxc_conf,
                                             void *data)
 {
+       int ret;
+
        if (lxc_config_value_empty(value))
                return clr_config_apparmor_allow_nesting(key, lxc_conf, NULL);
 
-       if (lxc_safe_uint(value, &lxc_conf->lsm_aa_allow_nesting) < 0)
-               return -1;
+       ret = lxc_safe_uint(value, &lxc_conf->lsm_aa_allow_nesting);
+       if (ret)
+               return ret;
 
        if (lxc_conf->lsm_aa_allow_nesting > 1)
-               return -1;
+               return ret_errno(EINVAL);
 
        return 0;
 }