summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.1
diff options
context:
space:
mode:
authorKarel Zak2015-10-29 11:18:21 +0100
committerKarel Zak2015-10-29 11:18:21 +0100
commit27a9eb5359c13e403cee2f89c0545c892b5327e3 (patch)
tree4a8b99aa7967e7e009b3a41bb1c99036fa77288a /misc-utils/logger.1
parentlogger: use iovec for all message (diff)
downloadkernel-qcow2-util-linux-27a9eb5359c13e403cee2f89c0545c892b5327e3.tar.gz
kernel-qcow2-util-linux-27a9eb5359c13e403cee2f89c0545c892b5327e3.tar.xz
kernel-qcow2-util-linux-27a9eb5359c13e403cee2f89c0545c892b5327e3.zip
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>
Diffstat (limited to 'misc-utils/logger.1')
-rw-r--r--misc-utils/logger.18
1 files changed, 8 insertions, 0 deletions
diff --git a/misc-utils/logger.1 b/misc-utils/logger.1
index fe525042f..81751f217 100644
--- a/misc-utils/logger.1
+++ b/misc-utils/logger.1
@@ -71,6 +71,14 @@ Log the PID of the logger process with each line. When the optional
argument \fIid\fR is specified, then it is used instead of the logger
command's PID. The use of \fB\-\-id=$$\fR
(PPID) is recommended in scripts that send several messages.
+
+Note that system logging infrastructure (for example systemd when listen on
+/dev/log) may follow local socket credentials to overwrite in the message
+specified PID.
+.BR logger(1)
+is able to to set the socket credentials to the \fIid\fR if you have
+root permissions and process with the specified PID exists, otherwise
+the socket credentials are not modified and the problem is silently ignored.
.TP
.BR \-\-journald [ =\fIfile ]
Write a systemd journal entry. The entry is read from the given \fIfile\fR,