apparmor: fix change_hat debug output
authorJohn Johansen <john.johansen@canonical.com>
Mon, 16 Jan 2017 08:43:05 +0000 (00:43 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Mon, 16 Jan 2017 09:18:48 +0000 (01:18 -0800)
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/procattr.c

index 4cb5f3dc906d64e6855989853d3acaad4f7bc4f0..a9a9ee6659ae5ebc70e860a7bb5a98a308c33960 100644 (file)
@@ -139,12 +139,13 @@ int aa_setprocattr_changehat(char *args, size_t size, int test)
                for (count = 0; (hat < end) && count < 16; ++count) {
                        char *next = hat + strlen(hat) + 1;
                        hats[count] = hat;
+                       AA_DEBUG("%s: (pid %d) Magic 0x%llx count %d hat '%s'\n"
+                                , __func__, current->pid, token, count, hat);
                        hat = next;
                }
-       }
-
-       AA_DEBUG("%s: Magic 0x%llx Hat '%s'\n",
-                __func__, token, hat ? hat : NULL);
+       } else
+               AA_DEBUG("%s: (pid %d) Magic 0x%llx count %d Hat '%s'\n",
+                        __func__, current->pid, token, count, "<NULL>");
 
        return aa_change_hat(hats, count, token, test);
 }