]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lslogins: return 1 on "lslogins nonexisting"
authorKarel Zak <kzak@redhat.com>
Mon, 13 Aug 2018 12:16:28 +0000 (14:16 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Aug 2018 12:16:28 +0000 (14:16 +0200)
commitba1e20349753efb4a6d255f4fe2f6ebdda590ed9
tree5586e039c6c750ee6a804aa5e4d807173a67f2e1
parent09a4313ceb17c946a348d863b635970608cc75f2
lslogins: return 1 on "lslogins nonexisting"

The default behavior for -l and -g is to silently ignore unknown login
names, but this is very confusing when you explicitly specify just one
login name.

Note that the current implementation also prints empty "Last log" for
nonexisting user. It seems ugly.

 # lslogins nonexisting

 Last logs:

new version:

 # lslogins nonexisting
 lt-lslogins: cannot found 'nonexisting'
 # echo $?
 1

The -l and -g behaviour has not been changed.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1614967
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/lslogins.1
login-utils/lslogins.c