From 67aa455172189d92abbcf3dc90b2848278edcf1b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 14 Mar 2012 20:07:50 +0100 Subject: journald: set SO_PASSEC only if selinux is enabled --- src/journal/journald.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/journal') diff --git a/src/journal/journald.c b/src/journal/journald.c index aea7816679..50f66be9d9 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -2308,10 +2308,12 @@ static int open_syslog_socket(Server *s) { return -errno; } +#ifdef HAVE_SE one = 1; r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one)); if (r < 0) log_warning("SO_PASSSEC failed: %m"); +#endif one = 1; r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)); @@ -2369,10 +2371,12 @@ static int open_native_socket(Server*s) { return -errno; } +#ifdef HAVE_SELINUX one = 1; r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one)); if (r < 0) log_warning("SO_PASSSEC failed: %m"); +#endif one = 1; r = setsockopt(s->native_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)); -- cgit v1.2.3