]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agoMerge branch 'libblkid/crc32c-exclude' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 17 Apr 2023 11:06:01 +0000 (13:06 +0200)] 
Merge branch 'libblkid/crc32c-exclude' of https://github.com/t-8ch/util-linux

* 'libblkid/crc32c-exclude' of https://github.com/t-8ch/util-linux:
  libblkid: xfs: clean up call to ul_crc32_exclude_offset
  libblkid: erofs: calculate checksum with offset

2 years agohwclock: use kernel struct rtc_time for RTC ioctls
Karel Zak [Mon, 17 Apr 2023 10:29:40 +0000 (12:29 +0200)] 
hwclock: use kernel struct rtc_time for RTC ioctls

Based on patch from Matt Nourse.

Addresses: https://github.com/util-linux/util-linux/pull/2123
Reported-by: Matthew Nourse <matthew@nplus1.com.au>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'lsfd--raspberrypi-32bit' of https://github.com/masatake/util-linux
Karel Zak [Mon, 17 Apr 2023 09:41:02 +0000 (11:41 +0200)] 
Merge branch 'lsfd--raspberrypi-32bit' of https://github.com/masatake/util-linux

* 'lsfd--raspberrypi-32bit' of https://github.com/masatake/util-linux:
  tests: (lsfd) don't hardcode the inode number of netns in the expected output
  tests: (lsfd) adjust the output for unix datagram sockets already connected
  tests: (lsfd) adjust the output for unix datagram sockets created by socketpair
  tests: (lsfd) check the exit status of the first command in the pipeline
  tests: (lsfd) adjust the output for unix stream sockets

2 years agolibblkid: xfs: clean up call to ul_crc32_exclude_offset
Thomas Weißschuh [Mon, 17 Apr 2023 09:38:26 +0000 (11:38 +0200)] 
libblkid: xfs: clean up call to ul_crc32_exclude_offset

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: erofs: calculate checksum with offset
Thomas Weißschuh [Mon, 17 Apr 2023 09:36:30 +0000 (11:36 +0200)] 
libblkid: erofs: calculate checksum with offset

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofincore: (tests) don't mark tests as known fail
Thomas Weißschuh [Mon, 17 Apr 2023 07:12:18 +0000 (09:12 +0200)] 
fincore: (tests) don't mark tests as known fail

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofincore: (tests) don't run tests on tmpfs
Thomas Weißschuh [Mon, 17 Apr 2023 07:11:49 +0000 (09:11 +0200)] 
fincore: (tests) don't run tests on tmpfs

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoMerge branch 'fadvise/fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 17 Apr 2023 09:25:09 +0000 (11:25 +0200)] 
Merge branch 'fadvise/fixes' of https://github.com/t-8ch/util-linux

* 'fadvise/fixes' of https://github.com/t-8ch/util-linux:
  fadvise: always exit with EXIT_FAILURE on error
  fadvise: (man) document help and version arguments
  fadvise: correctly report error from posix_fadvise
  fadvise: implement --advice argument

2 years agofadvise: always exit with EXIT_FAILURE on error
Thomas Weißschuh [Sun, 16 Apr 2023 16:36:29 +0000 (18:36 +0200)] 
fadvise: always exit with EXIT_FAILURE on error

Also document it.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoMerge branch 'fadvise/test' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 17 Apr 2023 09:23:09 +0000 (11:23 +0200)] 
Merge branch 'fadvise/test' of https://github.com/t-8ch/util-linux

2 years agoMerge branch 'correct_blkid_xfs_output' of https://github.com/jlinton/util-linux
Karel Zak [Mon, 17 Apr 2023 08:57:45 +0000 (10:57 +0200)] 
Merge branch 'correct_blkid_xfs_output' of https://github.com/jlinton/util-linux

* 'correct_blkid_xfs_output' of https://github.com/jlinton/util-linux:
  libblkid: Compute CRC with sb_crc zeroed
  lib: Add crc32c function that can deal with holes

2 years agolscpu: fix -p --output-all caches delimiter
Karel Zak [Mon, 17 Apr 2023 08:50:08 +0000 (10:50 +0200)] 
lscpu: fix -p --output-all caches delimiter

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2187099
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofincore: open file with PROT_READ for qemu-user
Thomas Weißschuh [Mon, 17 Apr 2023 07:31:42 +0000 (09:31 +0200)] 
fincore: open file with PROT_READ for qemu-user

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofadvise: (tests) skip test on tmpfs
Thomas Weißschuh [Mon, 17 Apr 2023 03:21:47 +0000 (05:21 +0200)] 
fadvise: (tests) skip test on tmpfs

On tmpfs files are always in RAM, which is reflected in mincore().

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofadvise: (tests) sync data to disk before dropping pages
Thomas Weißschuh [Sun, 16 Apr 2023 08:16:53 +0000 (10:16 +0200)] 
fadvise: (tests) sync data to disk before dropping pages

The test fails if pages are not dropped because they are not yet written
back to disk.
So force a writeback before continuing.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofadvise: (man) document help and version arguments
Thomas Weißschuh [Sun, 16 Apr 2023 16:35:18 +0000 (18:35 +0200)] 
fadvise: (man) document help and version arguments

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofadvise: correctly report error from posix_fadvise
Thomas Weißschuh [Sun, 16 Apr 2023 08:52:28 +0000 (10:52 +0200)] 
fadvise: correctly report error from posix_fadvise

posix_fadvise() does not use errno.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofadvise: implement --advice argument
Thomas Weißschuh [Sun, 16 Apr 2023 08:30:47 +0000 (10:30 +0200)] 
fadvise: implement --advice argument

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: (lsfd) don't hardcode the inode number of netns in the expected output
Masatake YAMATO [Sat, 15 Apr 2023 21:48:09 +0000 (06:48 +0900)] 
tests: (lsfd) don't hardcode the inode number of netns in the expected output

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) adjust the output for unix datagram sockets already connected
Masatake YAMATO [Sat, 15 Apr 2023 12:47:59 +0000 (21:47 +0900)] 
tests: (lsfd) adjust the output for unix datagram sockets already connected

Though older kernels report such sockets as "unconnected" via /proc/net/unix,
the newer kernels report them as "connected". The change is introduced in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83301b5367a98c17ec0d76c7bc0ccdc3c7e7ad6d

This caused a failure in a test case. To avoid the failure,
this change rewrites "unconnected" in the lsfd's output to "connected".

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) adjust the output for unix datagram sockets created by socketpair
Masatake YAMATO [Sat, 15 Apr 2023 11:50:29 +0000 (20:50 +0900)] 
tests: (lsfd) adjust the output for unix datagram sockets created by socketpair

Though older kernels report such sockets as "unconnected" via /proc/net/unix,
the newer kernels report them as "connected". The change is introduced in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83301b5367a98c17ec0d76c7bc0ccdc3c7e7ad6d

This caused a failure in a test case. To avoid the failure,
this change rewrites "state=unconnected" in the lsfd's output
to "state=connected".

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) check the exit status of the first command in the pipeline
Masatake YAMATO [Sat, 15 Apr 2023 11:49:58 +0000 (20:49 +0900)] 
tests: (lsfd) check the exit status of the first command in the pipeline

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) adjust the output for unix stream sockets
Masatake YAMATO [Sat, 15 Apr 2023 03:07:58 +0000 (12:07 +0900)] 
tests: (lsfd) adjust the output for unix stream sockets

lsfd changes the output of NAME column for a unix stream socket
whether the kernel reports it is a "UNIX-STREAM" socket or a "UNIX"
socket. Rather older version of kernels report the socket "UNIX"

For "UNIX", lsfd appends "type=stream" to the NAME column.
This caused a failure in test cases. To avoid the failure,
this change strips "type=stream" from the output before
comparing the output strings and expected strings.

See also the commit log of a60ac11fe0087584f37329b4733edfade3452c64.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agofadvise: (tests) add helper to create files
Thomas Weißschuh [Sun, 16 Apr 2023 08:16:33 +0000 (10:16 +0200)] 
fadvise: (tests) add helper to create files

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofadvise: (tests) enable drop test
Thomas Weißschuh [Sun, 16 Apr 2023 07:43:45 +0000 (09:43 +0200)] 
fadvise: (tests) enable drop test

The test file needs to be executable to be run.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: Compute CRC with sb_crc zeroed
Jeremy Linton [Fri, 14 Apr 2023 21:25:28 +0000 (16:25 -0500)] 
libblkid: Compute CRC with sb_crc zeroed

The Linux kernel computes the sb_crc by crcing the
superblock with the CRC field set to 0. The code is
trying to avoid doing this in three separate CRC calls
like the kernel performs by simply zeroing the field
and making a single call.

Except that the passed copy "ondisk" isn't the same
as the returned copy "csummed" so the zeroing goes into
the wrong buffer. Meaning that the CRC is computed
incorrectly. This results in blkid returning:

/dev/sda4: PARTUUID="2f162043-63c2-d145-869b-e53f9db57476"

rather than:

/dev/sda4: UUID="45b931b7-592a-46dc-9c33-d38d5901ec29" BLOCK_SIZE="4096" TYPE="xfs" PARTUUID="2f162043-63c2-d145-869b-e53f9db57476"

Which can result in lots of failures including boot
failures if XFS modules aren't placed into the initrd,
or scripts/etc cannot determine the fs UUID.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2 years agolib: Add crc32c function that can deal with holes
Jeremy Linton [Fri, 14 Apr 2023 23:07:29 +0000 (18:07 -0500)] 
lib: Add crc32c function that can deal with holes

XFS, and possibly other filesystems expect that the CRC field
is excluded (or rather RAZ) during the CRC operation. Lets
create a generic helper that is similar to the CRC32 version
ul_crc32_exclude_offset() which computes the CRC while replacing
exclude_len bytes of exclude_off with zeros.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2 years agoflock: (tests) add test for fd-based locking
Thomas Weißschuh [Fri, 14 Apr 2023 07:12:03 +0000 (09:12 +0200)] 
flock: (tests) add test for fd-based locking

2 years agoFix mmap/ioctl(3p) references in manual
наб [Fri, 7 Apr 2023 14:48:06 +0000 (16:48 +0200)] 
Fix mmap/ioctl(3p) references in manual

mmap(3p) is passable, inasmuch as it does actually describe mmap(2).

ioctl(3p), on the other hand, describes XSI STREAMS, which bear no
relation to ioctl(2) under Linux, much less ioctl_console(2).

Both live in the non-free manpages-posix-dev.

2 years agohwclock: make sure struct tm is initialized
Karel Zak [Tue, 11 Apr 2023 10:24:56 +0000 (12:24 +0200)] 
hwclock: make sure struct tm is initialized

Addresses: https://github.com/util-linux/util-linux/pull/2123
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'patch-19' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:10:57 +0000 (12:10 +0200)] 
Merge branch 'patch-19' of https://github.com/mariobl/util-linux

* 'patch-19' of https://github.com/mariobl/util-linux:
  swapon: (man) use correct markup for external man page links

2 years agoMerge branch 'patch-18' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:10:36 +0000 (12:10 +0200)] 
Merge branch 'patch-18' of https://github.com/mariobl/util-linux

* 'patch-18' of https://github.com/mariobl/util-linux:
  setarch: (man) Fix typo

2 years agoMerge branch 'patch-17' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:10:17 +0000 (12:10 +0200)] 
Merge branch 'patch-17' of https://github.com/mariobl/util-linux

* 'patch-17' of https://github.com/mariobl/util-linux:
  mount: (man) use markup for command names

2 years agoMerge branch 'patch-16' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:09:38 +0000 (12:09 +0200)] 
Merge branch 'patch-16' of https://github.com/mariobl/util-linux

* 'patch-16' of https://github.com/mariobl/util-linux:
  fstab: (man) use markup for external man page links

2 years agoMerge branch 'patch-15' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:09:16 +0000 (12:09 +0200)] 
Merge branch 'patch-15' of https://github.com/mariobl/util-linux

* 'patch-15' of https://github.com/mariobl/util-linux:
  taskset: (man) Fix typos and use correct markup

2 years agoMerge branch 'patch-14' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:08:48 +0000 (12:08 +0200)] 
Merge branch 'patch-14' of https://github.com/mariobl/util-linux

2 years agoMerge branch 'patch-13' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:08:19 +0000 (12:08 +0200)] 
Merge branch 'patch-13' of https://github.com/mariobl/util-linux

* 'patch-13' of https://github.com/mariobl/util-linux:
  lsfd: (man) Fix typo and add markup for external man page link

2 years agoMerge branch 'patch-12' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:07:57 +0000 (12:07 +0200)] 
Merge branch 'patch-12' of https://github.com/mariobl/util-linux

* 'patch-12' of https://github.com/mariobl/util-linux:
  hardlink: (man) Use markup for file names

2 years agoMerge branch 'patch-11' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:07:23 +0000 (12:07 +0200)] 
Merge branch 'patch-11' of https://github.com/mariobl/util-linux

* 'patch-11' of https://github.com/mariobl/util-linux:
  last: (man) use correct markup

2 years agoMerge branch 'patch-20' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 11 Apr 2023 10:05:54 +0000 (12:05 +0200)] 
Merge branch 'patch-20' of https://github.com/mariobl/util-linux

* 'patch-20' of https://github.com/mariobl/util-linux:
  column: (man) use markup for option

2 years agoMerge branch 'hwclock/cleanup' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 11 Apr 2023 10:04:30 +0000 (12:04 +0200)] 
Merge branch 'hwclock/cleanup' of https://github.com/t-8ch/util-linux

* 'hwclock/cleanup' of https://github.com/t-8ch/util-linux:
  hwclock: use linux/rtc.h
  hwclock: drop ancient sparc special cases
  hwclock: constify struct clock_opts
  hwclock: (tests) add simple test to show rtc time

2 years agocolumn: (man) use markup for option
Mario Blättermann [Mon, 10 Apr 2023 14:46:03 +0000 (16:46 +0200)] 
column: (man) use markup for option

2 years agoswapon: (man) use correct markup for external man page links
Mario Blättermann [Mon, 10 Apr 2023 14:44:52 +0000 (16:44 +0200)] 
swapon: (man) use correct markup for external man page links

2 years agosetarch: (man) Fix typo
Mario Blättermann [Mon, 10 Apr 2023 14:43:05 +0000 (16:43 +0200)] 
setarch: (man) Fix typo

2 years agomount: (man) use markup for command names
Mario Blättermann [Mon, 10 Apr 2023 14:41:43 +0000 (16:41 +0200)] 
mount: (man) use markup for command names

2 years agofstab: (man) use markup for external man page links
Mario Blättermann [Mon, 10 Apr 2023 14:36:38 +0000 (16:36 +0200)] 
fstab: (man) use markup for external man page links

2 years agotaskset: (man) Fix typos and use correct markup
Mario Blättermann [Mon, 10 Apr 2023 14:34:08 +0000 (16:34 +0200)] 
taskset: (man) Fix typos and use correct markup

2 years agonamei: (man) clarify the namei binary
Mario Blättermann [Mon, 10 Apr 2023 14:31:37 +0000 (16:31 +0200)] 
namei: (man) clarify the namei binary

2 years agolsfd: (man) Fix typo and add markup for external man page link
Mario Blättermann [Mon, 10 Apr 2023 14:29:50 +0000 (16:29 +0200)] 
lsfd: (man) Fix typo and add markup for external man page link

2 years agohardlink: (man) Use markup for file names
Mario Blättermann [Mon, 10 Apr 2023 14:27:00 +0000 (16:27 +0200)] 
hardlink: (man) Use markup for file names

2 years agolast: (man) use correct markup
Mario Blättermann [Mon, 10 Apr 2023 14:24:46 +0000 (16:24 +0200)] 
last: (man) use correct markup

2 years agolibmount: fix superblock rw/ro reconfiguration
Karel Zak [Wed, 5 Apr 2023 19:44:55 +0000 (21:44 +0200)] 
libmount: fix superblock rw/ro reconfiguration

The classic mount(2) defaults to 'rw', but the new API does not reset
superblock to 'rw' if the flag is not explicitly used for
FSCONFIG_CMD_RECONFIGURE.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2180593
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: add blkpr in AUTHORS file
zhenwei pi [Wed, 5 Apr 2023 10:08:01 +0000 (18:08 +0800)] 
docs: add blkpr in AUTHORS file

blkpr command was added in the v2.39 development window, add this in
AUTHORS file.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2 years agofindmnt: use warning rather than error from FS type mismatch
Karel Zak [Wed, 5 Apr 2023 10:00:11 +0000 (12:00 +0200)] 
findmnt: use warning rather than error from FS type mismatch

Fixes: https://github.com/util-linux/util-linux/issues/2148
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohwclock: use linux/rtc.h
Thomas Weißschuh [Tue, 4 Apr 2023 14:44:47 +0000 (14:44 +0000)] 
hwclock: use linux/rtc.h

For a long time, since commit
607ca46e97a1 ("UAPI: (Scripted) Disintegrate include/linux")
the kernel provided a dedicate uapi include for RTC definitions.

This makes the comment linux/mc146818rtc.h obsolete.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agohwclock: drop ancient sparc special cases
Thomas Weißschuh [Tue, 4 Apr 2023 14:42:52 +0000 (14:42 +0000)] 
hwclock: drop ancient sparc special cases

Since commit
eed795bf1fd2 ("sparc: Kill sbus mostek RTC driver.")
the only kernel driver implementing this non-standard ioctl was removed.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agohwclock: constify struct clock_opts
Thomas Weißschuh [Tue, 4 Apr 2023 14:42:32 +0000 (14:42 +0000)] 
hwclock: constify struct clock_opts

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agohwclock: (tests) add simple test to show rtc time
Thomas Weißschuh [Tue, 4 Apr 2023 14:42:08 +0000 (14:42 +0000)] 
hwclock: (tests) add simple test to show rtc time

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agobuild-sys: release++ (v2.39-rc2) v2.39-rc2
Karel Zak [Tue, 4 Apr 2023 12:29:20 +0000 (14:29 +0200)] 
build-sys: release++ (v2.39-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update v2.39-ReleaseNotes
Karel Zak [Tue, 4 Apr 2023 12:25:45 +0000 (14:25 +0200)] 
docs: update v2.39-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update AUTHORS file
Karel Zak [Tue, 4 Apr 2023 12:24:19 +0000 (14:24 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: merge changes
Karel Zak [Tue, 4 Apr 2023 12:19:26 +0000 (14:19 +0200)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: (man) fix po-man warnings
Karel Zak [Tue, 4 Apr 2023 12:14:32 +0000 (14:14 +0200)] 
lsfd: (man) fix po-man warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo: merge changes
Karel Zak [Tue, 4 Apr 2023 12:09:53 +0000 (14:09 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 4 Apr 2023 12:01:27 +0000 (14:01 +0200)] 
po: update pl.po (from translationproject.org)

2 years agotests: add cryptsetup build results
Karel Zak [Tue, 4 Apr 2023 11:59:29 +0000 (13:59 +0200)] 
tests: add cryptsetup build results

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: (build-sys) add --conf=<path>
Karel Zak [Tue, 4 Apr 2023 11:58:08 +0000 (13:58 +0200)] 
tests: (build-sys) add --conf=<path>

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofstab: improve 4th field description
Karel Zak [Tue, 4 Apr 2023 10:05:32 +0000 (12:05 +0200)] 
fstab: improve 4th field description

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: copy BLKID_PARTS_FORCE_GPT to whole-disk prober
Karel Zak [Tue, 4 Apr 2023 09:04:51 +0000 (11:04 +0200)] 
libblkid: copy BLKID_PARTS_FORCE_GPT to whole-disk prober

Addresses: https://github.com/util-linux/util-linux/discussions/2146
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agonsenter: (man) imropve readability
Karel Zak [Tue, 4 Apr 2023 08:39:36 +0000 (10:39 +0200)] 
nsenter: (man) imropve readability

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agonsenter: use explicit argument to follow target PID/GID
Thomas Weißschuh [Mon, 3 Apr 2023 18:44:15 +0000 (18:44 +0000)] 
nsenter: use explicit argument to follow target PID/GID

Making the argument to -S and -G optional in #2092 broke the cli
compatability.
So replace it with an explicit "follow" argument that provides the new
functionality with a compatible interface.

Fixes #2143

2 years agoMerge branch 'patch-10' of https://github.com/mariobl/util-linux
Karel Zak [Tue, 28 Mar 2023 17:10:40 +0000 (19:10 +0200)] 
Merge branch 'patch-10' of https://github.com/mariobl/util-linux

* 'patch-10' of https://github.com/mariobl/util-linux:
  mount: (man) Add usual Asciidoctor markup

2 years agoMerge branch 'mount-relatime-equal' of https://github.com/skitt/util-linux
Karel Zak [Tue, 28 Mar 2023 17:09:50 +0000 (19:09 +0200)] 
Merge branch 'mount-relatime-equal' of https://github.com/skitt/util-linux

* 'mount-relatime-equal' of https://github.com/skitt/util-linux:
  mount: relatime allows equality

2 years agoMerge branch 'agetty' of https://github.com/jwilk-forks/util-linux
Karel Zak [Tue, 28 Mar 2023 17:07:09 +0000 (19:07 +0200)] 
Merge branch 'agetty' of https://github.com/jwilk-forks/util-linux

* 'agetty' of https://github.com/jwilk-forks/util-linux:
  agetty: (man) fix typos

2 years agoMerge branch 'badfmt' of https://github.com/rpigott/util-linux
Karel Zak [Tue, 28 Mar 2023 17:06:39 +0000 (19:06 +0200)] 
Merge branch 'badfmt' of https://github.com/rpigott/util-linux

* 'badfmt' of https://github.com/rpigott/util-linux:
  hexdump-parse: handle truncated format pattern

2 years agosetarch: add loongarch support
Enze Li [Mon, 27 Mar 2023 08:25:20 +0000 (16:25 +0800)] 
setarch: add loongarch support

Signed-off-by: Enze Li <lienze@kylinos.cn>
2 years agolibmount: (idmap) reuse tree FD, fix umount
Karel Zak [Mon, 27 Mar 2023 10:51:53 +0000 (12:51 +0200)] 
libmount: (idmap) reuse tree FD, fix umount

* reuse already open mount tree; the tree could be already open due to
  regular mount, bind or remount operation

* umount (MNT_DETACH) old target if we created a clone (but the
  operation is not a bind)

Adedreses: https://github.com/util-linux/util-linux/issues/2130
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomount: (man) Add usual Asciidoctor markup
Mario Blättermann [Sun, 26 Mar 2023 15:49:07 +0000 (17:49 +0200)] 
mount: (man) Add usual Asciidoctor markup

2 years agomount: relatime allows equality
Stephen Kitt [Sat, 25 Mar 2023 08:30:22 +0000 (09:30 +0100)] 
mount: relatime allows equality

relatime also updates atime if the previous atime is equal to one or
both of the ctime and mtime; a non-strict interpretation of "earlier
than" allows this, but for clarity, this makes it explicit.

Pointed out by "epiii2" and "ctrl-alt-delor" in
https://unix.stackexchange.com/q/740862/86440.

Signed-off-by: Stephen Kitt <steve@sk2.org>
2 years agoagetty: (man) fix typos
Jakub Wilk [Sat, 25 Mar 2023 08:20:06 +0000 (09:20 +0100)] 
agetty: (man) fix typos

2 years agohexdump-parse: handle truncated format pattern
Ronan Pigott [Thu, 23 Mar 2023 22:18:00 +0000 (15:18 -0700)] 
hexdump-parse: handle truncated format pattern

If the fmt being parsed by block_size is exactly '%', *++fmt is the
terminator and strchr will return a valid pointer to the terminator of
spec rather than NULL, the while condition will pass and subsequent
strchr will read past the end of fmt until a spec character is found
again

ASAN aborts with the following error on the first buffer overread:

AddressSanitizer: heap-buffer-overflow on address 0x602000000212 at pc 0x55bf1c4b2d78 bp 0x7ffe33c8cff0 sp 0x7ffe33c8cfe0
READ of size 1 at 0x602000000212 thread T0
    #0 0x55bf1c4b2d77 in block_size ../text-utils/hexdump-parse.c:207
    #1 0x55bf1c4ad36f in main ../text-utils/hexdump.c:214
    #2 0x7f15f063c78f  (/usr/lib/libc.so.6+0x2378f)
    #3 0x7f15f063c849 in __libc_start_main (/usr/lib/libc.so.6+0x23849)
    #4 0x55bf1c4ac6c4 in _start (../build/hexdump+0x86c4)

2 years agoMerge branch 'fixes' of https://github.com/brauner/util-linux
Karel Zak [Thu, 23 Mar 2023 20:20:33 +0000 (21:20 +0100)] 
Merge branch 'fixes' of https://github.com/brauner/util-linux

* 'fixes' of https://github.com/brauner/util-linux:
  idmap: kill child when writing the idmap fails

2 years agoMerge branch 'xry111/lscpu-loongarch' of https://github.com/xry111/util-linux
Karel Zak [Thu, 23 Mar 2023 20:19:11 +0000 (21:19 +0100)] 
Merge branch 'xry111/lscpu-loongarch' of https://github.com/xry111/util-linux

* 'xry111/lscpu-loongarch' of https://github.com/xry111/util-linux:
  lscpu: Add loongarch testcase
  lscpu: Add "ISA" field into lscpu_cputype and determine loongarch op-mode from its value
  lscpu: Parse loongarch specific lines

2 years agoMerge branch 'lsfd/typo' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 23 Mar 2023 20:14:59 +0000 (21:14 +0100)] 
Merge branch 'lsfd/typo' of https://github.com/t-8ch/util-linux

* 'lsfd/typo' of https://github.com/t-8ch/util-linux:
  lsfd: (man) fix typo

2 years agoMerge branch 'nasal_daemon_part1_fclose' of https://github.com/crrodriguez/util-linux
Karel Zak [Thu, 23 Mar 2023 20:14:28 +0000 (21:14 +0100)] 
Merge branch 'nasal_daemon_part1_fclose' of https://github.com/crrodriguez/util-linux

* 'nasal_daemon_part1_fclose' of https://github.com/crrodriguez/util-linux:
  tests: fclose(stdin) UB

2 years agolibmount: fix user/users for superuser
Karel Zak [Thu, 23 Mar 2023 19:59:46 +0000 (20:59 +0100)] 
libmount: fix user/users for superuser

Always use MS_SECURE and MS_OWNERSECURE to mount fstab entries where
is specified "user" or "users", although the current user is root.

This bug has never been released (v2.39-rc1 only).

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomount: (man) add notes about remount behavior
Karel Zak [Thu, 23 Mar 2023 15:10:22 +0000 (16:10 +0100)] 
mount: (man) add notes about remount behavior

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: fix MS_REMOUNT emulation by mount_setattr()
Karel Zak [Thu, 23 Mar 2023 14:25:00 +0000 (15:25 +0100)] 
libmount: fix MS_REMOUNT emulation by mount_setattr()

The classic mount(MS_REMOUNT) means that all unspecified MS_NOxxx
flags are remove (except MS_NOATIME). We need to follow this semantic
when emulate remount by mount_setattr(), because "mount -o remount /"
is the way how (for example) systemd resets root filesystem to default
(e.g. ro->rw, etc.)

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2180593
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: fix and cleanup relatime use
Karel Zak [Thu, 23 Mar 2023 13:22:37 +0000 (14:22 +0100)] 
libmount: fix and cleanup relatime use

* move atime logic to optlist

* MOUNT_ATTR_RELATIME is zero, so we cannot use use "if (!attr)" to skip mount_setattr()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: add missing MOUNT_ATTR_NODEV
Karel Zak [Thu, 23 Mar 2023 11:37:18 +0000 (12:37 +0100)] 
libmount: add missing MOUNT_ATTR_NODEV

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoidmap: kill child when writing the idmap fails
Christian Brauner [Thu, 23 Mar 2023 10:09:28 +0000 (11:09 +0100)] 
idmap: kill child when writing the idmap fails

This fixes the second issues reported in [1] where calling
mount -o 'X-mount.idmap=[...]' just hangs.

Fixes: https://github.com/util-linux/util-linux/issues/2130 [1]
Signed-off-by: Christian Brauner <brauner@kernel.org>
2 years agolibmount: fix typo, improve debug
Karel Zak [Wed, 22 Mar 2023 17:02:31 +0000 (18:02 +0100)] 
libmount: fix typo, improve debug

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolscpu: Add loongarch testcase
Xi Ruoyao [Wed, 22 Mar 2023 13:16:30 +0000 (21:16 +0800)] 
lscpu: Add loongarch testcase

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2 years agolscpu: Add "ISA" field into lscpu_cputype and determine loongarch op-mode from its...
Xi Ruoyao [Wed, 22 Mar 2023 12:57:34 +0000 (20:57 +0800)] 
lscpu: Add "ISA" field into lscpu_cputype and determine loongarch op-mode from its value

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2 years agolscpu: Parse loongarch specific lines
Xi Ruoyao [Wed, 22 Mar 2023 12:44:19 +0000 (20:44 +0800)] 
lscpu: Parse loongarch specific lines

/proc/cpuinfo on loongarch uses UPPERCASE letters in some field names.
Add the patterns for them.

"Address Sizes", "CPU Family", "CPU Revision" (aka "Model"), and
"Model Name" are correctly outputed, but "CPU MHz" not (because we
don't have a CPUFreq driver yet).

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2 years agolsfd: (man) fix typo
Thomas Weißschuh [Wed, 22 Mar 2023 01:30:00 +0000 (01:30 +0000)] 
lsfd: (man) fix typo

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: fclose(stdin) UB
Cristian Rodríguez [Tue, 21 Mar 2023 19:55:15 +0000 (19:55 +0000)] 
tests: fclose(stdin) UB

The standard streams must not be closed unless it is
the very last thing a program does before termination.

A warning about this was added to POSIX.1-2008 and later standards.

One must redirect stdin to /dev/null using freopen instead.

2 years agobuild-sys: fix libblkid fuzz sample test if-endif
Karel Zak [Fri, 17 Mar 2023 12:11:50 +0000 (13:11 +0100)] 
build-sys: fix libblkid fuzz sample test if-endif

All tests have to be covered by BUILD_LIBBLKID_TESTS otherwise
proper CFLAGS ($blkid_tests_cflags) are undefined.

Fixes: https://github.com/util-linux/util-linux/issues/2119
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobuild-sys: report fuzzing support status
Karel Zak [Fri, 17 Mar 2023 12:04:41 +0000 (13:04 +0100)] 
build-sys: report fuzzing support status

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'patch-9' of https://github.com/mariobl/util-linux
Karel Zak [Fri, 17 Mar 2023 11:26:55 +0000 (12:26 +0100)] 
Merge branch 'patch-9' of https://github.com/mariobl/util-linux

* 'patch-9' of https://github.com/mariobl/util-linux:
  Fix typo in lsfd.c