diff options
author | Chris Wright <chrisw@osdl.org> | 2005-05-11 05:55:10 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-05-11 05:55:10 -0400 |
commit | c1b773d87eadc3972d697444127e89a7291769a2 (patch) | |
tree | edfce2e842c3b6be70f3b90584507aab9fb3de8f /include | |
parent | 197c69c6afd2deb7eec44040ff533d90d26c6161 (diff) |
Add audit_log_type
Add audit_log_type to allow callers to specify type and pid when logging.
Convert audit_log to wrapper around audit_log_type. Could have
converted all audit_log callers directly, but common case is default
of type AUDIT_KERNEL and pid 0. Update audit_log_start to take type
and pid values when creating a new audit_buffer. Move sequences that
did audit_log_start, audit_log_format, audit_set_type, audit_log_end,
to simply call audit_log_type directly. This obsoletes audit_set_type
and audit_set_pid, so remove them.
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/audit.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 58c5589b531f..405332ebf3c6 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -216,11 +216,14 @@ extern void audit_signal_info(int sig, struct task_struct *t); | |||
216 | #ifdef CONFIG_AUDIT | 216 | #ifdef CONFIG_AUDIT |
217 | /* These are defined in audit.c */ | 217 | /* These are defined in audit.c */ |
218 | /* Public API */ | 218 | /* Public API */ |
219 | extern void audit_log(struct audit_context *ctx, | 219 | #define audit_log(ctx, fmt, args...) \ |
220 | const char *fmt, ...) | 220 | audit_log_type(ctx, AUDIT_KERNEL, 0, fmt, ##args) |
221 | __attribute__((format(printf,2,3))); | 221 | extern void audit_log_type(struct audit_context *ctx, int type, |
222 | int pid, const char *fmt, ...) | ||
223 | __attribute__((format(printf,4,5))); | ||
222 | 224 | ||
223 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx); | 225 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx, int type, |
226 | int pid); | ||
224 | extern void audit_log_format(struct audit_buffer *ab, | 227 | extern void audit_log_format(struct audit_buffer *ab, |
225 | const char *fmt, ...) | 228 | const char *fmt, ...) |
226 | __attribute__((format(printf,2,3))); | 229 | __attribute__((format(printf,2,3))); |
@@ -240,8 +243,9 @@ extern void audit_send_reply(int pid, int seq, int type, | |||
240 | void *payload, int size); | 243 | void *payload, int size); |
241 | extern void audit_log_lost(const char *message); | 244 | extern void audit_log_lost(const char *message); |
242 | #else | 245 | #else |
243 | #define audit_log(t,f,...) do { ; } while (0) | 246 | #define audit_log(c,f,...) do { ; } while (0) |
244 | #define audit_log_start(t) ({ NULL; }) | 247 | #define audit_log_type(c,t,p,f,...) do { ; } while (0) |
248 | #define audit_log_start(c,t,p) ({ NULL; }) | ||
245 | #define audit_log_vformat(b,f,a) do { ; } while (0) | 249 | #define audit_log_vformat(b,f,a) do { ; } while (0) |
246 | #define audit_log_format(b,f,...) do { ; } while (0) | 250 | #define audit_log_format(b,f,...) do { ; } while (0) |
247 | #define audit_log_end(b) do { ; } while (0) | 251 | #define audit_log_end(b) do { ; } while (0) |