]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
13 months agofindmnt: (man) write about -Q,--filter option
Masatake YAMATO [Tue, 18 Jun 2024 15:14:05 +0000 (00:14 +0900)] 
findmnt: (man) write about -Q,--filter option

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agofindmnt: add -Q,--filter option
Masatake YAMATO [Sat, 6 Apr 2024 21:27:47 +0000 (06:27 +0900)] 
findmnt: add -Q,--filter option

NOTE: --poll and --filter cannot use together.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agofindmnt: (refactor) convert add_column macro to a function
Masatake YAMATO [Sat, 6 Apr 2024 19:56:29 +0000 (04:56 +0900)] 
findmnt: (refactor) convert add_column macro to a function

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agofindmnt: (refactor) add a helper function making an instance of libscols_table
Masatake YAMATO [Sat, 6 Apr 2024 19:42:53 +0000 (04:42 +0900)] 
findmnt: (refactor) add a helper function making an instance of libscols_table

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agofindmnt: (refactor) remove global variables shared between findmnt.c and fintmnt...
Masatake YAMATO [Sat, 6 Apr 2024 19:30:26 +0000 (04:30 +0900)] 
findmnt: (refactor) remove global variables shared between findmnt.c and fintmnt-verify.c

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agolslocks: remove unnecessary code
Karel Zak [Wed, 19 Jun 2024 09:54:40 +0000 (11:54 +0200)] 
lslocks: remove unnecessary code

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolib/sysfs: zero-terminate result of sysfs_blkdev_get_devchain()
Thomas Weißschuh [Wed, 12 Jun 2024 21:32:15 +0000 (23:32 +0200)] 
lib/sysfs: zero-terminate result of sysfs_blkdev_get_devchain()

sysfs_blkdev_get_devchain() does not zero-terminate its result, but the
caller expects a C-string.
Use ul_buffer_get_string() which includes a trailing zero-byte.

Now it's also valid for sz and bufsz to be equal.

See #3088.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agolib/buffer: introduce ul_buffer_get_string()
Thomas Weißschuh [Thu, 13 Jun 2024 09:39:34 +0000 (11:39 +0200)] 
lib/buffer: introduce ul_buffer_get_string()

Some users need a zero-byte-terminated string.
As the buffer internally already maintains a zero-termination, add a
helper function that exposes this to users.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agolib/sysfs: abort device hierarchy walk at root of sysfs
Thomas Weißschuh [Wed, 12 Jun 2024 21:30:28 +0000 (23:30 +0200)] 
lib/sysfs: abort device hierarchy walk at root of sysfs

It does not make sense to leave the sysfs hierarchy during the walk of
the parent directories.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agoMerge branch 'lsfd--close-all' of https://github.com/masatake/util-linux
Karel Zak [Mon, 10 Jun 2024 09:10:07 +0000 (11:10 +0200)] 
Merge branch 'lsfd--close-all' of https://github.com/masatake/util-linux

* 'lsfd--close-all' of https://github.com/masatake/util-linux:
  lsfd: minimize the output related to lsfd itself

13 months agolsns: ignore ESRCH errors reported when accessing files under /proc
Masatake YAMATO [Fri, 7 Jun 2024 19:54:03 +0000 (04:54 +0900)] 
lsns: ignore ESRCH errors reported when accessing files under /proc

Fix #2799.

If a process is gone, system calls accessing files under /proc can
return ESRCH.

Suggested by Johannes Edmeier (@joshiste).
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agolsfd: minimize the output related to lsfd itself
Masatake YAMATO [Thu, 4 Jan 2024 02:33:51 +0000 (11:33 +0900)] 
lsfd: minimize the output related to lsfd itself

Copied from the test case in lib/fileutils.c.

13 months agoWall: Fix terminal flag usage
Karel Zak [Thu, 6 Jun 2024 07:36:28 +0000 (09:36 +0200)] 
Wall: Fix terminal flag usage
.
Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agoMerge branch 'ci/armv7' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 6 Jun 2024 07:32:19 +0000 (09:32 +0200)] 
Merge branch 'ci/armv7' of https://github.com/t-8ch/util-linux

* 'ci/armv7' of https://github.com/t-8ch/util-linux:
  ci: test on armv7
  lsfd: (tests) skip tests using fd flags on qemu-user

13 months agoMerge branch 'spelling' of https://github.com/scop/util-linux
Karel Zak [Thu, 6 Jun 2024 07:30:25 +0000 (09:30 +0200)] 
Merge branch 'spelling' of https://github.com/scop/util-linux

* 'spelling' of https://github.com/scop/util-linux:
  *: spelling and grammar fixes

13 months agoMerge branch 'feat/logger-sd-completions' of https://github.com/scop/util-linux
Karel Zak [Thu, 6 Jun 2024 07:27:19 +0000 (09:27 +0200)] 
Merge branch 'feat/logger-sd-completions' of https://github.com/scop/util-linux

* 'feat/logger-sd-completions' of https://github.com/scop/util-linux:
  bash-completion: add logger --sd-* completions

13 months agoMerge branch 'wdctl/compat-chardev' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 6 Jun 2024 07:26:26 +0000 (09:26 +0200)] 
Merge branch 'wdctl/compat-chardev' of https://github.com/t-8ch/util-linux

* 'wdctl/compat-chardev' of https://github.com/t-8ch/util-linux:
  wdctl: always query device node when sysfs is unavailable

13 months agoMerge branch 'PR/wall-tty-list' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 6 Jun 2024 07:25:10 +0000 (09:25 +0200)] 
Merge branch 'PR/wall-tty-list' of github.com:karelzak/util-linux-work

* 'PR/wall-tty-list' of github.com:karelzak/util-linux-work:
  wall: always use utmp as fallback

13 months ago*: spelling and grammar fixes
Ville Skyttä [Tue, 4 Jun 2024 20:44:40 +0000 (23:44 +0300)] 
*: spelling and grammar fixes

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
13 months agobash-completion: add logger --sd-* completions
Ville Skyttä [Tue, 4 Jun 2024 20:19:38 +0000 (23:19 +0300)] 
bash-completion: add logger --sd-* completions

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
13 months agowdctl: always query device node when sysfs is unavailable
Thomas Weißschuh [Tue, 4 Jun 2024 19:06:49 +0000 (21:06 +0200)] 
wdctl: always query device node when sysfs is unavailable

When there is no sysfs at all for the watchdog, fall back to reading
from the device node.
This is also useful if the legacy compat /dev/watchdog device which
never has a sysfs interface.

Closes: #3073
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agoci: test on armv7
Thomas Weißschuh [Sun, 4 Feb 2024 20:46:48 +0000 (21:46 +0100)] 
ci: test on armv7

Currently no tests are running on 32bit ARM.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agolsfd: (tests) skip tests using fd flags on qemu-user
Thomas Weißschuh [Mon, 29 Apr 2024 06:11:57 +0000 (08:11 +0200)] 
lsfd: (tests) skip tests using fd flags on qemu-user

The flags value visible in /proc/$PID/fdinfo/ is encoded using the
platform the kernel is running on.
Not all platforms use the same numeric flag value,
making this cross-platform interpretation brittle.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agoscriptreplay: fix uninitialized value [coverity scan]
Karel Zak [Tue, 4 Jun 2024 11:19:13 +0000 (13:19 +0200)] 
scriptreplay: fix uninitialized value [coverity scan]

* fix uninitialized value "rc"

* simplify if(rc) block

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agoMerge branch 'master' of https://github.com/jamacku/util-linux
Karel Zak [Tue, 4 Jun 2024 07:41:26 +0000 (09:41 +0200)] 
Merge branch 'master' of https://github.com/jamacku/util-linux

* 'master' of https://github.com/jamacku/util-linux:
  ci: enable dependency manager for GitHub Actions

13 months agoMerge branch 'squash' of https://github.com/BourgeoisBear/util-linux
Karel Zak [Tue, 4 Jun 2024 07:35:20 +0000 (09:35 +0200)] 
Merge branch 'squash' of https://github.com/BourgeoisBear/util-linux

* 'squash' of https://github.com/BourgeoisBear/util-linux:
  last/lastb field truncation indicator

13 months agoMerge branch 'as-safe-printf' of https://github.com/crrodriguez/util-linux
Karel Zak [Tue, 4 Jun 2024 07:29:13 +0000 (09:29 +0200)] 
Merge branch 'as-safe-printf' of https://github.com/crrodriguez/util-linux

* 'as-safe-printf' of https://github.com/crrodriguez/util-linux:
  Allow printf to be used on signal handlers

13 months agoMerge branch 'PR/libmount-fds' of github.com:karelzak/util-linux-work
Karel Zak [Tue, 4 Jun 2024 07:14:49 +0000 (09:14 +0200)] 
Merge branch 'PR/libmount-fds' of github.com:karelzak/util-linux-work

* 'PR/libmount-fds' of github.com:karelzak/util-linux-work:
  libmount: fix tree FD usage in subdir hook

13 months agoMerge branch 'master' of https://github.com/jlinton/util-linux
Karel Zak [Tue, 4 Jun 2024 07:14:22 +0000 (09:14 +0200)] 
Merge branch 'master' of https://github.com/jlinton/util-linux

* 'master' of https://github.com/jlinton/util-linux:
  lscpu: New Arm Cortex part numbers

13 months agolibmount: fix tree FD usage in subdir hook
Karel Zak [Mon, 3 Jun 2024 10:33:01 +0000 (12:33 +0200)] 
libmount: fix tree FD usage in subdir hook

* Initialize the tree file descriptor in the hook_subdir.c module if
  it has not been initialized yet. (hook_mount.c does not open the
  tree if the mount.<type> helper will be executed.)

* Move the function to open the tree to context.c to make it more
  generic and usable in more places.

Reported-by: Linus Heckemann <git@sphalerite.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agowall: always use utmp as fallback
Karel Zak [Mon, 3 Jun 2024 12:32:18 +0000 (14:32 +0200)] 
wall: always use utmp as fallback

Wall(1) can be compiled with systemd support to read the names of ttys
from the systemd session list. However, this may not work on all systems.
In case of failure, the best option is to use the traditional
utmp method as a fallback.

This commit uses strv (string vector) to collect tty names from both
sources (systemd and utmp) and then sends a message to all ttys.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2283049
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agotests: add dump from ARM with A510+A710+A715+X3
Karel Zak [Thu, 30 May 2024 12:26:43 +0000 (14:26 +0200)] 
tests: add dump from ARM with A510+A710+A715+X3

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agotests: update lscpu vmware_fpe output
Karel Zak [Thu, 30 May 2024 12:11:38 +0000 (14:11 +0200)] 
tests: update lscpu vmware_fpe output

The cpuinfo for vmware_fpe defines two types of CPUs, which differ in
their flags.  However, this difference is ignored by lscpu. The latest
version now uses the flags that were defined later.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolscpu: use CPU types de-duplication
Karel Zak [Thu, 30 May 2024 11:59:16 +0000 (13:59 +0200)] 
lscpu: use CPU types de-duplication

The new CPU type was always allocated when a new relevant value for
the type was found in the cpuinfo file. However, this solution is
fragile because it can result in the parser creating a cputype struct
with incomplete information.

For instance, on ARM systems with multiple CPU types, a new CPU type
would be triggered by a different "CPU part ID". In cases where the
vendor remained the same, a new type would be created later but the
vendor would not be initialized.

The new implementation creates a new CPU type for each CPU (almost)
and then later de-duplicates the array based on vendor, model, etc.

Addresses: https://github.com/util-linux/util-linux/issues/3062
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolscpu: New Arm Cortex part numbers
Jeremy Linton [Wed, 29 May 2024 16:04:38 +0000 (11:04 -0500)] 
lscpu: New Arm Cortex part numbers

Arm has announced the Cortex-X925 and published the TRM here:
https://developer.arm.com/documentation/102807/0001/?lang=en

As well as the Cortex-A725 with a TRM here:
https://developer.arm.com/documentation/107652/0001/?lang=en

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
14 months agoMerge branch 'PR/libmount-exec-errors' of github.com:karelzak/util-linux-work
Karel Zak [Tue, 28 May 2024 10:43:00 +0000 (12:43 +0200)] 
Merge branch 'PR/libmount-exec-errors' of github.com:karelzak/util-linux-work

* 'PR/libmount-exec-errors' of github.com:karelzak/util-linux-work:
  libmount: expose exec errors

14 months agoMerge branch 'scriptreplay/add-interactive-playback/2999' of https://github.com/jNull...
Karel Zak [Tue, 28 May 2024 10:32:49 +0000 (12:32 +0200)] 
Merge branch 'scriptreplay/add-interactive-playback/2999' of https://github.com/jNullj/util-linux

* 'scriptreplay/add-interactive-playback/2999' of https://github.com/jNullj/util-linux:
  format: fix switch case indent
  fix clang compile
  replace fgetwc with fgetc
  format: fix comments and if braces format
  format: CamelCase to SnakeCase
  Refactor convoluted switch case into if else
  fix formatting and add mising break
  Add missing author
  Add interactive playback docs
  Add right arrow key to step forward in playback
  Remove uneeded veriable
  Add support for adjusting replay speed with arrow keys
  Refactor to handle responsive input
  Add pause functionality to replay
  Refactor delay_for function signature to use const struct timeval
  Set stdin to nonblock

14 months agolibmount: expose exec errors
Karel Zak [Mon, 27 May 2024 12:04:31 +0000 (14:04 +0200)] 
libmount: expose exec errors

* Introduce special exit status 126 to inform about failed execl of
  the /sbin/[u]mount.<type> helpers.

* Introduce MNT_ERR_EXEC as an API return code to inform about failed
  execl() calls.

* Add mount and umount messages for failed execl() calls.

* Add EXIT STATUS section to umount man page.

Addresses: https://github.com/util-linux/util-linux/pull/3063
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoformat: fix switch case indent
jNullj [Mon, 27 May 2024 16:21:48 +0000 (19:21 +0300)] 
format: fix switch case indent

Linux kernel coding style prefers switch and case at the same indent level.

14 months agofix clang compile
jNullj [Mon, 27 May 2024 16:18:15 +0000 (19:18 +0300)] 
fix clang compile

This commit fix clang compile issue.
Replace local char veriables with generic ch already used by the in function.
Reduce memory usage.

14 months agoMerge branch 'fix-unnecessary-remake' of https://github.com/ChenQi1989/util-linux
Karel Zak [Mon, 27 May 2024 09:51:46 +0000 (11:51 +0200)] 
Merge branch 'fix-unnecessary-remake' of https://github.com/ChenQi1989/util-linux

* 'fix-unnecessary-remake' of https://github.com/ChenQi1989/util-linux:
  libsmartcols/src/Makemodule.am: ensure filter-scanner/paser.c file is newer than the .h file

14 months agoMerge branch 'PR/cal-fix-weeknumber-colors' of github.com:karelzak/util-linux-work
Karel Zak [Mon, 27 May 2024 09:48:49 +0000 (11:48 +0200)] 
Merge branch 'PR/cal-fix-weeknumber-colors' of github.com:karelzak/util-linux-work

* 'PR/cal-fix-weeknumber-colors' of github.com:karelzak/util-linux-work:
  tests: add color schema to cal(1) tests
  cal: colorize --vertical output.
  cal: properly colorize the week number in vertical output.
  cal: fix --week use and colors

14 months agoMerge branch 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work
Karel Zak [Mon, 27 May 2024 09:48:13 +0000 (11:48 +0200)] 
Merge branch 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work

* 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work:
  libmount: (loop) detect and report lost loop nodes
  libmount: add mnt_context_sprintf_errmsg()
  libmount: add functions to use error buffer
  libmount: use regular function to save/reset syscalls status

14 months agolibsmartcols/src/Makemodule.am: ensure filter-scanner/paser.c file is newer than...
Chen Qi [Sat, 25 May 2024 03:41:35 +0000 (11:41 +0800)] 
libsmartcols/src/Makemodule.am: ensure filter-scanner/paser.c file is newer than the .h file

In released tarball, for filter-scanner/parser, the .h and the .c
file has the same mtime. The 'make' tool thinks .h is newer than
the .c file, thus deciding to remake it. This will not only cause
unnecessary rebuild, but also parallel make error. For example,
after 'make', when running 'make install', the libmount.la and findmnt
are both rebuilt and findmnt building will somethings error out complaining
'libmount.so: no such file or directory' or 'libmount.so: file format
not recognized'.

Touch the generated .c file to ensure it's newer than the .h file.
In this way, in new released tarballs in the future, there will
be no unnecessary remake.

fixes util-linux/util-linux#3061

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14 months agoreplace fgetwc with fgetc
jNullj [Fri, 24 May 2024 19:23:48 +0000 (22:23 +0300)] 
replace fgetwc with fgetc

there is no real reason to use fgetwc here as arrow key press is not read as a multi-byte by fgetwc and the logic implemented here also reads the keypress byte by bytes.

14 months agotests: add color schema to cal(1) tests
Karel Zak [Thu, 23 May 2024 11:13:34 +0000 (13:13 +0200)] 
tests: add color schema to cal(1) tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoMerge branch 'symver' of https://github.com/nekopsykose/util-linux
Karel Zak [Thu, 23 May 2024 08:53:29 +0000 (10:53 +0200)] 
Merge branch 'symver' of https://github.com/nekopsykose/util-linux

* 'symver' of https://github.com/nekopsykose/util-linux:
  pam_lastlog2: remove symbol that doesn't exist from version script

14 months agoMerge branch 'add_eupl' of https://github.com/ThijsRay/util-linux
Karel Zak [Thu, 23 May 2024 08:52:45 +0000 (10:52 +0200)] 
Merge branch 'add_eupl' of https://github.com/ThijsRay/util-linux

* 'add_eupl' of https://github.com/ThijsRay/util-linux:
  docs: add European Public License v1.2

14 months agoMerge branch 'coresched_bash_completions' of https://github.com/ThijsRay/util-linux
Karel Zak [Thu, 23 May 2024 08:52:14 +0000 (10:52 +0200)] 
Merge branch 'coresched_bash_completions' of https://github.com/ThijsRay/util-linux

* 'coresched_bash_completions' of https://github.com/ThijsRay/util-linux:
  coresched: add bash completions

14 months agoformat: fix comments and if braces format
jNullj [Wed, 22 May 2024 21:06:34 +0000 (00:06 +0300)] 
format: fix comments and if braces format

14 months agoformat: CamelCase to SnakeCase
jNullj [Wed, 22 May 2024 20:25:15 +0000 (23:25 +0300)] 
format: CamelCase to SnakeCase

14 months agolibuuid: link test_uuid_time with pthread
Thomas Weißschuh [Wed, 22 May 2024 15:10:26 +0000 (17:10 +0200)] 
libuuid: link test_uuid_time with pthread

Since commit a3f1255f1891 ("libuuid: clear uuidd cache on fork()")
compilation of gen_uuid.c requires libpthreads.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agocoresched: add bash completions
Thijs Raymakers [Wed, 22 May 2024 14:24:01 +0000 (16:24 +0200)] 
coresched: add bash completions

Signed-off-by: Thijs Raymakers <thijs@raymakers.nl>
14 months agodocs: add European Public License v1.2
Thijs Raymakers [Wed, 22 May 2024 11:38:18 +0000 (13:38 +0200)] 
docs: add European Public License v1.2

schedutils/coresched is licensed under the EUPL 1.2.

Signed-off-by: Thijs Raymakers <thijs@raymakers.nl>
14 months agopam_lastlog2: remove symbol that doesn't exist from version script
psykose [Wed, 22 May 2024 10:23:55 +0000 (10:23 +0000)] 
pam_lastlog2: remove symbol that doesn't exist from version script

otherwise ld.lld by default errors with
ld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined

since the symbol is not in the library

14 months agoMerge branch 'libuuid/coverity' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 22 May 2024 10:14:43 +0000 (12:14 +0200)] 
Merge branch 'libuuid/coverity' of https://github.com/t-8ch/util-linux

* 'libuuid/coverity' of https://github.com/t-8ch/util-linux:
  libuuid: construct UUIDv7 without "struct uuid"
  libuuid: construct UUIDv6 without "struct uuid"
  libuuid: add helper to set version and variant in uuid_t

14 months agoMerge branch 'clang-17' of https://github.com/nvinson/util-linux
Karel Zak [Wed, 22 May 2024 10:13:23 +0000 (12:13 +0200)] 
Merge branch 'clang-17' of https://github.com/nvinson/util-linux

* 'clang-17' of https://github.com/nvinson/util-linux:
  Conditionally add uuid_time64 to sym. version map

14 months agoMerge branch 'libuuid/fork' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 22 May 2024 10:12:34 +0000 (12:12 +0200)] 
Merge branch 'libuuid/fork' of https://github.com/t-8ch/util-linux

* 'libuuid/fork' of https://github.com/t-8ch/util-linux:
  libuuid: clear uuidd cache on fork()
  libuuid: split uuidd cache into dedicated struct
  libuuid: drop check for HAVE_TLS

14 months agoMerge branch 'patch-1' of https://github.com/strongtz/util-linux
Karel Zak [Wed, 22 May 2024 10:11:00 +0000 (12:11 +0200)] 
Merge branch 'patch-1' of https://github.com/strongtz/util-linux

* 'patch-1' of https://github.com/strongtz/util-linux:
  Add Qualcomm Oryon ARM core

14 months agoMerge branch 'libuuid/time-tests' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 22 May 2024 10:10:37 +0000 (12:10 +0200)] 
Merge branch 'libuuid/time-tests' of https://github.com/t-8ch/util-linux

* 'libuuid/time-tests' of https://github.com/t-8ch/util-linux:
  libuuid: test time-based UUID generation

14 months agoMerge branch 'master' of https://github.com/ffontaine/util-linux
Karel Zak [Wed, 22 May 2024 10:09:31 +0000 (12:09 +0200)] 
Merge branch 'master' of https://github.com/ffontaine/util-linux

* 'master' of https://github.com/ffontaine/util-linux:
  sys-utils/setarch.c: fix build with uclibc-ng < 1.0.39

14 months agoMerge branch 'PR/libsmartcols-fix-stages' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 22 May 2024 10:08:50 +0000 (12:08 +0200)] 
Merge branch 'PR/libsmartcols-fix-stages' of github.com:karelzak/util-linux-work

* 'PR/libsmartcols-fix-stages' of github.com:karelzak/util-linux-work:
  libsmartcols: fix reduction stages use

14 months agoMerge branch 'PR/hardlink-trees-prio' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 22 May 2024 10:08:13 +0000 (12:08 +0200)] 
Merge branch 'PR/hardlink-trees-prio' of github.com:karelzak/util-linux-work

* 'PR/hardlink-trees-prio' of github.com:karelzak/util-linux-work:
  hardlink: add --prioritize-trees

14 months agofdisk: fix typos
Karel Zak [Wed, 22 May 2024 10:02:56 +0000 (12:02 +0200)] 
fdisk: fix typos

Adresses: https://github.com/util-linux/util-linux/issues/2804
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibmount: (loop) detect and report lost loop nodes
Karel Zak [Wed, 22 May 2024 09:36:25 +0000 (11:36 +0200)] 
libmount: (loop) detect and report lost loop nodes

Fixed: https://github.com/util-linux/util-linux/issues/2605
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibmount: add mnt_context_sprintf_errmsg()
Karel Zak [Wed, 22 May 2024 09:32:55 +0000 (11:32 +0200)] 
libmount: add mnt_context_sprintf_errmsg()

Let's make it easy to create error message and return the message to
applications also when not generated by a syscall (kernel).

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibmount: add functions to use error buffer
Karel Zak [Wed, 22 May 2024 08:52:04 +0000 (10:52 +0200)] 
libmount: add functions to use error buffer

* Add mnt_context_set_errmsg() and mnt_context_append_errmsg() functions.
* Replace custom code with mnt_context_syscall_save_status() function.
* Optionally use syscall name when generating error message.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibuuid: construct UUIDv7 without "struct uuid"
Thomas Weißschuh [Tue, 21 May 2024 16:44:19 +0000 (18:44 +0200)] 
libuuid: construct UUIDv7 without "struct uuid"

The layout of "struct uuid" is specific to UUIDv1.
Using it for UUIDv7 makes the logic complicated and confuses Coverity.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibuuid: construct UUIDv6 without "struct uuid"
Thomas Weißschuh [Tue, 21 May 2024 16:43:36 +0000 (18:43 +0200)] 
libuuid: construct UUIDv6 without "struct uuid"

The layout of "struct uuid" is specific to UUIDv1.
Using it for UUIDv6 makes the logic complicated and confuses Coverity.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibuuid: add helper to set version and variant in uuid_t
Thomas Weißschuh [Tue, 21 May 2024 16:41:59 +0000 (18:41 +0200)] 
libuuid: add helper to set version and variant in uuid_t

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibmount: use regular function to save/reset syscalls status
Karel Zak [Tue, 21 May 2024 10:44:11 +0000 (12:44 +0200)] 
libmount: use regular function to save/reset syscalls status

This commit is just cleanup to keep internal API consistent.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoAdd Qualcomm Oryon ARM core
Sophon [Tue, 21 May 2024 07:42:17 +0000 (15:42 +0800)] 
Add Qualcomm Oryon ARM core

Adding core information for Oryon found in Qualcomm Snapdragon X series SoCs

14 months agocal: colorize --vertical output.
Karel Zak [Tue, 21 May 2024 07:29:08 +0000 (09:29 +0200)] 
cal: colorize --vertical output.

Let's use the same colors as we currently use for regular output.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agocal: properly colorize the week number in vertical output.
Karel Zak [Mon, 20 May 2024 13:54:37 +0000 (15:54 +0200)] 
cal: properly colorize the week number in vertical output.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agocal: fix --week use and colors
Karel Zak [Mon, 20 May 2024 13:07:24 +0000 (15:07 +0200)] 
cal: fix --week use and colors

* don't overwrite --week=<number> by the current date, default only
  to the current year, if the year is not specified

* introduce "weeks" color sequence to colorize all week numbers.

Note that the man page suggests using "weeknumber" to colorize all
week numbers, but the code only uses this sequence for the week
requested by the --week option. This commit maintains backward
compatibility, although it would be better to use "weeknumber" for all
week numbers and "weekwanted" for the desired week.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoRefactor convoluted switch case into if else
jNullj [Sat, 18 May 2024 15:18:57 +0000 (18:18 +0300)] 
Refactor convoluted switch case into if else

14 months agolibuuid: test time-based UUID generation
Thomas Weißschuh [Thu, 16 May 2024 17:05:01 +0000 (19:05 +0200)] 
libuuid: test time-based UUID generation

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agoConditionally add uuid_time64 to sym. version map
Nicholas Vinson [Wed, 15 May 2024 15:14:54 +0000 (11:14 -0400)] 
Conditionally add uuid_time64 to sym. version map

The symbol uuid_time64 is conditionally defined. It only exists on
32-bit platforms that use the glibc library and enable support for
the 64-bit time_t type.

For all other platforms, the symbol is undefined. As a result, when
ld.lld version 17 or newer is used with default flags, ld.lld will
reject the symbol map with the error:

    version script assignment of 'UUID_2.40' to symbol 'uuid_time64'
    failed: symbol not defined

To fix this issue, the reference to uuid_time64 is changed to
uuid_time64*. The change to a glob pattern satisifies ld.lld and allows
the library to link.

fixes util-linux/util-linux#3036
fixes Gentoo bug #931328

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
14 months agosys-utils/setarch.c: fix build with uclibc-ng < 1.0.39
Fabrice Fontaine [Wed, 15 May 2024 16:22:11 +0000 (18:22 +0200)] 
sys-utils/setarch.c: fix build with uclibc-ng < 1.0.39

Fix the following build failure with uclibc-ng < 1.0.39 (i.e., without
https://github.com/wbx-github/uclibc-ng/commit/85ac4f04d94e98389a8315e720630d0f95bfdfd6)
raised since version 2.39 and
https://github.com/util-linux/util-linux/commit/03a254f010b08da1175f50a8ae7882e59228f1b4:

sys-utils/setarch.c:106:7: error: 'PER_LINUX32_3GB' undeclared here (not in a function); did you mean 'PER_LINUX32'?
  106 |     X(PER_LINUX32_3GB) \
      |       ^~~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/fb1feb47f2660882fa53f66bacc63e191fd52175

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
14 months agolibsmartcols: fix reduction stages use
Karel Zak [Wed, 15 May 2024 13:45:19 +0000 (15:45 +0200)] 
libsmartcols: fix reduction stages use

There is no proper check for the number of reduction stages, so in
some cases, the code can loop indefinitely.

The patch also fixes 'rc' variable shadowing.

Fixes: https://github.com/util-linux/util-linux/issues/3046
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agohardlink: add --prioritize-trees
Karel Zak [Wed, 15 May 2024 13:25:35 +0000 (15:25 +0200)] 
hardlink: add --prioritize-trees

Based on patch from discussion at https://github.com/util-linux/util-linux/issues/3016

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibblkid: make example more robust
Karel Zak [Wed, 15 May 2024 11:24:29 +0000 (13:24 +0200)] 
libblkid: make example more robust

Fixes: https://github.com/util-linux/util-linux/issues/3043
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoMerge branch 'PR/libmount-fix-atime-remount' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 15 May 2024 11:12:00 +0000 (13:12 +0200)] 
Merge branch 'PR/libmount-fix-atime-remount' of github.com:karelzak/util-linux-work

* 'PR/libmount-fix-atime-remount' of github.com:karelzak/util-linux-work:
  libmount: Fix atime remount for new API

14 months agoMerge branch 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 15 May 2024 11:11:11 +0000 (13:11 +0200)] 
Merge branch 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linux

* 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linux:
  libuuid: fix v6 generation

14 months agolibuuid: drop duplicate assignment liuuid_la_LDFLAGS
Karel Zak [Wed, 15 May 2024 11:07:56 +0000 (13:07 +0200)] 
libuuid: drop duplicate assignment liuuid_la_LDFLAGS

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibuuid: fix v6 generation
Thomas Weißschuh [Wed, 15 May 2024 06:42:42 +0000 (06:42 +0000)] 
libuuid: fix v6 generation

get_clock_counter() does not return a gregorian timestamp as required
for v6.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agopam_lastlog2: drop duplicate assignment pam_lastlog2_la_LDFLAGS
Thomas Weißschuh [Tue, 14 May 2024 19:38:52 +0000 (21:38 +0200)] 
pam_lastlog2: drop duplicate assignment pam_lastlog2_la_LDFLAGS

The second assignment ends up on the linker/libtool commandline,
potentially confusing the tools.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibuuid: clear uuidd cache on fork()
Thomas Weißschuh [Tue, 7 May 2024 11:44:31 +0000 (13:44 +0200)] 
libuuid: clear uuidd cache on fork()

After fork() the memory of the calling thread is preserved into the new
process. This also includes TLS.
Make sure to reset the cache after a fork to avoid reuse of cached
values.

Only the TLS of the thread calling fork() is relevant as that is the
only thread that gets forked.
New threads will received newly initialized TLS.

Fixes https://github.com/util-linux/util-linux/issues/3009
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibuuid: split uuidd cache into dedicated struct
Thomas Weißschuh [Tue, 7 May 2024 11:33:40 +0000 (13:33 +0200)] 
libuuid: split uuidd cache into dedicated struct

To clear the struct we need to be able to refer to it by name.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibuuid: drop check for HAVE_TLS
Thomas Weißschuh [Tue, 7 May 2024 11:28:41 +0000 (13:28 +0200)] 
libuuid: drop check for HAVE_TLS

In the function get_clock() TLS is used unconditionally anyways.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibmount: Fix atime remount for new API
Karel Zak [Tue, 14 May 2024 09:58:20 +0000 (11:58 +0200)] 
libmount: Fix atime remount for new API

All atime settings are mutually exclusive, and the attr_set mask for
the mount_setattr() syscall cannot contain multiple MOUNT_ATTR_ atime
related options.

Unfortunately, during a remount, the list of options is composed of
both old and new options. In this case, libmount sets more atime
options to the mask. The correct behavior is to use the last atime
related option from the list.

Fixes: https://github.com/util-linux/util-linux/issues/3032
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoMerge branch 'uuidv7' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 14 May 2024 08:01:47 +0000 (10:01 +0200)] 
Merge branch 'uuidv7' of https://github.com/t-8ch/util-linux

* 'uuidv7' of https://github.com/t-8ch/util-linux:
  uuidgen: add support for RFC9562 UUIDs
  uuidparse: add support for RFC9562 UUIDs
  libuuid: add support for RFC9562 UUIDs

14 months agoMerge branch 'pidfd-enosys' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 14 May 2024 07:53:59 +0000 (09:53 +0200)] 
Merge branch 'pidfd-enosys' of https://github.com/t-8ch/util-linux

* 'pidfd-enosys' of https://github.com/t-8ch/util-linux:
  include/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing

14 months agoMerge branch 'lsfd--use-new-ul_path-functions' of https://github.com/masatake/util...
Karel Zak [Tue, 14 May 2024 07:52:01 +0000 (09:52 +0200)] 
Merge branch 'lsfd--use-new-ul_path-functions' of https://github.com/masatake/util-linux

* 'lsfd--use-new-ul_path-functions' of https://github.com/masatake/util-linux:
  lsfd: (refactor) use ul_path_statf and ul_path_readlinkf

14 months agowipefs: fix typo
Karel Zak [Tue, 14 May 2024 07:45:00 +0000 (09:45 +0200)] 
wipefs: fix typo

Fixes: https://github.com/util-linux/util-linux/issues/3027
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoinclude/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing
Thomas Weißschuh [Mon, 13 May 2024 18:21:24 +0000 (20:21 +0200)] 
include/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing

This allows code which can gracefully fall back to compile.

This should fix the CI on Ubuntu 18.04.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolib/path: use _vreadf_buffer for _cpuparse()
Thomas Weißschuh [Mon, 13 May 2024 08:46:39 +0000 (10:46 +0200)] 
lib/path: use _vreadf_buffer for _cpuparse()

ul_path_vreadf_buffer already provides zero-termination and newline
trimming, so make use of it.

We now could read more than a single line, but the files this is used on
contain only a single line anyways.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolib/path: introduce ul_path_vreadf_buffer
Thomas Weißschuh [Mon, 13 May 2024 19:01:16 +0000 (21:01 +0200)] 
lib/path: introduce ul_path_vreadf_buffer

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolsfd: (refactor) use ul_path_statf and ul_path_readlinkf
Masatake YAMATO [Mon, 13 May 2024 16:43:42 +0000 (01:43 +0900)] 
lsfd: (refactor) use ul_path_statf and ul_path_readlinkf

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agolib/path: use _read_buffer for _read_string()
Thomas Weißschuh [Mon, 13 May 2024 08:46:31 +0000 (10:46 +0200)] 
lib/path: use _read_buffer for _read_string()

ul_path_read_buffer already provides zero-termination and newline
trimming, so make use of it.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>