summaryrefslogtreecommitdiffstats
path: root/kernel/audit_watch.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2018-11-16 16:30:10 -0500
committerPaul Moore <paul@paul-moore.com>2018-11-19 12:31:42 -0500
commita2c97da11cdb973b752dd434aee9636ce10ee737 (patch)
tree0892061d8793295861dc20485abf3699b5199f8a /kernel/audit_watch.c
parent0fe3c7fceb500de2d0adfb9dcf292580cd43ea38 (diff)
downloadlinux-a2c97da11cdb973b752dd434aee9636ce10ee737.tar.bz2
audit: use session_info helper
There are still a couple of places (mark and watch config changes) that open code auid and ses fields in sequence in records instead of using the audit_log_session_info() helper. Use the helper. Adjust the helper to accommodate being the first fields. Passes audit-testsuite. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> [PM: fixed misspellings in the description] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/audit_watch.c')
-rw-r--r--kernel/audit_watch.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index 787c7afdf829..568e48d1d0ab 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -245,9 +245,8 @@ static void audit_watch_log_rule_change(struct audit_krule *r, struct audit_watc
ab = audit_log_start(NULL, GFP_NOFS, AUDIT_CONFIG_CHANGE);
if (!ab)
return;
- audit_log_format(ab, "auid=%u ses=%u op=%s",
- from_kuid(&init_user_ns, audit_get_loginuid(current)),
- audit_get_sessionid(current), op);
+ audit_log_session_info(ab);
+ audit_log_format(ab, "op=%s", op);
audit_log_format(ab, " path=");
audit_log_untrustedstring(ab, w->path);
audit_log_key(ab, r->filterkey);