]> git.ipfire.org Git - thirdparty/util-linux.git/commit
su: use LOG_PID for syslog
authorSam James <sam@gentoo.org>
Fri, 7 Jan 2022 01:54:41 +0000 (01:54 +0000)
committerSam James <sam@gentoo.org>
Fri, 7 Jan 2022 01:58:20 +0000 (01:58 +0000)
commitfc996d72e4469f1486feda25c76652549704635f
treebcc1b65251068f32dd495d5498ace6e5fd510b37
parent3afbdb58ea55a27b94a94c8fa28e79640d365ba5
su: use LOG_PID for syslog

Enable PID in syslog lines for `su`.

In Gentoo Linux, we recently switched `su` providers from
shadow to util-linux.

It was notiiced that syslog output differs slightly
with util-linux (no PID):
```
Jan  7 20:00:50 localhost su: (to root) root on pts/5
Jan  7 20:00:50 localhost su: pam_unix(su:session): session opened for user root(uid=0) by sam(uid=0)
```
... whereas shadow's `su` gave (with PID):
```
Jan  7 20:52:50 localhost su[22245]: Successful su for root by root
Jan  7 20:52:50 localhost su[22245]: + /dev/pts/5 root:root
```

This change enables PID logging to give shadow-like syslog
output for `su`:
```
Jan  7 20:54:32 localhost su[10827]: (to root) root on pts/6
Jan  7 20:54:32 localhost su[10827]: pam_unix(su:session): session opened for user root(uid=0) by sam(uid=0)
```

Signed-off-by: Sam James <sam@gentoo.org>
login-utils/su-common.c