]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
5 years agobuild-sys: release++ (v2.33-rc1) v2.33-rc1
Karel Zak [Tue, 25 Sep 2018 09:26:58 +0000 (11:26 +0200)] 
build-sys: release++ (v2.33-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: add choom to build-sys test
Karel Zak [Mon, 24 Sep 2018 09:37:13 +0000 (11:37 +0200)] 
tests: add choom to build-sys test

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: fix gtkdoc warning
Karel Zak [Mon, 24 Sep 2018 09:21:09 +0000 (11:21 +0200)] 
docs: fix gtkdoc warning

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update v2.33-ReleaseNotes
Karel Zak [Thu, 20 Sep 2018 12:27:55 +0000 (14:27 +0200)] 
docs: update v2.33-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Thu, 20 Sep 2018 10:19:06 +0000 (12:19 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Wed, 19 Sep 2018 10:54:05 +0000 (12:54 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: update sv.po (from translationproject.org)
Sebastian Rasmussen [Wed, 19 Sep 2018 10:49:46 +0000 (12:49 +0200)] 
po: update sv.po (from translationproject.org)

5 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Wed, 19 Sep 2018 10:49:46 +0000 (12:49 +0200)] 
po: update pt_BR.po (from translationproject.org)

5 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Wed, 19 Sep 2018 10:49:46 +0000 (12:49 +0200)] 
po: update ja.po (from translationproject.org)

5 years agolibfdisk: (docs) add missing function
Karel Zak [Wed, 19 Sep 2018 10:00:59 +0000 (12:00 +0200)] 
libfdisk: (docs) add missing function

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: move udev and blkid stuff to lsblk-properties.c
Karel Zak [Wed, 19 Sep 2018 09:25:08 +0000 (11:25 +0200)] 
lsblk: move udev and blkid stuff to lsblk-properties.c

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: cleanup udev/blkid properties code
Karel Zak [Wed, 19 Sep 2018 09:04:35 +0000 (11:04 +0200)] 
lsblk: cleanup udev/blkid properties code

* split properties to separate struct which is allocated only when
  udev or blkid provides some information

* use separate function for udev and blkid and hide details in generic
  get_device_properties()

* make sure we do not overwrite stuff udev and blkid (but this is only
  theoretic issue as we do not call get_properties_by_blkid() directly
  from code)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: update sfdisk resize
Karel Zak [Mon, 17 Sep 2018 14:22:14 +0000 (16:22 +0200)] 
tests: update sfdisk resize

due to 2f35c1ead621f42f32f7777232568cb03185b473

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibfdisk: count gaps to possible size when resize
Karel Zak [Mon, 17 Sep 2018 09:58:50 +0000 (11:58 +0200)] 
libfdisk: count gaps to possible size when resize

The current code counts only partition sizes when it counts possible
space, but we have gaps between the partitions. It seems better to
count all based on offsets rather than sizes.

Addresses: https://github.com/karelzak/util-linux/issues/693
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: encapsulate stat() usage
Karel Zak [Fri, 14 Sep 2018 14:27:26 +0000 (16:27 +0200)] 
lsblk: encapsulate stat() usage

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/strutils: return from xstrmode()
Karel Zak [Fri, 14 Sep 2018 14:26:38 +0000 (16:26 +0200)] 
lib/strutils: return from xstrmode()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: differentiate between swap and mount
Karel Zak [Fri, 14 Sep 2018 13:57:45 +0000 (15:57 +0200)] 
lsblk: differentiate between swap and mount

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: use lsblk_ prefix mountpoint getter
Karel Zak [Fri, 14 Sep 2018 13:49:00 +0000 (15:49 +0200)] 
lsblk: use lsblk_ prefix mountpoint getter

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: init/deinit libmount stuff
Karel Zak [Fri, 14 Sep 2018 13:45:53 +0000 (15:45 +0200)] 
lsblk: init/deinit libmount stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: move mount stuff to lsblk-mnt.c
Karel Zak [Fri, 14 Sep 2018 13:41:39 +0000 (15:41 +0200)] 
lsblk: move mount stuff to lsblk-mnt.c

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: add lsblk.h
Karel Zak [Fri, 14 Sep 2018 13:36:59 +0000 (15:36 +0200)] 
lsblk: add lsblk.h

* move core struct to the header file
* move debug stuff to the header file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: add columns FSAVAIL,FSSIZE,FSUSED,FSUSE%
Karel Zak [Thu, 13 Sep 2018 10:11:06 +0000 (12:11 +0200)] 
lsblk: add columns FSAVAIL,FSSIZE,FSUSED,FSUSE%

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibfdisk: accept grain script header
Karel Zak [Wed, 12 Sep 2018 11:18:08 +0000 (13:18 +0200)] 
libfdisk: accept grain script header

The "grain" variable is used to calculate partitions alignment. The
default is 1MiB (or minimal I/O size). The libfdisk provides API to overwrite
this default, but this feature has been nowhere accessible for
end-user.

This patch support for "grain: <size>" in libfdisk scripts.

Addresses: https://github.com/karelzak/util-linux/issues/688
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosfdisk: document script GPT headers
Karel Zak [Wed, 12 Sep 2018 10:26:06 +0000 (12:26 +0200)] 
sfdisk: document script GPT headers

Add first-lba, last-lba and table-length to the sfdisk man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'more' of https://github.com/kerolasa/util-linux
Karel Zak [Tue, 11 Sep 2018 11:42:52 +0000 (13:42 +0200)] 
Merge branch 'more' of https://github.com/kerolasa/util-linux

* 'more' of https://github.com/kerolasa/util-linux:
  more: rename functions
  more: rename variable names
  more: remove unnecessary ifdef preprosessor directives
  more: do not call fileno() for std{in,out,err} streams
  more: remove 'register' keywords
  more: remove pointless functions
  more: return is statement not a function
  more: remove dead code and useless comments

5 years agounshare: remove -s from --help output
Karel Zak [Tue, 11 Sep 2018 10:43:03 +0000 (12:43 +0200)] 
unshare: remove -s from --help output

The code and man page do not assume -s to be short alias to
--setgroups.

This commit also a little bit change --help output formatting to make
it more readable and structured.

Addresses: https://github.com/karelzak/util-linux/pull/692
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: don't ask udev when --sysroot specified
Karel Zak [Tue, 11 Sep 2018 07:53:18 +0000 (09:53 +0200)] 
lsblk: don't ask udev when --sysroot specified

We use --sysroot to get information about block devices from /proc and
/sys dumps. In this case does not make sense to read anything from
udev as udevd is about the current system devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agofallocate: add missing semicolon
Matti Niemenmaa [Mon, 10 Sep 2018 12:21:31 +0000 (15:21 +0300)] 
fallocate: add missing semicolon

This broke compilation when HAVE_POSIX_FALLOCATE was undefined. The typo
dates to the original posix_fallocate support added in commit
833f9a7aae713278eec5f85266597482f18c7370.

Signed-off-by: Matti Niemenmaa <matti.niemenmaa+git@iki.fi>
5 years agoMerge branch 'motd' of https://github.com/lnussel/util-linux
Karel Zak [Mon, 10 Sep 2018 08:35:32 +0000 (10:35 +0200)] 
Merge branch 'motd' of https://github.com/lnussel/util-linux

5 years agolsblk: prefer MODEL from udev DB
Karel Zak [Mon, 10 Sep 2018 08:29:37 +0000 (10:29 +0200)] 
lsblk: prefer MODEL from udev DB

sysfs device model is truncated to 16 characters:

> cat /sys/block/sda/device/model
Crucial_CT128MX1
> udevadm info --query=property /dev/sda | grep MODEL=
ID_MODEL=Crucial_CT128MX100SSD1

sysfs uses INQUARY response which has the 16 characters limitation and
udev uses something else.

Addresses: https://github.com/karelzak/util-linux/issues/690
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoAdd built in fallbacks for motd file
Ludwig Nussel [Fri, 7 Sep 2018 07:47:25 +0000 (09:47 +0200)] 
Add built in fallbacks for motd file

Use several locations for built in default for motd to allow for
e.g. run time generated motd without having to modify config files.
login.c already splits by colon.

/usr/share/misc/motd
  - chould be shipped by distributions
/run/motd
  - potentially run time created file with dynamic information
/etc/motd
  - for the admin fill with local information

Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
5 years agoscript: be sensitive to another SIGCHLD ssi_codes
Karel Zak [Wed, 5 Sep 2018 09:51:22 +0000 (11:51 +0200)] 
script: be sensitive to another SIGCHLD ssi_codes

The current signalfd handler cares on CLD_EXITED only. It's pretty
insufficient as there is more situations (and codes) when child no
more running.

Addresses: https://github.com/karelzak/util-linux/issues/686
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolscpu: use the first VM from /proc/sysinfo
Karel Zak [Tue, 4 Sep 2018 12:30:37 +0000 (14:30 +0200)] 
lscpu: use the first VM from /proc/sysinfo

Addresses: https://github.com/karelzak/util-linux/issues/685
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolscpu: make xasprintf call more robust
Karel Zak [Tue, 4 Sep 2018 11:12:34 +0000 (13:12 +0200)] 
lscpu: make xasprintf call more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: default to /lib64 for ${exec_prefix}/lib64
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.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: remove obsolete entry from TODO
Karel Zak [Mon, 3 Sep 2018 13:53:41 +0000 (15:53 +0200)] 
docs: remove obsolete entry from TODO

Already implemented by commit cf654e1c3ec8f6f9ac93bf4f6981d560249868d9.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomore: rename functions
Sami Kerola [Mon, 28 May 2018 08:49:26 +0000 (09:49 +0100)] 
more: rename functions

This clarifies what various function calls are doing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agomore: rename variable names
Sami Kerola [Sun, 27 May 2018 16:29:09 +0000 (17:29 +0100)] 
more: rename variable names

Try to make variable names to tell what they do.  Earlier names have been in
more(1) since the command was first wrote, and it looks like coding
practices has changed since late 70's.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agomore: remove unnecessary ifdef preprosessor directives
Sami Kerola [Sat, 26 May 2018 22:02:51 +0000 (23:02 +0100)] 
more: remove unnecessary ifdef preprosessor directives

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agomore: do not call fileno() for std{in,out,err} streams
Sami Kerola [Sat, 26 May 2018 20:36:17 +0000 (21:36 +0100)] 
more: do not call fileno() for std{in,out,err} streams

These file descriptor numbers are well known, use them from unistd.h

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agomore: remove 'register' keywords
Sami Kerola [Sat, 26 May 2018 20:24:31 +0000 (21:24 +0100)] 
more: remove 'register' keywords

One can only assume someone tried to make more(1) to run quicker.  More up
to date assumption is that compilers are fully capable optimizing binaries
without these sort of hints.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agomore: remove pointless functions
Sami Kerola [Sat, 26 May 2018 20:16:07 +0000 (21:16 +0100)] 
more: remove pointless functions

The curs_terminfo(3X) defines putp() as tputs(str, 1, putchar), so all of
these five functions can be replaced with putp().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agomore: return is statement not a function
Sami Kerola [Sat, 26 May 2018 19:55:32 +0000 (20:55 +0100)] 
more: return is statement not a function

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agomore: remove dead code and useless comments
Sami Kerola [Sat, 26 May 2018 19:08:34 +0000 (20:08 +0100)] 
more: remove dead code and useless comments

Removal of STOP requires explanation.  Looking unix-history-repo getline()
function in first BSD-3 version could return STOP.  By next tag BSD-4 the
return STOP had disappeared.  If I read this correctly that was a partial
removal, and second part has waited to be completed since 1980-11-16 when
BSD-4 was released.

Reference: https://github.com/dspinellis/unix-history-repo/blob/BSD-3-Snapshot-Development/usr/src/cmd/more.c#L501
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agotest: update UUID v5 tests
Karel Zak [Fri, 31 Aug 2018 10:48:46 +0000 (12:48 +0200)] 
test: update UUID v5 tests

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibuuid: fix name-based UUIDs
Karel Zak [Fri, 31 Aug 2018 10:27:32 +0000 (12:27 +0200)] 
libuuid: fix name-based UUIDs

The current version is not fully compatible with RFC4122. It
incorrectly encodes UUID variant

xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

where M is UUID version and N is UUID variant.

 $ python -c "import uuid ; print(uuid.uuid5(uuid.UUID(int=0), 'foo'))"
 aa752cea-8222-5bc8-acd9-555b090c0ccb
                    ^^

Old version:

 $ uuidgen --namespace 00000000-0000-0000-0000-000000000000 --name 'foo' --sha1
 aa752cea-8222-5bc8-8cd9-555b090c0ccb
                    ^^

Fixed version:
 ./uuidgen --namespace 00000000-0000-0000-0000-000000000000 --name 'foo' --sha1;
 aa752cea-8222-5bc8-acd9-555b090c0ccb
                    ^^

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>
5 years agolibuuid: add note about RFC4122 UUID layout
Karel Zak [Fri, 31 Aug 2018 08:08:46 +0000 (10:08 +0200)] 
libuuid: add note about RFC4122 UUID layout

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: update fdisk output
Karel Zak [Thu, 30 Aug 2018 13:24:41 +0000 (15:24 +0200)] 
tests: update fdisk output

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agofdisk: add "Disk model:" to the print output
Karel Zak [Thu, 30 Aug 2018 12:01:54 +0000 (14:01 +0200)] 
fdisk: add "Disk model:" to the print output

Addresses: https://github.com/karelzak/util-linux/issues/682
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibfdisk: add fdisk_get_devmodel() and fdisk_get_devno()
Karel Zak [Thu, 30 Aug 2018 12:01:46 +0000 (14:01 +0200)] 
libfdisk: add fdisk_get_devmodel() and fdisk_get_devno()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: add note about lsblk usage/free cols
Karel Zak [Fri, 24 Aug 2018 10:04:24 +0000 (12:04 +0200)] 
docs: add note about lsblk usage/free cols

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: cleanup TODO
Karel Zak [Fri, 24 Aug 2018 09:28:43 +0000 (11:28 +0200)] 
docs: cleanup TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobash-completion: update column
Karel Zak [Thu, 23 Aug 2018 12:14:29 +0000 (14:14 +0200)] 
bash-completion: update column

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: add column --table-empty-lines test
Karel Zak [Thu, 23 Aug 2018 11:41:05 +0000 (13:41 +0200)] 
tests: add column --table-empty-lines test

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agocolumn: add --table-empty-lines
Karel Zak [Thu, 23 Aug 2018 11:31:29 +0000 (13:31 +0200)] 
column: add --table-empty-lines

The option allows to add empty line to the table. The default behavior
is to ignore empty lines at all.

echo -e "A\nAA\nAAA\n\nAAAA" | ./column --table
A
AA
AAA
AAAA

$ echo -e "A\nAA\nAAA\n\nAAAA" | ./column --table --table-empty-lines
A
AA
AAA

AAAA

Addresses: https://github.com/karelzak/util-linux/issues/593
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibsmartcols: don't mark as extreme where average is zero
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".

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibsmartcols: allow to add line to table without columns
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.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosetpriv: add --reset-env
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>
5 years agosu: add note about merged /usr
Karel Zak [Wed, 22 Aug 2018 09:39:13 +0000 (11:39 +0200)] 
su: add note about merged /usr

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosetpriv: add user/group names to usage()
Karel Zak [Wed, 22 Aug 2018 08:35:51 +0000 (10:35 +0200)] 
setpriv: add user/group names to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosetpriv: allow to use group name for --groups
Karel Zak [Wed, 22 Aug 2018 08:29:09 +0000 (10:29 +0200)] 
setpriv: allow to use group name for --groups

Addresses: https://github.com/karelzak/util-linux/issues/325
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosulogin: restore signals after failed exec() only
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...

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosulogin: do not use plain 0 as NULL
Karel Zak [Thu, 16 Aug 2018 13:58:20 +0000 (15:58 +0200)] 
sulogin: do not use plain 0 as NULL

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibmount: cleanup licenses sections in the files
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

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: use SPDX license names
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...

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agofstrim: use -n shortcut for --dry-run
Karel Zak [Thu, 16 Aug 2018 12:00:45 +0000 (14:00 +0200)] 
fstrim: use -n shortcut for --dry-run

It seems 'n' is more common than 'd'. The patch also cleanup
getopt_long() options string.

Addresses: https://github.com/karelzak/util-linux/commit/fda0e2cf043994c77c29a2d109c03ce8957b1d38#commitcomment-30097920
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'spelling' of https://github.com/jwilk-forks/util-linux
Karel Zak [Thu, 16 Aug 2018 11:47:51 +0000 (13:47 +0200)] 
Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux

* 'spelling' of https://github.com/jwilk-forks/util-linux:
  Fix man page typos

5 years agoFix man page typos
Jakub Wilk [Thu, 16 Aug 2018 09:08:42 +0000 (11:08 +0200)] 
Fix man page typos

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
5 years agofincore.1: add missing space
Jakub Wilk [Thu, 16 Aug 2018 08:34:56 +0000 (10:34 +0200)] 
fincore.1: add missing space

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
5 years agosu: add --whitelist-environment
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>
5 years agobuild-sys: fix typo in man install
Karel Zak [Wed, 15 Aug 2018 09:47:17 +0000 (11:47 +0200)] 
build-sys: fix typo in man install

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibmount: report context paths on debug
Karel Zak [Tue, 14 Aug 2018 19:03:42 +0000 (21:03 +0200)] 
libmount: report context paths on debug

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: add adjtime_config(5) man page
Karel Zak [Tue, 14 Aug 2018 12:53:14 +0000 (14:53 +0200)] 
docs: add adjtime_config(5) man page

The file is pretty common, but undocumented by individual man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolscpu: fixed part ID for ARM Cortex-M7
Mark Sheppard [Mon, 13 Aug 2018 15:45:01 +0000 (16:45 +0100)] 
lscpu: fixed part ID for ARM Cortex-M7

5 years agolslogins: return 1 on "lslogins nonexisting"
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.

 # 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>
5 years agolslogins: add info about single-user output mode
Karel Zak [Mon, 13 Aug 2018 11:49:26 +0000 (13:49 +0200)] 
lslogins: add info about single-user output mode

The supported command line synopsis is also

lslogins foo

and it provides different output than

lslogins -l foo

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agologger: add -S to the man page
Karel Zak [Fri, 10 Aug 2018 14:55:14 +0000 (16:55 +0200)] 
logger: add -S to the man page

Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomount: add ext4 to some places to the man page
Karel Zak [Fri, 10 Aug 2018 14:27:41 +0000 (16:27 +0200)] 
mount: add ext4 to some places to the man page

5 years agolosetup: add reference to suffixes for --{sizelimit,offset}
Karel Zak [Wed, 8 Aug 2018 11:12:27 +0000 (13:12 +0200)] 
losetup: add reference to suffixes for --{sizelimit,offset}

Reported-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agofstrim: update .service to follow /etc/fstab
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>
5 years agosetarch: make <arch> optional
Karel Zak [Tue, 7 Aug 2018 09:31:14 +0000 (11:31 +0200)] 
setarch: make <arch> optional

Let's allow to change personality flags without execution domain
modification.

Old way:
  setarch `arch` --addr-no-randomize myprog

New way:
  setarch --addr-no-randomize myprog

Addresses: https://github.com/karelzak/util-linux/issues/668
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: add cal --span tests
Karel Zak [Tue, 7 Aug 2018 09:06:13 +0000 (11:06 +0200)] 
tests: add cal --span tests

Addresses: https://github.com/karelzak/util-linux/issues/677
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: check for test_cal
Karel Zak [Tue, 7 Aug 2018 08:59:06 +0000 (10:59 +0200)] 
tests: check for test_cal

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agocal: fix --span for large numbers of months
Karel Zak [Tue, 7 Aug 2018 08:52:33 +0000 (10:52 +0200)] 
cal: fix --span for large numbers of months

The need to calculate with whole years when go back for --span.

Addresses: https://github.com/karelzak/util-linux/issues/677
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agocal: use snprintf everywhere
Karel Zak [Tue, 7 Aug 2018 08:15:42 +0000 (10:15 +0200)] 
cal: use snprintf everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosetarch: split set_arch() function to small functions
Karel Zak [Mon, 6 Aug 2018 14:32:36 +0000 (16:32 +0200)] 
setarch: split set_arch() function to small functions

It seems better to keep the code more flexibile by small one-purpose
functions than by one huge monster.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty.8: Avoid a warning about an unbreakable line
Bjarni Ingi Gislason [Mon, 6 Aug 2018 00:51:13 +0000 (00:51 +0000)] 
agetty.8: Avoid a warning about an unbreakable line

  Make the indent depend on the formatting command, nroff or troff.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoman pages: Fix misuse of two-fonts-macros (BR, IR)
Bjarni Ingi Gislason [Sun, 5 Aug 2018 22:05:48 +0000 (22:05 +0000)] 
man pages: Fix misuse of two-fonts-macros (BR, IR)

  Change a two-fonts-macro to the single font one, when there is only
one genuine argument.

  Split a punctuation mark from the only argument to a two-fonts-marco.

  Remove an isolated two-fonts-macro.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoman pages: fix formatting of long lines in tables
Bjarni Ingi Gislason [Sun, 5 Aug 2018 18:51:25 +0000 (18:51 +0000)] 
man pages: fix formatting of long lines in tables

  Define the allowed length of the last (second) column to use the
whole line for text.

  Use text blocks for long lines.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoman pages: Remove "left" (or change to "l") in the column formats of tables
Bjarni Ingi Gislason [Fri, 3 Aug 2018 21:12:04 +0000 (21:12 +0000)] 
man pages: Remove "left" (or change to "l") in the column formats of tables

  A developmental version of "groff" issued a warning, for example with
"test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z":

troff: <logger.1>:299: warning: can't find font 't'

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agosu: add note about SIGKILL to the man page
Karel Zak [Fri, 3 Aug 2018 12:08:00 +0000 (14:08 +0200)] 
su: add note about SIGKILL to the man page

Addresses: https://github.com/karelzak/util-linux/issues/443
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'patch-1' of https://github.com/pmarillo/util-linux
Karel Zak [Fri, 3 Aug 2018 11:19:51 +0000 (13:19 +0200)] 
Merge branch 'patch-1' of https://github.com/pmarillo/util-linux

* 'patch-1' of https://github.com/pmarillo/util-linux:
  Fix translation typo

5 years agohwclock: rely on kernel for RTC_UIE_ON on Aplha and Sparc
Karel Zak [Fri, 3 Aug 2018 11:08:21 +0000 (13:08 +0200)] 
hwclock: rely on kernel for RTC_UIE_ON on Aplha and Sparc

It's kernel business to return EINVAL for unsupported RTC_UIE_ON. We
(userspace) should not make decisions about things that we do not
control.

If kernel is wrong then fix the kernel, don't hide the problem by
crazy ifdefs in userspace.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomesg: do not print 'ttyname failed' message unless --verbose requested
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>
5 years agoFix translation typo
Paul M [Fri, 3 Aug 2018 07:58:54 +0000 (09:58 +0200)] 
Fix translation typo

5 years agotests: update lscpu tests
Karel Zak [Wed, 1 Aug 2018 10:09:09 +0000 (12:09 +0200)] 
tests: update lscpu tests

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agofdisk: fix error message on 'd' command
Karel Zak [Wed, 1 Aug 2018 07:29:12 +0000 (09:29 +0200)] 
fdisk: fix error message on 'd' command

Command (m for help): d
No partition is defined yet!
Could not delete partition 93840461057817    <--- !

Don't print 'Could not delete..' if no partition is defined yet.

Addresses: https://github.com/karelzak/util-linux/issues/667
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoumount: add --quiet option
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>
5 years agolscpu: add 'Address sizes'
Karel Zak [Wed, 1 Aug 2018 06:33:32 +0000 (08:33 +0200)] 
lscpu: add 'Address sizes'

Addresses: https://github.com/karelzak/util-linux/issues/674
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agofstrim: add -A|--fstab to trim according to /etc/fstab
Karel Zak [Tue, 31 Jul 2018 14:38:59 +0000 (16:38 +0200)] 
fstrim: add -A|--fstab to trim according to /etc/fstab

Addresses: https://github.com/karelzak/util-linux/issues/673
Signed-off-by: Karel Zak <kzak@redhat.com>