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.