]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus tests: Shut down audit socket
authorSimon McVittie <smcv@collabora.com>
Sat, 29 Jun 2019 15:45:25 +0000 (16:45 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 3 Jul 2019 10:11:23 +0000 (11:11 +0100)
Some CI environments run build-time tests as root with CAP_AUDIT_WRITE.
In this case we need to close the audit socket so that it will not be
reported as leaked.

Signed-off-by: Simon McVittie <smcv@collabora.com>
test/bus/dispatch-sha1.c
test/bus/dispatch.c
test/bus/main.c

index 364300120f6c661fb744896890ebda8ffe5e64b2..a32508bc010488fbe077f6e71d6ad58d128c0101 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <dbus/dbus-test-tap.h>
 
+#include "bus/audit.h"
 #include "bus/selinux.h"
 #include "test/test-utils.h"
 
@@ -44,6 +45,8 @@ test_post_hook (void)
 {
   if (_dbus_getenv ("DBUS_TEST_SELINUX"))
     bus_selinux_shutdown ();
+
+  bus_audit_shutdown ();
 }
 
 static DBusTestCase test = { "dispatch-sha1", bus_dispatch_sha1_test };
index 52bf363d1a76faffc0df3f0962d9f0054e954cc2..ad6718fee11418b5f2b5dbc78d0f8f7e63755678 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <dbus/dbus-test-tap.h>
 
+#include "bus/audit.h"
 #include "bus/selinux.h"
 #include "test/test-utils.h"
 
@@ -44,6 +45,8 @@ test_post_hook (void)
 {
   if (_dbus_getenv ("DBUS_TEST_SELINUX"))
     bus_selinux_shutdown ();
+
+  bus_audit_shutdown ();
 }
 
 static DBusTestCase test = { "dispatch", bus_dispatch_test };
index 770654302bfbd7822633036dc1f67cb99766247f..445e926938d2f7592525fb4ca155af16c576d17d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <dbus/dbus-test-tap.h>
 
+#include "bus/audit.h"
 #include "bus/selinux.h"
 #include "test/test-utils.h"
 
@@ -45,6 +46,8 @@ test_post_hook (void)
 {
   if (_dbus_getenv ("DBUS_TEST_SELINUX"))
     bus_selinux_shutdown ();
+
+  bus_audit_shutdown ();
 }
 
 static DBusTestCase tests[] =