]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agoMerge branch 'mount_fuzz' of https://github.com/evverx/util-linux
Karel Zak [Mon, 1 Nov 2021 13:18:21 +0000 (14:18 +0100)] 
Merge branch 'mount_fuzz' of https://github.com/evverx/util-linux

* 'mount_fuzz' of https://github.com/evverx/util-linux:
  mount_fuzz: reject giant files early

2 years agoMerge branch 'topic/hardlink'
Karel Zak [Mon, 1 Nov 2021 11:50:33 +0000 (12:50 +0100)] 
Merge branch 'topic/hardlink'

2 years agotests: update hardlink --maximum-size
Karel Zak [Mon, 1 Nov 2021 11:49:16 +0000 (12:49 +0100)] 
tests: update hardlink --maximum-size

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: add new option: -S/--maximum-size
Daniele Pizzolli [Mon, 11 Oct 2021 07:30:45 +0000 (09:30 +0200)] 
hardlink: add new option: -S/--maximum-size

Support limiting comparison by maximum file size.

[kzak@redhat.com: - resolve conflicts]

Signed-off-by: Daniele Pizzolli <dan+dev@toel.it>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: add --cache-size
Karel Zak [Mon, 1 Nov 2021 11:00:21 +0000 (12:00 +0100)] 
hardlink: add --cache-size

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/fileeq: fix for small memsiz
Karel Zak [Mon, 1 Nov 2021 10:14:24 +0000 (11:14 +0100)] 
lib/fileeq: fix for small memsiz

2 years agohardlink: rename --buffer-size to --io-size
Karel Zak [Mon, 1 Nov 2021 09:46:32 +0000 (10:46 +0100)] 
hardlink: rename --buffer-size to --io-size

Addresses: https://github.com/karelzak/util-linux/pull/1467
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomount_fuzz: reject giant files early
Evgeny Vereshchagin [Sat, 30 Oct 2021 18:09:30 +0000 (18:09 +0000)] 
mount_fuzz: reject giant files early

It should help to address https://github.com/google/oss-fuzz/issues/6703

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2 years agohardlink: rewrite files content comparison
Karel Zak [Fri, 29 Oct 2021 11:42:58 +0000 (13:42 +0200)] 
hardlink: rewrite files content comparison

Example:

 # hardlink --ignore-time --dry-run /var/lib

Old version, based on memcmp(), nothing cached:

 Mode:           dry-run
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       204.557185 seconds

New version, --method=memcmp, 32 bytes cached:

 Mode:           dry-run
 Method:         memcmp
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       5.248426 seconds

New version, zero-copy (Linux crypto API), sha1, crc32 and sha256:

 Mode:           dry-run
 Method:         sha1
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       2.870973 seconds

 Mode:           dry-run
 Method:         crc32
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       2.582651 seconds

 Mode:           dry-run
 Method:         sha256
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       3.152825 seconds

The default is sha256 to be robust..

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude/fileeq: add functions to compare files content
Karel Zak [Fri, 29 Oct 2021 11:37:36 +0000 (13:37 +0200)] 
include/fileeq: add functions to compare files content

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agochsh: fflush stdout before reading from stdin
Lorenzo Beretta [Mon, 25 Oct 2021 13:28:02 +0000 (15:28 +0200)] 
chsh: fflush stdout before reading from stdin

Same problem as described in https://github.com/karelzak/util-linux/pull/1481

Signed-off-by: Lorenzo Beretta <vc.net.loreb@gmail.com>
2 years agochfn: flush stdout before reading stdin and fix uninitialized variable
Lorenzo Beretta [Mon, 25 Oct 2021 12:06:00 +0000 (14:06 +0200)] 
chfn: flush stdout before reading stdin and fix uninitialized variable

Same problem as described in https://github.com/karelzak/util-linux/pull/1481

Signed-off-by: Lorenzo Beretta <vc.net.loreb@gmail.com>
2 years agoMerge branch 'refactor-tests' of https://github.com/Ajchler/util-linux
Karel Zak [Mon, 25 Oct 2021 10:21:15 +0000 (12:21 +0200)] 
Merge branch 'refactor-tests' of https://github.com/Ajchler/util-linux

* 'refactor-tests' of https://github.com/Ajchler/util-linux:
  tests: split additional tests into subtests
  tests: split several tests into subtests
  tests: split test into subtest
  tests: split cal/colorw test into subtests
  tests: split cal/color test into subtests

2 years agobuild-sys: disable libmount when missing mntent.h
Karel Zak [Mon, 25 Oct 2021 09:53:55 +0000 (11:53 +0200)] 
build-sys: disable libmount when missing mntent.h

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobuild-sys: include xlocale.h for locale_t on MacOS
Karel Zak [Mon, 25 Oct 2021 09:45:46 +0000 (11:45 +0200)] 
build-sys: include xlocale.h for locale_t on MacOS

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobuild-sys: (hardlink) check for llistxattr and lgetxattr
Karel Zak [Mon, 25 Oct 2021 09:39:09 +0000 (11:39 +0200)] 
build-sys: (hardlink) check for llistxattr and lgetxattr

It seems check for sys/xattr.h is not enough. The header file exists
on MacOS, but without these functions.

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibbuid: use _UL_LIBUUID_UUID_H to cover uuid.h
Karel Zak [Mon, 25 Oct 2021 09:26:15 +0000 (11:26 +0200)] 
libbuid: use _UL_LIBUUID_UUID_H to cover uuid.h

It seems _UUID_UUID_H is too generic.

Addresses: https://github.com/karelzak/util-linux/issues/1432
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: add hint for non-public reports
Karel Zak [Mon, 25 Oct 2021 09:15:01 +0000 (11:15 +0200)] 
docs: add hint for non-public reports

Fixes: https://github.com/karelzak/util-linux/issues/1482
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'flush' of https://github.com/ericonr/util-linux
Karel Zak [Mon, 25 Oct 2021 08:42:22 +0000 (10:42 +0200)] 
Merge branch 'flush' of https://github.com/ericonr/util-linux

* 'flush' of https://github.com/ericonr/util-linux:
  vipw: flush stdout before getting answer.

2 years agoagetty: use getttynam() if available
Ludwig Nussel [Thu, 21 Oct 2021 13:00:59 +0000 (15:00 +0200)] 
agetty: use getttynam() if available

/etc/ttys seems to be a rather archaic concept that is not meant to
exist on Linux. Nevertheless it does. glibc has getttynam() which
correctly parses /etc/ttys. So let's give it a try before falling back
to the built in defaults. One can set the terminal type for a
specific tty using e.g.:

echo 'ttyS0 "" xterm' > /etc/ttys

[kzak@redhat.com: - improve configure.ac part
                  - log error on failed strdup()]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux
Karel Zak [Mon, 25 Oct 2021 08:23:16 +0000 (10:23 +0200)] 
Merge branch 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux

* 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux:
  docs: Uniformize references to section titles

2 years agovipw: flush stdout before getting answer.
Érico Nogueira [Fri, 22 Oct 2021 17:28:50 +0000 (14:28 -0300)] 
vipw: flush stdout before getting answer.

Otherwise the question is displayed only after the user presses Return,
and the program looks like it's hanging.

This happens at least on musl libc.

Reported by @loreb.

Signed-off-by: Érico Nogueira <erico.erc@gmail.com>
2 years agologger: fix --size use for stdin
Karel Zak [Thu, 21 Oct 2021 16:47:40 +0000 (18:47 +0200)] 
logger: fix --size use for stdin

The stdin version counts log header into the message size, but
for example when it reads message from argv[] it counts only message
itself.

 $ logger --stderr  --size 3 "abcd"
 <13>Oct 21 18:48:29 kzak: abc

 $ echo "abcd" | logger --stderr  --size 3
 logger: cannot allocate 18446744073709551597 bytes: Cannot allocate memory

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoRevert "logger: verify --size of large enough for message header"
Karel Zak [Thu, 21 Oct 2021 16:44:32 +0000 (18:44 +0200)] 
Revert "logger: verify --size of large enough for message header"

This reverts commit 2fdea5a26480d46ec9445b0ea17fc984f84eecc9.

2 years agobuild-sys: use set +e before patch --try in ./autogen.sh
Karel Zak [Thu, 21 Oct 2021 16:27:46 +0000 (18:27 +0200)] 
build-sys: use set +e before patch --try in ./autogen.sh

Addresses: https://github.com/karelzak/util-linux/issues/1476
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agologger: realloc buffer when header size changed
Karel Zak [Thu, 21 Oct 2021 14:00:01 +0000 (16:00 +0200)] 
logger: realloc buffer when header size changed

This is probably paranoid optimization, but when we generate a new
header we need to be sure that buffer is not smaller than calculated
maximal size of user's data.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agologger: verify --size of large enough for message header
Karel Zak [Thu, 21 Oct 2021 13:40:41 +0000 (15:40 +0200)] 
logger: verify --size of large enough for message header

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowdctl: update man page
Karel Zak [Thu, 21 Oct 2021 13:04:33 +0000 (15:04 +0200)] 
wdctl: update man page

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowdctl: add --setpregovernor
Karel Zak [Thu, 21 Oct 2021 11:09:58 +0000 (13:09 +0200)] 
wdctl: add --setpregovernor

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowdctl: set_watchdog() refactoring
Karel Zak [Thu, 21 Oct 2021 10:38:16 +0000 (12:38 +0200)] 
wdctl: set_watchdog() refactoring

* keep wanted values in struct wd_control
* make set_watchdog() more readable

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowdctl: print the current and available governors
Karel Zak [Thu, 21 Oct 2021 10:16:35 +0000 (12:16 +0200)] 
wdctl: print the current and available governors

 # wdctl
 ...
 Pre-timeout:    0 seconds
 Pre-timeout governor: noop
 Available pre-timeout governors: userspace noop panic
 ...

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: add links to adjtime_config manpage
Karel Zak [Thu, 21 Oct 2021 09:36:44 +0000 (11:36 +0200)] 
docs: add links to adjtime_config manpage

Fixes: https://github.com/karelzak/util-linux/issues/1478
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: split additional tests into subtests
Vojtěch Eichler [Tue, 19 Oct 2021 18:45:28 +0000 (20:45 +0200)] 
tests: split additional tests into subtests

2 years agobuild-sys: remove bashism
Karel Zak [Tue, 19 Oct 2021 16:54:31 +0000 (18:54 +0200)] 
build-sys: remove bashism

Addresses: https://github.com/karelzak/util-linux/issues/1476
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: Fix test/misc/swaplabel failure due to change in mkswap behaviour.
Mark Hindley [Mon, 18 Oct 2021 17:53:01 +0000 (17:53 +0000)] 
tests: Fix test/misc/swaplabel failure due to change in mkswap behaviour.

mkswap now warns if the image file has holes. If fallocate is used to create the
file, use POSIX semantics to ensure the file has no holes.

This fixes the test failure

misc: swaplabel                      ... FAILED (misc/swaplabel)
========= script: /build/util-linux-2.37.2/tests/ts/misc/swaplabel =================
================= OUTPUT =====================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= EXPECTED ===================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= O/E diff ===================
==============================================

The additional error appears in swaplabel.err:

 mkswap: <swapfile> contains holes or other unsupported extents.
         This swap file can be rejected by kernel on swap activation!
         Use --verbose for more details.

[zeha@debian.org: this appears to be important/required when building
inside cowbuilder, on an ext3 filesystem.]

Signed-off-by: Mark Hindley <mark@hindley.org.uk>
2 years agobuild-sys: make libtool patching more robust
Karel Zak [Tue, 19 Oct 2021 08:52:10 +0000 (10:52 +0200)] 
build-sys: make libtool patching more robust

Fixes: https://github.com/karelzak/util-linux/issues/1476
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowdctl: sysfs open refactoring
Karel Zak [Tue, 19 Oct 2021 08:11:37 +0000 (10:11 +0200)] 
wdctl: sysfs open refactoring

Let's make the sysfs handler usable in more functions.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowdctl: add --setpretimeout
Karel Zak [Tue, 19 Oct 2021 07:47:44 +0000 (09:47 +0200)] 
wdctl: add --setpretimeout

Addresses: https://github.com/karelzak/util-linux/issues/1475
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoblockdev: remove accidental non-breaking spaces
Chris Hofstaedtler [Mon, 18 Oct 2021 07:40:01 +0000 (07:40 +0000)] 
blockdev: remove accidental non-breaking spaces

commit 9147d2ad8abb73cea5799323fc73ccdaf675826f introduced these
C2A0 spaces, but without saying anything. Likely this was an
accident.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996751
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2 years agomcookie: fix infinite-loop when use -f
Hiroaki Sengoku [Fri, 15 Oct 2021 05:02:46 +0000 (14:02 +0900)] 
mcookie: fix infinite-loop when use -f

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: split several tests into subtests
Vojtěch Eichler [Thu, 14 Oct 2021 10:33:45 +0000 (12:33 +0200)] 
tests: split several tests into subtests

2 years agobuild-sys: patch libtool.m4 for darwin
Karel Zak [Thu, 14 Oct 2021 10:17:31 +0000 (12:17 +0200)] 
build-sys: patch libtool.m4 for darwin

Fixes: https://github.com/karelzak/util-linux/issues/1468
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: (logger) check for socat
Karel Zak [Thu, 14 Oct 2021 08:46:45 +0000 (10:46 +0200)] 
tests: (logger) check for socat

Addresses: https://github.com/karelzak/util-linux/issues/1466
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agosu: reset RLIMIT_AS too
Karel Zak [Thu, 14 Oct 2021 08:28:59 +0000 (10:28 +0200)] 
su: reset RLIMIT_AS too

Fixes: https://github.com/karelzak/util-linux/issues/1465
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: add note about GitHub PR
Karel Zak [Thu, 14 Oct 2021 08:22:14 +0000 (10:22 +0200)] 
docs: add note about GitHub PR

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofindmnt: (adoc) Added section stating exit code semantics
Mister Me [Thu, 7 Oct 2021 14:34:00 +0000 (08:34 -0600)] 
findmnt: (adoc) Added section stating exit code semantics

per issue #1464:

    https://github.com/karelzak/util-linux/issues/1464

[kzak@redhat.com: - move the text from DESCRIPTION to EXIT STATUS section]

Signed-off-by: Glenn Golden <gdg@zplane.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: improve verbose messages
Karel Zak [Thu, 7 Oct 2021 11:11:18 +0000 (13:11 +0200)] 
hardlink: improve verbose messages

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomore: fix -e in non-interactive mode
Karel Zak [Tue, 5 Oct 2021 08:53:13 +0000 (10:53 +0200)] 
more: fix -e in non-interactive mode

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: split test into subtest
Vojtěch Eichler [Mon, 4 Oct 2021 14:46:22 +0000 (16:46 +0200)] 
tests: split test into subtest

2 years agosu: reset also RLIMIT_FSIZE and RLIMIT_NOFILE
Karel Zak [Mon, 4 Oct 2021 13:39:40 +0000 (15:39 +0200)] 
su: reset also RLIMIT_FSIZE and RLIMIT_NOFILE

Addresses: https://github.com/linux-pam/linux-pam/issues/85
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomount.8.adoc: note that mandatory locking is fully deprecated in Linux 5.15
Jeff Layton [Fri, 1 Oct 2021 12:25:53 +0000 (08:25 -0400)] 
mount.8.adoc: note that mandatory locking is fully deprecated in Linux 5.15

Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
2 years agofstrim: fix typo
Karel Zak [Mon, 4 Oct 2021 09:14:01 +0000 (11:14 +0200)] 
fstrim: fix typo

Addresses: https://github.com/karelzak/util-linux/issues/1463
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofstrim: don't trigger autofs
Karel Zak [Mon, 4 Oct 2021 09:14:01 +0000 (11:14 +0200)] 
fstrim: don't trigger autofs

- ignore read-only entries
- ignore autofs entries (for example from /proc/self/mountinfo)
- ignore autofs mountpoints where automounter has not been triggered yet

Fixes: https://github.com/karelzak/util-linux/issues/1463
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: split cal/colorw test into subtests
Vojtěch Eichler [Fri, 1 Oct 2021 14:54:11 +0000 (16:54 +0200)] 
tests: split cal/colorw test into subtests

2 years agotests: split cal/color test into subtests
Vojtěch Eichler [Fri, 1 Oct 2021 13:56:35 +0000 (15:56 +0200)] 
tests: split cal/color test into subtests

2 years agosu: reset RLIMIT_{NICE,RTPRIO} to zero
Karel Zak [Fri, 1 Oct 2021 12:59:50 +0000 (14:59 +0200)] 
su: reset RLIMIT_{NICE,RTPRIO} to zero

Addresses: https://github.com/linux-pam/linux-pam/issues/85
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoprlimit: improve --help output
Karel Zak [Fri, 1 Oct 2021 12:47:04 +0000 (14:47 +0200)] 
prlimit: improve --help output

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomore: POSIX compliance patch preventing exit on EOF without -e
Ian Jones [Wed, 29 Sep 2021 12:50:14 +0000 (14:50 +0200)] 
more: POSIX compliance patch preventing exit on EOF without -e

[kzak@redhat.com: - merge all patches to one commit,
                  - improve prompt for non-tty stdin]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofallocate: add verbose messages
Karel Zak [Mon, 27 Sep 2021 13:40:11 +0000 (15:40 +0200)] 
fallocate: add verbose messages

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2003927
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: use more passive wording in hardlink.1
Eduard Bloch [Mon, 27 Sep 2021 07:08:12 +0000 (09:08 +0200)] 
hardlink: use more passive wording in hardlink.1

And fix "same (basename)".

Signed-off-by: Eduard Bloch <blade@debian.org>
2 years agoLet user choose larger buffers for IO reading
Eduard Bloch [Mon, 27 Sep 2021 07:07:23 +0000 (09:07 +0200)] 
Let user choose larger buffers for IO reading

Simultaneous reading of multiple files through a small one-page buffer
is slow with classic HDDs. Let the user improve it by chosing buffers of
several mebibytes if needed.

[kzak@redhat.com: - tiny changes to coding style
                  - mark buffers static
                  - use xalloc.h]

Signed-off-by: Eduard Bloch <blade@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agosetterm: (man) improve dosc about optional arguments
Karel Zak [Mon, 27 Sep 2021 10:49:01 +0000 (12:49 +0200)] 
setterm: (man) improve dosc about optional arguments

Fixes: https://github.com/karelzak/util-linux/issues/1457
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomeson: fix typo
Karel Zak [Fri, 24 Sep 2021 13:52:07 +0000 (15:52 +0200)] 
meson: fix typo

Addresses: https://github.com/karelzak/util-linux/issues/1442
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomeson: make raw(7) optional
Karel Zak [Thu, 23 Sep 2021 12:09:35 +0000 (14:09 +0200)] 
meson: make raw(7) optional

Fixes: https://github.com/karelzak/util-linux/issues/1442
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotest_mount_optstr: use xstrdup()
Karel Zak [Thu, 23 Sep 2021 11:11:16 +0000 (13:11 +0200)] 
test_mount_optstr: use xstrdup()

Fixes: https://github.com/karelzak/util-linux/issues/1434
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/env: don't ignore failed malloc
Karel Zak [Thu, 23 Sep 2021 11:08:32 +0000 (13:08 +0200)] 
lib/env: don't ignore failed malloc

Fixes: https://github.com/karelzak/util-linux/issues/1434
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomkswap: support -U {clear,random,time,uuid}
Karel Zak [Thu, 23 Sep 2021 09:53:26 +0000 (11:53 +0200)] 
mkswap: support -U {clear,random,time,uuid}

Let's follow -U from mkfs.ext4 and make it easy to fully control
UUIDs for the swap area.

Fixes: https://github.com/karelzak/util-linux/issues/1453
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'int/alex/hifive_uuid' of https://github.com/AlexGhiti/util-linux
Karel Zak [Thu, 23 Sep 2021 09:15:31 +0000 (11:15 +0200)] 
Merge branch 'int/alex/hifive_uuid' of https://github.com/AlexGhiti/util-linux

* 'int/alex/hifive_uuid' of https://github.com/AlexGhiti/util-linux:
  include: Rename HiFive partition UUIDs

2 years agoMerge branch 'master' of https://github.com/mariobl/util-linux
Karel Zak [Thu, 23 Sep 2021 09:12:10 +0000 (11:12 +0200)] 
Merge branch 'master' of https://github.com/mariobl/util-linux

* 'master' of https://github.com/mariobl/util-linux:
  Man pages: Fix end extend formatting

2 years agomount: add hint about dmesg(8) to error messages
Karel Zak [Thu, 23 Sep 2021 09:07:55 +0000 (11:07 +0200)] 
mount: add hint about dmesg(8) to error messages

Fixes: https://github.com/karelzak/util-linux/pull/1444
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude: Rename HiFive partition UUIDs
Alexandre Ghiti [Wed, 22 Sep 2021 04:38:14 +0000 (06:38 +0200)] 
include: Rename HiFive partition UUIDs

Both HiFive Unleashed and HiFive Unmatched bootloaders seek for the same
UUIDs to load the next stage bootloader: the current name makes partitions
on Unmatched board appear as 'Unleashed'.

Fix that by removing the 'Unleashed' part of the current naming so it
fits both.

Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2 years agoMan pages: Fix end extend formatting
Mario Blättermann [Tue, 21 Sep 2021 18:48:11 +0000 (20:48 +0200)] 
Man pages: Fix end extend formatting

2 years agomount.8.adoc: fix misformatting
Mario Blättermann [Tue, 21 Sep 2021 08:48:37 +0000 (10:48 +0200)] 
mount.8.adoc: fix misformatting

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agounshare.1.adoc: Improve wording re creation of bind mounts
Michael Kerrisk [Thu, 9 Sep 2021 00:08:28 +0000 (02:08 +0200)] 
unshare.1.adoc: Improve wording re creation of bind mounts

Use consistent wording for the options that create
bind mounts, and improve the wording.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2 years agounshare.1.adoc: Improve wording re namespace creation
Michael Kerrisk [Thu, 9 Sep 2021 00:08:27 +0000 (02:08 +0200)] 
unshare.1.adoc: Improve wording re namespace creation

The terminonoly "unshare the namespace" is not very helpful.
Instead, use wording that explains what these options actually
fo: "create a new namespace".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2 years agogithub: add meson build target
Karel Zak [Thu, 16 Sep 2021 11:25:07 +0000 (13:25 +0200)] 
github: add meson build target

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'meson-fixes' of https://github.com/Hello71/util-linux
Karel Zak [Thu, 16 Sep 2021 11:07:05 +0000 (13:07 +0200)] 
Merge branch 'meson-fixes' of https://github.com/Hello71/util-linux

* 'meson-fixes' of https://github.com/Hello71/util-linux:
  meson: make asciidoc optional
  meson: fix building libsmartcols
  meson: fix building logger

2 years agodmesg: translate ctime strings
Karel Zak [Thu, 16 Sep 2021 10:50:01 +0000 (12:50 +0200)] 
dmesg: translate ctime strings

Let's make the date-time strings accessible for translators.

Fixes: https://github.com/karelzak/util-linux/issues/1451
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agologger: fix --prio-prefix doesn't use --priority default
Karel Zak [Thu, 16 Sep 2021 10:20:25 +0000 (12:20 +0200)] 
logger: fix --prio-prefix doesn't use --priority default

The commit b9ef27f have added priority check, but it introduced
regression as the default priority (as specified by --priority) is
ignored.

This patch fixes this problem, but it also removes extra check for
"kern facility", it's unnecessary and inconsistent with the rest of
logger.

Fixes: https://github.com/karelzak/util-linux/issues/1450
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agologger: dealloc login name
Karel Zak [Thu, 16 Sep 2021 10:15:56 +0000 (12:15 +0200)] 
logger: dealloc login name

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'losetup-direct-dio' of https://github.com/Hello71/util-linux
Karel Zak [Thu, 16 Sep 2021 09:32:57 +0000 (11:32 +0200)] 
Merge branch 'losetup-direct-dio' of https://github.com/Hello71/util-linux

* 'losetup-direct-dio' of https://github.com/Hello71/util-linux:
  losetup: directly set dio instead of afterwards

2 years agoMerge branch 'more-shell-execution' of https://github.com/ritikrajdev/util-linux
Karel Zak [Thu, 16 Sep 2021 09:00:33 +0000 (11:00 +0200)] 
Merge branch 'more-shell-execution' of https://github.com/ritikrajdev/util-linux

* 'more-shell-execution' of https://github.com/ritikrajdev/util-linux:
  more - Bug Resolve - new line separated command execution

2 years agoMerge branch 'refactor-tests' of https://github.com/Ajchler/util-linux
Karel Zak [Thu, 16 Sep 2021 08:51:27 +0000 (10:51 +0200)] 
Merge branch 'refactor-tests' of https://github.com/Ajchler/util-linux

* 'refactor-tests' of https://github.com/Ajchler/util-linux:
  tests: use subtests
  tests: make use of subtests

2 years agomore - Bug Resolve - new line separated command execution
ritikrajdev [Mon, 13 Sep 2021 22:57:14 +0000 (04:27 +0530)] 
more - Bug Resolve - new line separated command execution

2 years agotests: use subtests
Vojtěch Eichler [Mon, 13 Sep 2021 08:59:59 +0000 (10:59 +0200)] 
tests: use subtests

2 years agolosetup: directly set dio instead of afterwards
Alex Xu (Hello71) [Thu, 9 Sep 2021 13:55:03 +0000 (09:55 -0400)] 
losetup: directly set dio instead of afterwards

This avoids an extra syscall, and allows the kernel to automatically set
block size [0], avoiding unnecessary failure with 4096-byte devices.

This changes the observable behavior of losetup --direct-io in the case
where DIO is not supported to fully fail, instead of creating a
non-direct-io device. If the user explicitly specifies --direct-io, then
they should get either a DIO loopdev or no loopdev, not a non-DIO
loopdev and a misleading error.

Additionally, loopcxt_setup_device now uses O_CLOEXEC in the read-only
fallback.

[0] https://github.com/torvalds/linux/commit/85560117d00f5d528e928918b8f61cadcefff98b

2 years agotests: make use of subtests
Vojtěch Eichler [Wed, 8 Sep 2021 10:36:19 +0000 (12:36 +0200)] 
tests: make use of subtests

2 years agomeson: make asciidoc optional
Alex Xu (Hello71) [Tue, 7 Sep 2021 22:58:48 +0000 (18:58 -0400)] 
meson: make asciidoc optional

it should be under an option like autoconf, but cba to do that now, and
this is an improvement over the status quo.

2 years agomeson: fix building libsmartcols
Alex Xu (Hello71) [Tue, 7 Sep 2021 22:58:32 +0000 (18:58 -0400)] 
meson: fix building libsmartcols

2 years agomeson: fix building logger
Alex Xu (Hello71) [Tue, 7 Sep 2021 22:58:16 +0000 (18:58 -0400)] 
meson: fix building logger

2 years agoMerge branch 'master' of https://github.com/yugart/util-linux
Karel Zak [Tue, 7 Sep 2021 10:30:15 +0000 (12:30 +0200)] 
Merge branch 'master' of https://github.com/yugart/util-linux

* 'master' of https://github.com/yugart/util-linux:
  Fix memory leaks in the chcpu

2 years agoeject: fix typo in docs
Karel Zak [Tue, 7 Sep 2021 10:27:54 +0000 (12:27 +0200)] 
eject: fix typo in docs

Fixes: https://github.com/karelzak/util-linux/issues/1436
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoFix memory leaks in the chcpu
jiazhenyuan [Mon, 6 Sep 2021 08:50:27 +0000 (16:50 +0800)] 
Fix memory leaks in the chcpu

2 years agoFix misspellings
Rafael Fontenelle [Sat, 4 Sep 2021 14:11:04 +0000 (11:11 -0300)] 
Fix misspellings

2 years agodocs: Uniformize references to section titles
Rafael Fontenelle [Thu, 2 Sep 2021 13:20:35 +0000 (10:20 -0300)] 
docs: Uniformize references to section titles

Wrap section title references with asterisks, and prioritize
'see the *TITLE* section' over 'see section TITLE'.

2 years agotests: Skip lsns/ioctl_ns test if unshare fails
Chris Hofstaedtler [Fri, 20 Aug 2021 10:30:50 +0000 (10:30 +0000)] 
tests: Skip lsns/ioctl_ns test if unshare fails

Some parts of the Debian build infrastructure uses unshare to run the
package build, and that appears to cause a "nested" unshare in the
lsns/ioctl_ns test to fail. Unfortunately the tests then hang at this
point.

Try running unshare before the actual test, and skip the test if unshare
already fails.

[kzak@redhat.com: - add --fork to the test
                  - don't write to stdout/err]

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agosu: (bash-completion) offer usernames rather than files
Karel Zak [Tue, 31 Aug 2021 10:51:40 +0000 (12:51 +0200)] 
su: (bash-completion) offer usernames rather than files

Fixes: https://github.com/karelzak/util-linux/issues/1424
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocolumn: segmentation fault on invalid unicode input passed to -s option
Karel Zak [Tue, 31 Aug 2021 10:31:15 +0000 (12:31 +0200)] 
column: segmentation fault on invalid unicode input passed to -s option

The function mbs_to_wcs() returns NULL on invalid UTF.

Fixes: https://github.com/karelzak/util-linux/issues/1425
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'bug/1416' of https://github.com/V-Smeets/util-linux
Karel Zak [Tue, 31 Aug 2021 10:26:00 +0000 (12:26 +0200)] 
Merge branch 'bug/1416' of https://github.com/V-Smeets/util-linux

* 'bug/1416' of https://github.com/V-Smeets/util-linux:
  Erase line before writing the filename

2 years agoMerge branch 'patch-2' of https://github.com/rffontenelle/util-linux
Karel Zak [Tue, 31 Aug 2021 10:08:38 +0000 (12:08 +0200)] 
Merge branch 'patch-2' of https://github.com/rffontenelle/util-linux

* 'patch-2' of https://github.com/rffontenelle/util-linux:
  asciidoc: unconstrained formatting pair in fdisk