]> err.no Git - systemd/commitdiff
journald: set SO_PASSEC only if selinux is enabled
authorLennart Poettering <lennart@poettering.net>
Wed, 14 Mar 2012 19:07:50 +0000 (20:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 Mar 2012 19:07:50 +0000 (20:07 +0100)
src/journal/journald.c

index aea7816679a714d871beeef31b05dbbb9fd9260e..50f66be9d9c59a79592150b5c8360a8a91019e9a 100644 (file)
@@ -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));