From: Lennart Poettering Date: Wed, 14 Mar 2012 19:07:50 +0000 (+0100) Subject: journald: set SO_PASSEC only if selinux is enabled X-Git-Tag: v44~25 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67aa455172189d92abbcf3dc90b2848278edcf1b;p=systemd journald: set SO_PASSEC only if selinux is enabled --- diff --git a/src/journal/journald.c b/src/journal/journald.c index aea78166..50f66be9 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));