2004-04-12 12:24:55

by Olaf Dietsche

[permalink] [raw]
Subject: Re: [PATCH] change audit_log_format() -> printk() (was: 2.6.5-mm4)

Andrew Morton <[email protected]> writes:

> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.5/2.6.5-mm4/
>
> lightweight-auditing-framework.patch
> Light-weight Auditing Framework
> Light-weight Auditing Framework update
> lightweight-auditing-framework warning fixes
> Light-weight Auditing Framework receive filter fixes
> lightweight-auditing-framework-receive-filter-fixes compile fix

I've seen several printk()'s substituted with audit_log_format().
Maybe this small patch helps those not using the audit framework.

I have not tested this patch.

Regards, Olaf.

diff -urN a/include/linux/audit.h b/include/linux/audit.h
--- a/include/linux/audit.h Mon Apr 12 11:58:33 2004
+++ b/include/linux/audit.h Mon Apr 12 12:01:43 2004
@@ -197,8 +197,8 @@
#define audit_log(t,f,...) do { ; } while (0)
#define audit_log_start(t) ({ NULL; })
#define audit_log_vformat(b,f,a) do { ; } while (0)
-#define audit_log_format(b,f,...) do { ; } while (0)
-#define audit_log_end(b) do { ; } while (0)
+#define audit_log_format(b,f,args...) printk(f, args)
+#define audit_log_end(b) printk("\n")
#define audit_log_end_fast(b) do { ; } while (0)
#define audit_log_end_irq(b) do { ; } while (0)
#define audit_log_d_path(b,p,d,v) do { ; } while (0)