]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
selinux: check mac_selinux_init() in tests
authorChristian Göttsche <cgzones@googlemail.com>
Thu, 25 Jun 2020 12:36:49 +0000 (14:36 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 Jun 2020 16:39:42 +0000 (18:39 +0200)
Since bc8d57f2903d mac_selinux_init() is checked and considered fatal
tree-wide.

Coverity complains about it not being checked in the test code.

Follow-up of: #16223
Fixes: CID 1429975
src/test/test-udev.c

index 493d6df2a834981c14ff20d11f9492322b78f466..208e7a0e96a7d6e0bb0fde3fbcd62642fb717303 100644 (file)
@@ -82,7 +82,10 @@ static int run(int argc, char *argv[]) {
         }
 
         log_debug("version %s", GIT_VERSION);
-        mac_selinux_init();
+
+        r = mac_selinux_init();
+        if (r < 0)
+                return r;
 
         action = argv[1];
         devpath = argv[2];