Hi,
the manual page of logger says regarding --id:
logger(1) is able to set
those socket credentials to the given id, but only if you have root
permissions and a process with the specified PID exists, otherwise
the socket credentials are not modified and the problem is silently
ignored.
However, when logger is called without privilges, for example in an
unprivileged podman container, this is not silently ignored:
$ sudo setpriv --inh-caps -SYS_ADMIN --bounding-set -SYS_ADMIN -- logger -t test --id="$$" 'BAD: without CAP_SYS_ADMIN'; echo $?
logger: send message failed: Operation not permitted
0
Is this the intended way to handle things? Writing an error message to
stdout is not "silently".
Greetings
Marc