summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-socket.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-11-11 14:54:58 +0100
committerTom Gundersen <teg@jklm.no>2015-11-11 14:54:58 +0100
commita2e6fbf5c047314db036000203b42c6aac1e3511 (patch)
tree0075e2354fce27e2d7c5963bcaa41758db9cfa86 /src/libsystemd/sd-bus/bus-socket.c
parenta5642c7ee3dbd9aae07b531a81c0f02b3c2e1103 (diff)
parent91d0f17e03e3975cac95c418e101f5266b56e897 (diff)
Merge pull request #1848 from poettering/journal-sync
add journalctl --sync command and other stuff
Diffstat (limited to 'src/libsystemd/sd-bus/bus-socket.c')
-rw-r--r--src/libsystemd/sd-bus/bus-socket.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
index a5cb667630..25873dea1e 100644
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -36,6 +36,7 @@
#include "hexdecoct.h"
#include "macro.h"
#include "missing.h"
+#include "selinux-util.h"
#include "signal-util.h"
#include "stdio-util.h"
#include "string-util.h"
@@ -608,9 +609,11 @@ static void bus_get_peercred(sd_bus *b) {
b->ucred_valid = getpeercred(b->input_fd, &b->ucred) >= 0;
/* Get the SELinux context of the peer */
- r = getpeersec(b->input_fd, &b->label);
- if (r < 0 && r != -EOPNOTSUPP)
- log_debug_errno(r, "Failed to determine peer security context: %m");
+ if (mac_selinux_use()) {
+ r = getpeersec(b->input_fd, &b->label);
+ if (r < 0 && r != -EOPNOTSUPP)
+ log_debug_errno(r, "Failed to determine peer security context: %m");
+ }
}
static int bus_socket_start_auth_client(sd_bus *b) {