Samanta Navarro [Wed, 11 Jan 2023 11:57:21 +0000 (11:57 +0000)]
login: never send signals to init
If the signal handler is triggered after a failed fork attempt, then
child_pid will be -1. This in turn leads to a positive test and a
subsequent call of kill(1, signal). If signal was SIGTERM, then there
will be also another kill(1, SIGHUP) call.
Test explicitly for a positive child_pid value to prevent these cases.
Chris Webb [Tue, 10 Jan 2023 13:58:58 +0000 (13:58 +0000)]
unshare: support --map-users=inner:outer:count as well as outer,inner,count
The argument ordering in /proc/self/[gu]id_map and mount -o X-mount.idmap
is consistently inner:outer:count but unshare --map-users and --map-groups
were originally defined to expect outer,inner,count instead.
To reduce confusion caused by this mismatch, support a colon-separated
inner:outer:count ordering as well as the original comma-separated
outer,inner,count argument format. Although we accept both formats, only
document the new one in the usage text and deprecate the old format in
the man page.
Fixes: https://github.com/util-linux/util-linux/issues/1988 Signed-off-by: Chris Webb <chris@arachsys.com>
Karel Zak [Tue, 10 Jan 2023 11:40:47 +0000 (12:40 +0100)]
libmount: use MNT_ERR_APPLYFLAGS for failed mount_setattr()
The classic mount(2) based version uses MNT_ERR_APPLYFLAGS when not
able to set flags and errno is EINVAL. This is expected by
mnt_context_get_mount_excode() where libmount generates error messages
for mount(8).
Expected is:
# mount --make-private /mnt/test
mount: /mnt/test: not mount point or bad option.
rather than generic error:
mount: /mnt/test: wrong fs type, bad option, bad superblock on none ...
Karel Zak [Tue, 10 Jan 2023 10:30:55 +0000 (11:30 +0100)]
Merge branch 'waitpid' of https://github.com/t-8ch/util-linux
* 'waitpid' of https://github.com/t-8ch/util-linux:
waitpid: adapt bash-completion for current functionality
po-man: add waitpid.1 manpage
waitpid: add support for already exited PIDs
Karel Zak [Mon, 9 Jan 2023 11:47:31 +0000 (12:47 +0100)]
Merge branch 'po-man/fixes' of https://github.com/t-8ch/util-linux
* 'po-man/fixes' of https://github.com/t-8ch/util-linux:
sr.po: fix mkfs.cramfs translation
build: propagate failures from asciidoctor
po-man: remove unicode dash from manpage NAME section
sr.po: add missing dash to manpage header
po-man: always convert common manpage fragments
po-man: enable out of tree builds
autotools: add asciidoctor-includetracker to distributed files
Karel Zak [Mon, 9 Jan 2023 11:35:03 +0000 (12:35 +0100)]
Merge branch 'schedutils' of https://github.com/chaiken/util-linux
* 'schedutils' of https://github.com/chaiken/util-linux:
schedutils: better illustrate the usage of cpu-lists with taskset
schedutils: clarify meaning of taskset return code
schedutils: clarify confusing mask example in taskset man page
This is required by string_to_bitmask().
The previous cast failed on s390x with the following warning:
In function 'string_to_bitmask',
inlined from 'string_to_bitmask' at lib/strutils.c:802:5,
inlined from 'main' at sys-utils/wdctl.c:770:8:
lib/strutils.c:829:23: error: write of 64-bit data outside the bound of destination object, data truncated into 32-bit [-Werror=extra]
829 | *mask |= flag;
|
libmount: ensure child hangs around until we persisted namespace
When we create a new namespace in a child process to persist it we need
to ensure that the child hangs around. During exit the child will drop
all references to its namespaces and so by the time we call open we
might already fail to open the namespace. Fix this.
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
po-man: remove unicode dash from manpage NAME section
Translators seem to like using unicode dashes.
When used in the NAME section of a manpage, asciidoctor will break.
Instead of trying to force all translators to keep this in mind, add an
extension to asciidoctor that takes care of this.
In file included from /usr/include/stdio.h:894,
from lib/strutils.c:8:
In function ‘printf’,
inlined from ‘test_strutils_cstrcasecmp’ at lib/strutils.c:1324:2,
inlined from ‘main’ at lib/strutils.c:1348:10:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:112:10: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
112 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
In file included from /usr/include/stdio.h:894,
from lib/strutils.c:8:
In function ‘printf’,
inlined from ‘test_strutils_cstrcasecmp’ at lib/strutils.c:1324:2,
inlined from ‘main’ at lib/strutils.c:1348:10:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:112:10: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
112 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Karel Zak [Wed, 4 Jan 2023 17:45:10 +0000 (18:45 +0100)]
Merge branch 'waitpid' of https://github.com/t-8ch/util-linux
* 'waitpid' of https://github.com/t-8ch/util-linux:
waitpid: add new command
tests: add ts_skip_exitcode_not_supported
exitcodes: add EXIT_NOTSUPP
pidfd-utils: include wait.h for siginfo_t
Thomas Weißschuh [Sat, 24 Dec 2022 04:27:04 +0000 (04:27 +0000)]
waitpid: add new command
This command implements waiting for the exit of multiple processes.
Especially it allows to wait for process that are not children of the
current process.
In contrast to wait(1P) it does not allow to retrieve the processes exit
codes.
Karel Zak [Tue, 3 Jan 2023 14:07:06 +0000 (15:07 +0100)]
Merge branch 'libblkid-debug' of https://github.com/t-8ch/util-linux
* 'libblkid-debug' of https://github.com/t-8ch/util-linux:
libblkid: remove strewn around calls to blkid_init_debug()
libblkid: always initialize debugging
Karel Zak [Tue, 3 Jan 2023 13:52:58 +0000 (14:52 +0100)]
Merge branch 'make-nice-posix-compliant' of https://github.com/kraptor/util-linux
* 'make-nice-posix-compliant' of https://github.com/kraptor/util-linux:
Changes for review
renice: support posix-compliant -n (via POSIXLY_CORRECT) and add --relative flag