Bug #3124
closedRemove any existing references to utmp, use utmpx instead
100%
Description
usr/src/cmd/w/w.c still references the nonuser
macro from utmp.h (utmpx.h's is nonuserx
) and possibly other legacy utmp definitions.
Updated by Sachidananda Urs almost 9 years ago
While at it:
In cmd/w/w.c: 235
/* * read the UTMP_FILE (contains information about each logged in user) */ if (stat(UTMPX_FILE, &sbuf) == ERR) {
comment should match the code. Comment should say `read the UTMPX_FILE'
Updated by Sachidananda Urs almost 9 years ago
Excerpt from Marcel's review comments:
While on this, I suggest to do similar fixes here too:
http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/acct/utmp2wtmp.c#58
http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/wall/wall.c#317
and maybe here as well:
http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/utmpd/utmpd.c#962
In addition, this is in the getutxent(3c) man page:
For records of type USER_PROCESS, the nonuser() and nonuserx() macros
use the value of the ut_exit.e_exit member to mark utmpx entries as
real logins (as opposed to multiple xterms started by the same user on
a window system). This allows the system utilities that display users
to obtain an accurate indication of the number of actual users, while
still permitting each pty to have a utmpx record (as most applications
expect.). The NONROOT_USER macro defines the value that login places in
the ut_exit.e_exit member.
and I see two problems there:
1) the nonuser() macro shouldn't be mentioned here.
2) we should change NONROOT_USER to NONROOT_USRX. (Note: NONROOT_USER is a
typo in any case, the correct name is NONROOT_USR for the utmp entries).
I'd really appreciate to see all of that fixed.
Updated by Sachidananda Urs almost 9 years ago
- Subject changed from w(1) has remaining references to utmp.h to Remove any existing references to utmp, use utmpx instead
Updated by Electric Monk almost 9 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 1eabc4bec6d2a5ad71f6a1f0c019af5438d8b1bf
commit 1eabc4bec6d2a5ad71f6a1f0c019af5438d8b1bf Author: Sachidananda Urs <sacchi@gmail.com> Date: 2014-12-01T16:42:16.000Z 3124 Remove any existing references to utmp, use utmpx instead Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Marcel Telka <marcel@telka.sk> Approved by: Dan McDonald <danmcd@omniti.com>