]> git.ipfire.org Git - thirdparty/util-linux.git/commit
last: make is_phantom() when kernel config does not include audit support
authorSami Kerola <kerolasa@iki.fi>
Mon, 11 Aug 2014 22:04:26 +0000 (23:04 +0100)
committerSami Kerola <kerolasa@iki.fi>
Fri, 19 Sep 2014 18:31:01 +0000 (19:31 +0100)
commit8813da1ea2d42776c98943617e673d9cf8ec8a77
tree29be53f400c5451ccb6849a35b7563552306fa56
parent96c4bc4dd2a35ccb8ab10b5341fa4f90ace146f4
last: make is_phantom() when kernel config does not include audit support

When kernel CONFIG_AUDIT is not set the /proc/<pid>/loginuid information
is not present resulting live sessions to be marked 'gone - no logout' in
last(1) print out.  To go-around this change makes last(1) to look
/dev/<tty> device ownership as a substitute of loginuid.

The go-around seems to work fairly well, but it has it short comings.
For example after closing a X window session the /dev/ttyN file seems to
be owned by root, not the user who had it before entering to the X
session.  While that is suboptimal it is still better than an attmempt to
determine uid_t by looking owner of the /proc/<struct utmp ut_pid>, that
is a login(1) process running as root.

The issue was found using Archlinux installation.

$ pacman -Qi linux
Name           : linux
Version        : 3.16-2
[...]
Build Date     : Mon Aug 4 18:06:51 2014

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/last.c