Karel Zak [Tue, 4 Sep 2018 09:42:19 +0000 (11:42 +0200)]
build-sys: default to /lib64 for ${exec_prefix}/lib64
We already default to /lib for the default $exec_prefix, but the current
configure does not care about /lib64 although the use-case is exactly
same as for /lib.
The patch uses uuid_unpack and uuid_pack. It makes code more readable
and allow to access proper octens. The same way we already use for
time and random based UUIDs.
Addresses: https://github.com/karelzak/util-linux/issues/683 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 23 Aug 2018 08:13:17 +0000 (10:13 +0200)]
libsmartcols: don't mark as extreme where average is zero
The columns with NOEXTREME flag are internally marked as extreme
(=contains extreme width) if maximal with is greater than 2 *
average_width. This detection has to sure that the average is non-zero
otherwise the column is always "extreme".
Karel Zak [Thu, 23 Aug 2018 08:02:49 +0000 (10:02 +0200)]
libsmartcols: allow to add line to table without columns
The table allows to add columns on the fly when lines already exist.
So, it does not make sense to reject request to add line to table
without columns.
Karel Zak [Wed, 22 Aug 2018 09:43:32 +0000 (11:43 +0200)]
setpriv: add --reset-env
Clear environment in way like su(1), but PATH is set to hard-coded
defaults and /etc/login.defs is not used at all (I guess we want to
keep setpriv(1) simple).
If you need anything more advanced than use env(1).
Addresses: https://github.com/karelzak/util-linux/issues/325 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 16 Aug 2018 14:16:40 +0000 (16:16 +0200)]
sulogin: restore signals after failed exec() only
* removes unnecessary variable
* the current code restores signals always when shell has not been
executed -- this is correct as function sushell() modify signal
mask, but in all another cases we do not need touch the mask.
Especially when we ask for the password in endless while() loop...
Karel Zak [Thu, 16 Aug 2018 13:43:53 +0000 (15:43 +0200)]
libmount: cleanup licenses sections in the files
* add SPDX-License-Identifier (see https://spdx.org/licenses/)
* add "This file part of libmount from util-linux project."
* use proper text for LGPL-2.1-or-later
* use the same texts everywhere
Karel Zak [Thu, 16 Aug 2018 12:47:21 +0000 (14:47 +0200)]
docs: use SPDX license names
Let's use standardized names for licenses. The names used by SPDX
makes things more obvious at first glance. For complete list see:
https://spdx.org/licenses/
Note, this commit does not change any license or so...
Karel Zak [Fri, 10 Aug 2018 08:49:15 +0000 (10:49 +0200)]
su: add --whitelist-environment
* usable with --login to whitelist specified environment variables
* the list is ignored for the core variables like HOME, SHELL, USER,
LOGNAME and PATH (su --login always resets these variables)
Note that su(1) requires password and after successful authentication
user has full control over the session, so he can set arbitrary
environment variables. The whitelist makes things more user friendly
only.
The patch removes unnecessary optimization when allocate environ[]. It
seems better to keep all in glibc hands and just reset the environment
array only.
Addresses: https://github.com/karelzak/util-linux/issues/221 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 13 Aug 2018 12:16:28 +0000 (14:16 +0200)]
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.
Karel Zak [Wed, 8 Aug 2018 09:35:58 +0000 (11:35 +0200)]
fstrim: update .service to follow /etc/fstab
Replace -a with -A to discard mounted filesystems from /etc/fstab. The
original -a forces fstrim to try to discard all filesystems, including
for example manually mounted removable media.
It seems better for widely used .service unit to follow /etc/fstab.
Addresses: https://github.com/karelzak/util-linux/issues/673 Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Thu, 2 Aug 2018 18:35:51 +0000 (19:35 +0100)]
mesg: do not print 'ttyname failed' message unless --verbose requested
Lots of people are confused why mesg(1) is priting this message. Usual
cause seems to be an uninteractive shell trying to turn running 'mesg n'
from a /root/.profile where command invocation is by default on debian based
systems. This might be rare case when failing silently is better.
[kzak@redhat.com: - add note to the man page
- fix if(isatty()) logic]
Reference: https://www.google.com/search?q=mesg+ttyname+failed
Review: https://marc.info/?l=util-linux-ng&m=153319988631233&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 1 Aug 2018 07:10:07 +0000 (09:10 +0200)]
umount: add --quiet option
The command umount supports things like --all-targets and --recursive
to umount all nodes in specified tree. Sometimes it makes sense to
aggressively use wildcards like /dev/sdb* and in this case --quiet
seems like a good choice
umount --quiet --all-targets /dev/sdb*
to suppress 'not mounted' error messages. The new option suppress only
these error messages and nothing else.
Addresses: https://github.com/karelzak/util-linux/issues/672 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 31 Jul 2018 09:07:47 +0000 (11:07 +0200)]
hwclock: remove ntpd from man page
It seems better to use generic "NTP daemon" in the man page than
points to specific ntpd(1) implementation as some distros use for
example chronyd(1) rather than old ntpd(1).
Karel Zak [Mon, 23 Jul 2018 10:21:33 +0000 (12:21 +0200)]
login: use const qualifier for username from PAM or struct passwd [-Wcast-qual]
It seems more robust to use 'const' qualifier for username if this
variable points to external resources like PAM or struct passwd. The
patch introduces new variable cmd_username for username specified on
login(1) command line.