X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournald-stream.c;h=9ca26e26d654877869124970b386e315f49d3f62;hb=1daf8121524246932b18be8dd7d63e792dee5de2;hp=9c4efec9bcd4713f83285a0088ddbab259a149bb;hpb=ac50788b0f5aeee09e7d45db28ae8ab7f39cd52e;p=elogind.git diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c index 9c4efec9b..9ca26e26d 100644 --- a/src/journal/journald-stream.c +++ b/src/journal/journald-stream.c @@ -29,6 +29,7 @@ #endif #include "socket-util.h" +#include "selinux-util.h" #include "journald-server.h" #include "journald-stream.h" #include "journald-syslog.h" @@ -323,7 +324,7 @@ void stdout_stream_free(StdoutStream *s) { if (s->server) { assert(s->server->n_stdout_streams > 0); s->server->n_stdout_streams --; - LIST_REMOVE(StdoutStream, stdout_stream, s->server->stdout_streams, s); + LIST_REMOVE(stdout_stream, s->server->stdout_streams, s); } if (s->fd >= 0) { @@ -381,8 +382,10 @@ int stdout_stream_new(Server *s) { } #ifdef HAVE_SELINUX - if (getpeercon(fd, &stream->security_context) < 0 && errno != ENOPROTOOPT) - log_error("Failed to determine peer security context: %m"); + if (use_selinux()) { + if (getpeercon(fd, &stream->security_context) < 0 && errno != ENOPROTOOPT) + log_error("Failed to determine peer security context: %m"); + } #endif if (shutdown(fd, SHUT_WR) < 0) { @@ -401,7 +404,7 @@ int stdout_stream_new(Server *s) { } stream->server = s; - LIST_PREPEND(StdoutStream, stdout_stream, s->stdout_streams, stream); + LIST_PREPEND(stdout_stream, s->stdout_streams, stream); s->n_stdout_streams ++; return 0;