Bug 3031 - Inconsistent PID-values in wtmp file, for root sessions.
Summary: Inconsistent PID-values in wtmp file, for root sessions.
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 8.0p1
Hardware: Other AIX
: P5 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-06 02:04 AEST by Lőrinczy Zsigmond
Modified: 2019-07-06 02:06 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lőrinczy Zsigmond 2019-07-06 02:04:20 AEST
Inconsistent PID-values in wtmp file, for root sessions.

In case of root-sessions (unlike normal-user-sessions),
functions login(3) and logout(3)+logwtmp(3) are called
by different processes.
(These three functions come from library 'libutil'.)

Both login(3) and logwtmp(3) call getpid(2) to get
the PID of the current process to store into file 'wtmp'
(field 'ut_pid' in struct 'utmp').

Command last(1), at least on Linux, doesn't seem to care,
it still finds the matching login-logout pairs, based on field 'ut_line'.

On the other hand, last(1) on AIX doesn't work this way:
it doesn't recognise the pairs, so according to it
root-sessions are never closed, they are "still logged on" for good.

The only work-around I could come up with is configure-option
'-disable-libutil'.

I hope you could find a way to make these values match
(ie calling login(3) and logout(3)+logwtmp(3) from the same process).

Thank you for your attention.

Regards: Lorinczy Zsigmond