]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
apparmor: handle on-exec
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 18 Mar 2021 10:24:18 +0000 (11:24 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 21 Apr 2021 08:07:34 +0000 (10:07 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lsm/apparmor.c

index deadccc3e7ac5a279c564b8605bdd703cd4221aa..73429ed331de2542a19f7c993f5c8b9e08d9c768 100644 (file)
@@ -1165,15 +1165,15 @@ static int apparmor_process_label_fd_get(struct lsm_ops *ops, pid_t pid, bool on
 
 static int apparmor_process_label_set_at(struct lsm_ops *ops, int label_fd, const char *label, bool on_exec)
 {
+       __do_free char *command = NULL;
        int ret = -1;
        size_t len;
-       __do_free char *command = NULL;
 
        if (on_exec)
-               log_trace(0, "Changing AppArmor profile on exec not supported");
+               TRACE("Changing AppArmor profile on exec not supported");
 
        len = strlen(label) + strlen("changeprofile ") + 1;
-       command = malloc(len);
+       command = zalloc(len);
        if (!command)
                return ret_errno(ENOMEM);