summaryrefslogtreecommitdiff
path: root/bus/main.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-02-19 12:04:26 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-08-06 17:12:36 +0100
commit327a52e4eb90c94dc47579b7890974b65f2f9e53 (patch)
treecc652814cd42332f56ba8fded32a388f6ed7393c /bus/main.c
parentd0e9d8e7bad9280f03e9389eef220d219f84dd16 (diff)
downloaddbus-327a52e4eb90c94dc47579b7890974b65f2f9e53.tar.gz
bus: move shared libaudit code to a new audit.[ch]
This fixes various duplicated libaudit interactions in both SELinux and AppArmor code paths, including opening two audit sockets if both SELinux and AppArmor were enabled at compile time. In particular, audit.c is now the only user of libcap-ng. This commit is not intended to introduce any functional changes, except for the de-duplication. The actual audit_log_user_avc_message() call is still duplicated, because the SELinux and AppArmor code paths use different mechanisms to compose the audit message: the SELinux path uses a statically-sized buffer on the stack which might be subject to truncation, whereas the AppArmor path uses malloc() (via DBusString) and falls back to using syslog on a memory allocation failure. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225 Reviewed-by: Colin Walters <walters@verbum.org> [smcv: minor issues raised during review are subsequently fixed] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'bus/main.c')
-rw-r--r--bus/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bus/main.c b/bus/main.c
index cb08055d..ee5e1ebf 100644
--- a/bus/main.c
+++ b/bus/main.c
@@ -40,6 +40,7 @@
#endif
#include "selinux.h"
#include "apparmor.h"
+#include "audit.h"
static BusContext *context;
@@ -661,6 +662,7 @@ main (int argc, char **argv)
bus_context_unref (context);
bus_selinux_shutdown ();
bus_apparmor_shutdown ();
+ bus_audit_shutdown ();
return 0;
}