Commit 67aa4551 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

journald: set SO_PASSEC only if selinux is enabled

parent 43673799
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment