aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/audit.h
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2008-04-18 10:12:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-04-28 06:19:22 -0400
commitb556f8ad58c6e9f8f485c8cef7546e3fc82c382a (patch)
treee7a1c5ce313b6dec9727d69b08b5005dc35709a3 /include/linux/audit.h
parentf09ac9db2aafe36fde9ebd63c8c5d776f6e7bd41 (diff)
Audit: standardize string audit interfaces
This patch standardized the string auditing interfaces. No userspace changes will be visible and this is all just cleanup and consistancy work. We have the following string audit interfaces to use: void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf, size_t len); void audit_log_n_string(struct audit_buffer *ab, const char *buf, size_t n); void audit_log_string(struct audit_buffer *ab, const char *buf); void audit_log_n_untrustedstring(struct audit_buffer *ab, const char *string, size_t n); void audit_log_untrustedstring(struct audit_buffer *ab, const char *string); This may be the first step to possibly fixing some of the issues that people have with the string output from the kernel audit system. But we still don't have an agreed upon solution to that problem. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/audit.h')
-rw-r--r--include/linux/audit.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 25f6ae30dd4b..f938335af75e 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -549,16 +549,20 @@ extern void audit_log_format(struct audit_buffer *ab,
549 const char *fmt, ...) 549 const char *fmt, ...)
550 __attribute__((format(printf,2,3))); 550 __attribute__((format(printf,2,3)));
551extern void audit_log_end(struct audit_buffer *ab); 551extern void audit_log_end(struct audit_buffer *ab);
552extern void audit_log_hex(struct audit_buffer *ab,
553 const unsigned char *buf,
554 size_t len);
555extern int audit_string_contains_control(const char *string, 552extern int audit_string_contains_control(const char *string,
556 size_t len); 553 size_t len);
554extern void audit_log_n_hex(struct audit_buffer *ab,
555 const unsigned char *buf,
556 size_t len);
557extern void audit_log_n_string(struct audit_buffer *ab,
558 const char *buf,
559 size_t n);
560#define audit_log_string(a,b) audit_log_n_string(a, b, strlen(b));
561extern void audit_log_n_untrustedstring(struct audit_buffer *ab,
562 const char *string,
563 size_t n);
557extern void audit_log_untrustedstring(struct audit_buffer *ab, 564extern void audit_log_untrustedstring(struct audit_buffer *ab,
558 const char *string); 565 const char *string);
559extern void audit_log_n_untrustedstring(struct audit_buffer *ab,
560 size_t n,
561 const char *string);
562extern void audit_log_d_path(struct audit_buffer *ab, 566extern void audit_log_d_path(struct audit_buffer *ab,
563 const char *prefix, 567 const char *prefix,
564 struct path *path); 568 struct path *path);
@@ -578,9 +582,11 @@ extern int audit_enabled;
578#define audit_log_vformat(b,f,a) do { ; } while (0) 582#define audit_log_vformat(b,f,a) do { ; } while (0)
579#define audit_log_format(b,f,...) do { ; } while (0) 583#define audit_log_format(b,f,...) do { ; } while (0)
580#define audit_log_end(b) do { ; } while (0) 584#define audit_log_end(b) do { ; } while (0)
581#define audit_log_hex(a,b,l) do { ; } while (0) 585#define audit_log_n_hex(a,b,l) do { ; } while (0)
582#define audit_log_untrustedstring(a,s) do { ; } while (0) 586#define audit_log_n_string(a,c,l) do { ; } while (0)
587#define audit_log_string(a,c) do { ; } while (0)
583#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) 588#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
589#define audit_log_untrustedstring(a,s) do { ; } while (0)
584#define audit_log_d_path(b, p, d) do { ; } while (0) 590#define audit_log_d_path(b, p, d) do { ; } while (0)
585#define audit_enabled 0 591#define audit_enabled 0
586#endif 592#endif