diff options
author | 2013-12-11 15:28:09 -0500 | |
---|---|---|
committer | 2014-01-13 22:32:38 -0500 | |
commit | 5ee9a75c9fdaebd3ac8176f9f5c73fdcd27c1ad1 (patch) | |
tree | ae7bcc782a86d2e5a1bb17461194756a086cdae7 | |
parent | audit: log on errors from filter user rules (diff) | |
download | linux-5ee9a75c9fdaebd3ac8176f9f5c73fdcd27c1ad1.tar.gz linux-5ee9a75c9fdaebd3ac8176f9f5c73fdcd27c1ad1.tar.bz2 linux-5ee9a75c9fdaebd3ac8176f9f5c73fdcd27c1ad1.zip |
audit: fix dangling keywords in audit_log_set_loginuid() output
Remove spaces between "new", "old" label modifiers and "auid", "ses" labels in
log output since userspace tools can't parse orphaned keywords.
Make variable names more consistent and intuitive.
Make audit_log_format() argument code easier to read.
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
-rw-r--r-- | kernel/auditsc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 5c237343cd9b..10176cd5956a 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -1969,21 +1969,24 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid, int rc) { struct audit_buffer *ab; - uid_t uid, ologinuid, nloginuid; + uid_t uid, oldloginuid, loginuid; if (!audit_enabled) return; uid = from_kuid(&init_user_ns, task_uid(current)); - ologinuid = from_kuid(&init_user_ns, koldloginuid); - nloginuid = from_kuid(&init_user_ns, kloginuid), + oldloginuid = from_kuid(&init_user_ns, koldloginuid); + loginuid = from_kuid(&init_user_ns, kloginuid), ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_LOGIN); if (!ab) return; - audit_log_format(ab, "pid=%d uid=%u old auid=%u new auid=%u old " - "ses=%u new ses=%u res=%d", current->pid, uid, ologinuid, - nloginuid, oldsessionid, sessionid, !rc); + audit_log_format(ab, "pid=%d uid=%u" + " old-auid=%u new-auid=%u old-ses=%u new-ses=%u" + " res=%d", + current->pid, uid, + oldloginuid, loginuid, oldsessionid, sessionid, + !rc); audit_log_end(ab); } |