lslogins: improve nologins and shadow usage

 * fix coding style
 * don't require shadow entries
 * check for /var/run/nologin

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: remove --sort-by-name

If we really need a sort functionality hardcoded into lslogins(1) then we need
a generic sort options (like for lsblk,--sort <column>).

Note that it seems that "lslogins | sort --key <col>" is good enough for now as
lslogins(1) does not convert any data to human readable non-precise format (like
for example lsblk SIZE column etc.).

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: add sys-utils/uname26.8 to gitignore

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: clean up password hash check

 * rename to PWD-* column names
 * add PWD-DENY for accounts where is no possible to login by password
 * PWD-LOCK (was LOCKED) checks for valid but locked pawwords
 * LOGIN renamed to USER

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: cleanup time formats

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: fix nologins check

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: improve COL_PWD_WARN and COL_NPROCS desc

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: cleanup -a output

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: cleanup default outputs

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: cleanup some command line options

Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: fix pretty-print columns

Signed-off-by: Karel Zak <kzak@redhat.com>
rename: allow renaming in subdirectories

Earlier the rename(1) considered path as possible string to be renamed,
could lead to an issue with none existing destination.  See below for
demonstration of this issue.  After this change all directory elements
are ignored when the match finding happens.

$ cd $(mktemp -d)
$ mkdir aa ab
$ touch a{a,b}/aa
$ rename -v a x */aa
rename: aa/aa: rename to xa/aa failed: No such file or directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: add rename(1) checks

Check basic file moves, symlink relinking, and both file moves and
symlinks when operations are have directory in destination path.

Reviewed-by: Ruediger Meier <sweet_f_a@gmx.de>
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>