[systemd-commits] src/journal
Kay Sievers
kay at kemper.freedesktop.org
Wed Apr 24 17:14:42 PDT 2013
src/journal/journald-server.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit e7ff4e7fe9f3abd2297e4ef7b95dcb2804e051c3
Author: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Date: Wed Apr 24 13:04:27 2013 -0700
journal: remove build warning when SELinux is disabled
A small patch to remove a build warnining when SELinux is disabled.
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 4134e9f..8eab5ad 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -508,7 +508,7 @@ static void dispatch_message_real(
source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)],
boot_id[sizeof("_BOOT_ID=") + 32] = "_BOOT_ID=",
machine_id[sizeof("_MACHINE_ID=") + 32] = "_MACHINE_ID=";
- char *comm, *exe, *cmdline, *cgroup, *session, *unit, *selinux_context, *hostname;
+ char *comm, *exe, *cmdline, *cgroup, *session, *unit, *hostname;
sd_id128_t id;
int r;
char *t, *c;
@@ -615,7 +615,7 @@ static void dispatch_message_real(
#ifdef HAVE_SELINUX
if (label) {
- selinux_context = alloca(sizeof("_SELINUX_CONTEXT=") + label_len);
+ char *selinux_context = alloca(sizeof("_SELINUX_CONTEXT=") + label_len);
*((char*) mempcpy(stpcpy(selinux_context, "_SELINUX_CONTEXT="), label, label_len)) = 0;
IOVEC_SET_STRING(iovec[n++], selinux_context);
@@ -623,7 +623,8 @@ static void dispatch_message_real(
security_context_t con;
if (getpidcon(ucred->pid, &con) >= 0) {
- selinux_context = strappenda("_SELINUX_CONTEXT=", con);
+ char *selinux_context = strappenda("_SELINUX_CONTEXT=", con);
+
freecon(con);
IOVEC_SET_STRING(iovec[n++], selinux_context);
}
More information about the systemd-commits
mailing list