summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-03-04 15:17:45 +0100
committerKay Sievers <kay@vrfy.org>2013-03-04 15:19:10 +0100
commitda4993920cdf5527b8528f0a483b54ab3cbc1971 (patch)
treeca66db8176adca7212febe125ba6e2372b4aa996
parenta0b6422689e37ffee37742d027f91af8bacfa78d (diff)
journal: split journal uid only when audit uid data is valid
-rw-r--r--src/journal/journald-server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index c8a6285a84..545760726e 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -671,12 +671,12 @@ static void dispatch_message_real(
assert(n <= m);
- if (s->split_mode == SPLIT_NONE)
- journal_uid = 0;
- else if (s->split_mode == SPLIT_UID || realuid == 0 || !loginuid_valid)
+ if (s->split_mode == SPLIT_UID && realuid > 0)
journal_uid = realuid;
- else
+ else if (s->split_mode == SPLIT_LOGIN && loginuid > 0 && loginuid_valid)
journal_uid = loginuid;
+ else
+ journal_uid = 0;
write_to_journal(s, journal_uid, iovec, n);
}