diff options
author | Eric Paris <eparis@redhat.com> | 2009-06-11 20:31:37 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 06:00:52 +0200 |
commit | 9d9609851003ebed15957f0f2ce18492739ee124 (patch) | |
tree | 2c116865d2f239b5596b22a3a79eecc82f5e1299 /kernel/audit.c | |
parent | Audit: move audit_get_nd completely into audit_watch (diff) | |
download | linux-9d9609851003ebed15957f0f2ce18492739ee124.tar.xz linux-9d9609851003ebed15957f0f2ce18492739ee124.zip |
Audit: clean up all op= output to include string quoting
A number of places in the audit system we send an op= followed by a string
that includes spaces. Somehow this works but it's just wrong. This patch
moves all of those that I could find to be quoted.
Example:
Change From: type=CONFIG_CHANGE msg=audit(1244666690.117:31): auid=0 ses=1
subj=unconfined_u:unconfined_r:auditctl_t:s0-s0:c0.c1023 op=remove rule
key="number2" list=4 res=0
Change To: type=CONFIG_CHANGE msg=audit(1244666690.117:31): auid=0 ses=1
subj=unconfined_u:unconfined_r:auditctl_t:s0-s0:c0.c1023 op="remove rule"
key="number2" list=4 res=0
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index e07ad2340dbe..6194c50e2039 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1450,6 +1450,15 @@ void audit_log_d_path(struct audit_buffer *ab, const char *prefix, kfree(pathname); } +void audit_log_key(struct audit_buffer *ab, char *key) +{ + audit_log_format(ab, " key="); + if (key) + audit_log_untrustedstring(ab, key); + else + audit_log_format(ab, "(null)"); +} + /** * audit_log_end - end one audit record * @ab: the audit_buffer |