]> git.ipfire.org Git - thirdparty/util-linux.git/commit
logger: use --id as local socket credentials
authorKarel Zak <kzak@redhat.com>
Thu, 29 Oct 2015 10:18:21 +0000 (11:18 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 29 Oct 2015 10:18:21 +0000 (11:18 +0100)
commit27a9eb5359c13e403cee2f89c0545c892b5327e3
tree4a8b99aa7967e7e009b3a41bb1c99036fa77288a
parent17c8aa1dc0f05fb68ccd78aa725f8fe8a5cc269d
logger: use --id as local socket credentials

If you have really paranoid syslog (or systemd who listens on /dev/log)
then it replaces in the message PID with a real PID from socket header
credentials:

 # echo $PPID
 1550

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:22:13 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:22:13 ws kzak[22100]: This is message baby!
                         ^^^^^

This patch forces kernel to accept another *valid* PID if logger(1)
executed with root permissions; improved version:

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:26:00 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:26:00 ws kzak[1550]: This is message baby!

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/logger.1
misc-utils/logger.c