From: Karel Zak <kzak@redhat.com>
To: Lennart Poettering <lennart@poettering.net>
Cc: Olaf Hering <olaf@aepfle.de>, util-linux@vger.kernel.org
Subject: Re: regression in logger output to syslog
Date: Thu, 29 Oct 2015 16:32:35 +0100 [thread overview]
Message-ID: <20151029153235.GD19508@ws.net.home> (raw)
In-Reply-To: <20151029143615.GA27684@gardel-login>
On Thu, Oct 29, 2015 at 03:36:16PM +0100, Lennart Poettering wrote:
> On Thu, 29.10.15 15:20, Olaf Hering (olaf@aepfle.de) wrote:
> > + && geteuid() == 0 && kill(ctl->pid, 0) == 0) {
> >
> > For me its required to run logger as non-root and still get the
> > specified number, like it used to do it years ago.
>
> Sorry, but this is something we are unlikely to support in
> systemd. Allowing unprivileged processes to fake arbitrary UIDs is
> a security problem, and it's really nothing we should provide support
> for.
I think the problem is how Olaf see the log (e.g. by journal -f),
because journal contains *both* (fake and real) PIDs:
as non-root:
$ echo $PPID
1550
$ logger -p info --id=$PPID "This is message baby!"
in the log:
# journalctl -n 1
Oct 29 16:23:26 ws kzak[30917]: This is message baby!
# journalctl --output json-pretty -n 1
{
"__CURSOR" : "s=bbb763e3c9a144809dfe81e768d5a062;i=272c4;b=4f6802931e38450fa2bfd5f549f5103d;m=2c1ada2db1;t=5233fe472ce01;x=aaadb4455972d31",
"__REALTIME_TIMESTAMP" : "1446132206194177",
"__MONOTONIC_TIMESTAMP" : "189429067185",
"_BOOT_ID" : "4f6802931e38450fa2bfd5f549f5103d",
"PRIORITY" : "6",
"_UID" : "1000",
"_GID" : "1000",
"_MACHINE_ID" : "160952cecfb7413db963a880ce10c399",
"_HOSTNAME" : "ws",
"_TRANSPORT" : "syslog",
"SYSLOG_FACILITY" : "1",
"SYSLOG_IDENTIFIER" : "kzak",
"_COMM" : "logger",
"SYSLOG_PID" : "1550",
"MESSAGE" : "This is message baby!",
"_PID" : "30917",
"_SOURCE_REALTIME_TIMESTAMP" : "1446132206193526"
}
_PID is the real PID, SYSLOG_PID is what has been specified by --id on
logger command line.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2015-10-29 15:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 8:25 regression in logger output to syslog Olaf Hering
2015-10-12 10:44 ` Karel Zak
2015-10-12 13:34 ` Olaf Hering
2015-10-21 9:37 ` Olaf Hering
2015-10-29 10:35 ` Karel Zak
2015-10-29 14:20 ` Olaf Hering
2015-10-29 14:36 ` Lennart Poettering
2015-10-29 15:32 ` Karel Zak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151029153235.GD19508@ws.net.home \
--to=kzak@redhat.com \
--cc=lennart@poettering.net \
--cc=olaf@aepfle.de \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox