audit: include subject in login records
authorEric Paris <eparis@redhat.com>
Thu, 20 Jan 2011 00:22:35 +0000 (19:22 -0500)
committerEric Paris <eparis@redhat.com>
Thu, 20 Mar 2014 14:11:57 +0000 (10:11 -0400)
The login uid change record does not include the selinux context of the
task logging in.  Add that information.

(Updated from 2011-01: RHBZ:670328 -- RGB)

Reported-by: Steve Grubb <sgrubb@redhat.com>
Acked-by: James Morris <jmorris@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
kernel/auditsc.c

index 61ac3cf53f1deff0c061e94cdc794072f0f48b40..bd3de52600fff8b2b68390d39a3ae3b3b5ce1ec9 100644 (file)
@@ -2050,12 +2050,10 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid,
        ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_LOGIN);
        if (!ab)
                return;
-       audit_log_format(ab, "pid=%d uid=%u"
-                        " old-auid=%u auid=%u old-ses=%u ses=%u"
-                        " res=%d",
-                        task_pid_nr(current), uid,
-                        oldloginuid, loginuid, oldsessionid, sessionid,
-                        !rc);
+       audit_log_format(ab, "pid=%d uid=%u", task_pid_nr(current), uid);
+       audit_log_task_context(ab);
+       audit_log_format(ab, " old-auid=%u auid=%u old-ses=%u ses=%u res=%d",
+                        oldloginuid, loginuid, oldsessionid, sessionid, !rc);
        audit_log_end(ab);
 }