Skip to contentSkip to conversation

lslogins --user-accs

DISCUSSION Mantas Mikulėnas 2 participants 2 messages Jul 6, 2015 – Jul 15, 2015 Util-Linux package

lore
Share & tools
lore
#0 lore raw

Trying out lslogins, noticed two problems (?) with the --user-accs option:

1) The manpage documents --user-accs[=threshold] to override the "hardcoded" minimum of 1000, but the code doesn't actually /accept/ a parameter (it reads the actual threshold from login.defs).

2) While not documented, --user-accs also applies the /maximum/ uid limit. I noticed this on a system that has "UID_MAX 19999" because LDAP-based accounts start at 20000, which means lslogins -u will show local users but not LDAP ones.

~

Also the "Last logs:" output seems to have ^A / 0x01 in random places:

00:35:14 krenew<^A>[1295]: renewing credentials

On another system:

Feb07/00:05 sshd[3009657]: Received disconnect from 78.60.211.195: 11:
disconnected by user<^A>

Signature · 1 line
Mantas Mikulėnas <[email protected]>
maintainer
#1 lore raw
Quoted 10 lines · Mantas Mikulėnas

Trying out lslogins, noticed two problems (?) with the --user-accs option:

1) The manpage documents --user-accs[=threshold] to override the "hardcoded" minimum of 1000, but the code doesn't actually /accept/ a parameter (it reads the actual threshold from login.defs).

2) While not documented, --user-accs also applies the /maximum/ uid limit. I noticed this on a system that has "UID_MAX 19999" because LDAP-based accounts start at 20000, which means lslogins -u will show local users but not LDAP ones.

For now I have fixed the man page and removed [=threshold] and added hint about uids ranges specified by /etc/login.defs.

Maybe the ideal solution would be to add optional parameter

    --user-accs[=min:max]
    --system-accs[=min:max]
Quoted 8 lines

Also the "Last logs:" output seems to have ^A / 0x01 in random places:

00:35:14 krenew<^A>[1295]: renewing credentials

On another system:

Feb07/00:05 sshd[3009657]: Received disconnect from 78.60.211.195: 11:
disconnected by user<^A>

Hmm... we read this from systemd journal by sd_journal_get_data() and print it without any change.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com