]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 months agoautotools: add missing dist_noinst_DATA
Karel Zak [Thu, 4 Jan 2024 10:54:23 +0000 (11:54 +0100)] 
autotools: add missing dist_noinst_DATA

Addresses: https://github.com/util-linux/util-linux/pull/2668
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoMerge branch 'patch-15' of https://github.com/mariobl/util-linux
Karel Zak [Thu, 4 Jan 2024 10:53:27 +0000 (11:53 +0100)] 
Merge branch 'patch-15' of https://github.com/mariobl/util-linux

* 'patch-15' of https://github.com/mariobl/util-linux:
  man: Add enosys and lsclocks to po4a.cfg

4 months agoMerge branch 'patch-14' of https://github.com/mariobl/util-linux
Karel Zak [Thu, 4 Jan 2024 10:52:08 +0000 (11:52 +0100)] 
Merge branch 'patch-14' of https://github.com/mariobl/util-linux

* 'patch-14' of https://github.com/mariobl/util-linux:
  lsclocks: Fix markup in man page

4 months agoMerge branch 'wipefs/improvements' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 4 Jan 2024 10:51:40 +0000 (11:51 +0100)] 
Merge branch 'wipefs/improvements' of https://github.com/t-8ch/util-linux

* 'wipefs/improvements' of https://github.com/t-8ch/util-linux:
  wipefs: allow storage of backups in specific location
  wipefs: (tests) remove necessity of root permissions

4 months agoMerge branch 'PR/dmesg-timestamps' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 4 Jan 2024 10:50:19 +0000 (11:50 +0100)] 
Merge branch 'PR/dmesg-timestamps' of github.com:karelzak/util-linux-work

* 'PR/dmesg-timestamps' of github.com:karelzak/util-linux-work:
  Dividing tests into subtest based on recommendation from review
  util-linux/sys-utils test dmesg support for additional human-readable timestamp
  dmesg: man and coding style changes
  dmesg: support for additional human readable timestamp

4 months agologger: make sure path is terminated [coverity scan]
Karel Zak [Wed, 3 Jan 2024 08:34:31 +0000 (09:34 +0100)] 
logger: make sure path is terminated [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoman: Add enosys and lsclocks to po4a.cfg
Mario Blättermann [Tue, 2 Jan 2024 17:42:40 +0000 (18:42 +0100)] 
man: Add enosys and lsclocks to po4a.cfg

4 months agolsclocks: Fix markup in man page
Mario Blättermann [Tue, 2 Jan 2024 16:39:30 +0000 (17:39 +0100)] 
lsclocks: Fix markup in man page

4 months agowipefs: allow storage of backups in specific location
Thomas Weißschuh [Sun, 31 Dec 2023 13:10:01 +0000 (14:10 +0100)] 
wipefs: allow storage of backups in specific location

This also avoids cluttering the home directory during test execution.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agowipefs: (tests) remove necessity of root permissions
Thomas Weißschuh [Sun, 31 Dec 2023 13:00:18 +0000 (14:00 +0100)] 
wipefs: (tests) remove necessity of root permissions

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agoMerge branch 'fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 2 Jan 2024 10:15:57 +0000 (11:15 +0100)] 
Merge branch 'fixes' of https://github.com/t-8ch/util-linux

* 'fixes' of https://github.com/t-8ch/util-linux:
  libmount: (context) avoid dead store
  libmount: (utils) avoid dead store
  pipesz: avoid dead store
  fileeq: optimize size of ul_fileeq_method
  sha1: properly wipe variables
  libfdisk: (sgi): use strncpy over strcpy
  libfdisk: (sun) properly initialize partition data
  libmount: (tests) fix --filesystems crash on invalid argument
  libmount: (tests) fix --filesystems test argument parsing
  libmount: (veritydev) use asprintf to build string
  libsmartcols: (samples/fromfile) properly handle return value from getline()
  libuuid: (test_uuid) make reading UUIDs from file more robust
  libblkid: (dev) use strdup to duplicate string
  pg: use snprintf to build string
  hexdump: use xasprintf to build string
  readprofile: use xasprintf to build string
  cal: avoid out of bound write
  logger: use strncpy instead of strcpy
  exec_shell: use xasprintf
  strv: make strv_new_api static

4 months agolibblkid: (bcachefs) add support for superblock at end of disk
Thomas Weißschuh [Sat, 30 Dec 2023 23:32:46 +0000 (00:32 +0100)] 
libblkid: (bcachefs) add support for superblock at end of disk

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibblkid: (bcachefs) add support for 2nd superblock at 2MiB
Thomas Weißschuh [Sat, 30 Dec 2023 23:06:36 +0000 (00:06 +0100)] 
libblkid: (bcachefs) add support for 2nd superblock at 2MiB

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agowipefs: (tests) add test for all detected signatures
Thomas Weißschuh [Sun, 31 Dec 2023 12:32:56 +0000 (13:32 +0100)] 
wipefs: (tests) add test for all detected signatures

This is useful to validate that multiple signatures were detected.
Use it for bcachefs, as that prober will gain support for backup
superblocks.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibblkid: (bcachefs) compare against offset from idmag
Thomas Weißschuh [Sat, 30 Dec 2023 22:58:23 +0000 (23:58 +0100)] 
libblkid: (bcachefs) compare against offset from idmag

A future patch will introduce more superblock locations which need to
use their matching superblock location.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibblkid: introduce helper to get offset for idmag
Thomas Weißschuh [Sat, 30 Dec 2023 23:26:22 +0000 (00:26 +0100)] 
libblkid: introduce helper to get offset for idmag

As idmag->kboff can be negative to refer to an offset from the end of
the device, introduce a helper so probers don't have to worry about this
detail.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibmount: (context) avoid dead store
Thomas Weißschuh [Sun, 24 Dec 2023 11:44:35 +0000 (12:44 +0100)] 
libmount: (context) avoid dead store

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibmount: (utils) avoid dead store
Thomas Weißschuh [Sun, 24 Dec 2023 12:08:15 +0000 (13:08 +0100)] 
libmount: (utils) avoid dead store

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agopipesz: avoid dead store
Thomas Weißschuh [Sun, 24 Dec 2023 13:12:46 +0000 (14:12 +0100)] 
pipesz: avoid dead store

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agofileeq: optimize size of ul_fileeq_method
Thomas Weißschuh [Sun, 24 Dec 2023 13:04:42 +0000 (14:04 +0100)] 
fileeq: optimize size of ul_fileeq_method

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agosha1: properly wipe variables
Thomas Weißschuh [Sun, 24 Dec 2023 12:50:40 +0000 (13:50 +0100)] 
sha1: properly wipe variables

Dead stores may very well be optimized away.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibfdisk: (sgi): use strncpy over strcpy
Thomas Weißschuh [Sun, 24 Dec 2023 12:45:38 +0000 (13:45 +0100)] 
libfdisk: (sgi): use strncpy over strcpy

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibfdisk: (sun) properly initialize partition data
Thomas Weißschuh [Sun, 24 Dec 2023 12:32:56 +0000 (13:32 +0100)] 
libfdisk: (sun) properly initialize partition data

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibmount: (tests) fix --filesystems crash on invalid argument
Thomas Weißschuh [Sun, 24 Dec 2023 12:05:20 +0000 (13:05 +0100)] 
libmount: (tests) fix --filesystems crash on invalid argument

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibmount: (tests) fix --filesystems test argument parsing
Thomas Weißschuh [Sun, 24 Dec 2023 12:04:59 +0000 (13:04 +0100)] 
libmount: (tests) fix --filesystems test argument parsing

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibmount: (veritydev) use asprintf to build string
Thomas Weißschuh [Sun, 24 Dec 2023 11:50:02 +0000 (12:50 +0100)] 
libmount: (veritydev) use asprintf to build string

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibsmartcols: (samples/fromfile) properly handle return value from getline()
Thomas Weißschuh [Sun, 24 Dec 2023 11:38:53 +0000 (12:38 +0100)] 
libsmartcols: (samples/fromfile) properly handle return value from getline()

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibuuid: (test_uuid) make reading UUIDs from file more robust
Thomas Weißschuh [Sun, 24 Dec 2023 11:35:25 +0000 (12:35 +0100)] 
libuuid: (test_uuid) make reading UUIDs from file more robust

Instead of relying on fixed width entries, read line-by-line.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agolibblkid: (dev) use strdup to duplicate string
Thomas Weißschuh [Sun, 24 Dec 2023 11:35:18 +0000 (12:35 +0100)] 
libblkid: (dev) use strdup to duplicate string

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agopg: use snprintf to build string
Thomas Weißschuh [Tue, 26 Dec 2023 10:33:17 +0000 (11:33 +0100)] 
pg: use snprintf to build string

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agohexdump: use xasprintf to build string
Thomas Weißschuh [Tue, 26 Dec 2023 10:21:10 +0000 (11:21 +0100)] 
hexdump: use xasprintf to build string

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agoreadprofile: use xasprintf to build string
Thomas Weißschuh [Tue, 26 Dec 2023 10:20:03 +0000 (11:20 +0100)] 
readprofile: use xasprintf to build string

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agocal: avoid out of bound write
Thomas Weißschuh [Tue, 26 Dec 2023 10:18:00 +0000 (11:18 +0100)] 
cal: avoid out of bound write

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agologger: use strncpy instead of strcpy
Thomas Weißschuh [Sun, 24 Dec 2023 13:12:52 +0000 (14:12 +0100)] 
logger: use strncpy instead of strcpy

This is not strictly necessary but better style.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agoexec_shell: use xasprintf
Thomas Weißschuh [Sun, 24 Dec 2023 11:00:53 +0000 (12:00 +0100)] 
exec_shell: use xasprintf

It removes an unbounded strcpy and makes the code shorter and clearer.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agostrv: make strv_new_api static
Thomas Weißschuh [Sun, 24 Dec 2023 11:00:58 +0000 (12:00 +0100)] 
strv: make strv_new_api static

It is never used outside of strv.c.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agoMerge branch 'wdctl/timeout-condition' of https://github.com/t-8ch/util-linux
Karel Zak [Sun, 31 Dec 2023 10:24:27 +0000 (11:24 +0100)] 
Merge branch 'wdctl/timeout-condition' of https://github.com/t-8ch/util-linux

* 'wdctl/timeout-condition' of https://github.com/t-8ch/util-linux:
  wdctl: properyl test timeout conditions

4 months agoMerge branch 'patch-12' of https://github.com/mariobl/util-linux
Karel Zak [Sun, 31 Dec 2023 10:23:39 +0000 (11:23 +0100)] 
Merge branch 'patch-12' of https://github.com/mariobl/util-linux

* 'patch-12' of https://github.com/mariobl/util-linux:
  Update po4a.cfg to assign exch.1 correctly to misc-utils
  exch: Add man page to po4a.cfg to make it translatable

4 months agoMerge branch 'fallocate/warning' of https://github.com/t-8ch/util-linux
Karel Zak [Sun, 31 Dec 2023 10:00:23 +0000 (11:00 +0100)] 
Merge branch 'fallocate/warning' of https://github.com/t-8ch/util-linux

* 'fallocate/warning' of https://github.com/t-8ch/util-linux:
  fdisk: guard posix variable

4 months agoexch: use NULL rather than zero
Karel Zak [Sun, 31 Dec 2023 09:58:32 +0000 (10:58 +0100)] 
exch: use NULL rather than zero

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoMerge branch 'exch/options' of https://github.com/t-8ch/util-linux
Karel Zak [Sun, 31 Dec 2023 09:57:28 +0000 (10:57 +0100)] 
Merge branch 'exch/options' of https://github.com/t-8ch/util-linux

* 'exch/options' of https://github.com/t-8ch/util-linux:
  build-sys: fail build for untracked files
  gitignore: ignore exch
  exch: properly terminate options array

4 months agoMerge branch 'logger-wrong-typo' of https://github.com/chentooerl/util-linux
Karel Zak [Sun, 31 Dec 2023 09:55:16 +0000 (10:55 +0100)] 
Merge branch 'logger-wrong-typo' of https://github.com/chentooerl/util-linux

* 'logger-wrong-typo' of https://github.com/chentooerl/util-linux:
  Fix typo: octen -> octet

4 months agowdctl: properyl test timeout conditions
Thomas Weißschuh [Thu, 28 Dec 2023 19:44:34 +0000 (20:44 +0100)] 
wdctl: properyl test timeout conditions

Fixes #2660

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoUpdate po4a.cfg to assign exch.1 correctly to misc-utils
Mario Blättermann [Tue, 26 Dec 2023 14:45:29 +0000 (15:45 +0100)] 
Update po4a.cfg to assign exch.1 correctly to misc-utils

5 months agoexch: Add man page to po4a.cfg to make it translatable
Mario Blättermann [Tue, 26 Dec 2023 14:37:04 +0000 (15:37 +0100)] 
exch: Add man page to po4a.cfg to make it translatable

5 months agofdisk: guard posix variable
Thomas Weißschuh [Sun, 24 Dec 2023 10:47:02 +0000 (11:47 +0100)] 
fdisk: guard posix variable

Otherwise it can generate a unused variable warning.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoDividing tests into subtest based on recommendation from review
Rishabh Thukral [Sun, 24 Dec 2023 02:44:22 +0000 (18:44 -0800)] 
Dividing tests into subtest based on recommendation from review

Signed-off-by: Rishabh Thukral <rthukral@arista.com>
5 months agoutil-linux/sys-utils test dmesg support for additional human-readable timestamp
Rishabh Thukral [Sat, 23 Dec 2023 23:13:36 +0000 (15:13 -0800)] 
util-linux/sys-utils test dmesg support for additional human-readable timestamp

This commit adds tests for new functionality in dmesg to support multiple timestamp formats.
The user can specify multiple timestamp formats with --time-format option and dmesg prints all the logs with desired timestamp formats in the sequence of user-provided formats.

This test verifies that output contains multiple formats in the sequence of input and it also tests for the special case where the user specifies delta format along with either ctime or raw.

Signed-off-by: Rishabh Thukral <rthukral@arista.com>
5 months agobuild-sys: fail build for untracked files
Thomas Weißschuh [Fri, 22 Dec 2023 22:31:39 +0000 (23:31 +0100)] 
build-sys: fail build for untracked files

All build artifacts should be covered by a gitignore entry.
Validate that at build-time.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agogitignore: ignore exch
Thomas Weißschuh [Fri, 22 Dec 2023 22:20:32 +0000 (23:20 +0100)] 
gitignore: ignore exch

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoexch: properly terminate options array
Thomas Weißschuh [Fri, 22 Dec 2023 10:41:37 +0000 (11:41 +0100)] 
exch: properly terminate options array

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoFix typo: octen -> octet
zeyun chen [Thu, 21 Dec 2023 02:31:20 +0000 (10:31 +0800)] 
Fix typo: octen -> octet

5 months agolsclocks: refer to correct lsclocks(1) manpage
Thomas Weißschuh [Tue, 19 Dec 2023 21:11:09 +0000 (22:11 +0100)] 
lsclocks: refer to correct lsclocks(1) manpage

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoexch: fix typo
Karel Zak [Thu, 14 Dec 2023 10:44:14 +0000 (11:44 +0100)] 
exch: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agodocs: move Copyright in boilerplate.c
Karel Zak [Thu, 14 Dec 2023 09:12:46 +0000 (10:12 +0100)] 
docs: move Copyright in boilerplate.c

Let's keep it in order

SPDX-License-Identifier
License block
Copyright
command description

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agobuild-sys: add --disable-exch
Karel Zak [Thu, 14 Dec 2023 09:11:47 +0000 (10:11 +0100)] 
build-sys: add --disable-exch

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoexch: cosmetic changes
Karel Zak [Thu, 14 Dec 2023 09:06:06 +0000 (10:06 +0100)] 
exch: cosmetic changes

* use the same license header as in other utuls
* make sure SYS_renamea2 defined
* small change to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoexch: new command exchaging two files atomically
Masatake YAMATO [Wed, 6 Dec 2023 15:17:26 +0000 (00:17 +0900)] 
exch: new command exchaging two files atomically

An example session:

$ echo A > a
$ echo B > b
$ ./exch a b
$ cat a
B
$ cat b
A

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agoMerge branch 'fix-getsz-verbose-output' of https://github.com/calestyo/util-linux
Karel Zak [Thu, 14 Dec 2023 08:45:05 +0000 (09:45 +0100)] 
Merge branch 'fix-getsz-verbose-output' of https://github.com/calestyo/util-linux

* 'fix-getsz-verbose-output' of https://github.com/calestyo/util-linux:
  blockdev: add missing verbose output for --getsz

5 months agolibsmartcols: fix typo in comment
Karel Zak [Thu, 14 Dec 2023 08:44:40 +0000 (09:44 +0100)] 
libsmartcols: fix typo in comment

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'PR/libsmartcols-cell-data' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 14 Dec 2023 08:43:54 +0000 (09:43 +0100)] 
Merge branch 'PR/libsmartcols-cell-data' of github.com:karelzak/util-linux-work

* 'PR/libsmartcols-cell-data' of github.com:karelzak/util-linux-work:
  libsmartcols: fix memory leak on filter parser error
  libsmartcols: free after error in filter sample
  libsmartcols: make cell data printing more robust

5 months agogitignore: ignore setpgid binary
Christian Göttsche [Wed, 13 Dec 2023 15:53:16 +0000 (16:53 +0100)] 
gitignore: ignore setpgid binary

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
5 months agolibsmartcols: fix memory leak on filter parser error
Karel Zak [Wed, 13 Dec 2023 10:09:41 +0000 (11:09 +0100)] 
libsmartcols: fix memory leak on filter parser error

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agolibsmartcols: free after error in filter sample
Karel Zak [Tue, 12 Dec 2023 19:38:34 +0000 (20:38 +0100)] 
libsmartcols: free after error in filter sample

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agolibsmartcols: make cell data printing more robust
Karel Zak [Tue, 12 Dec 2023 19:11:22 +0000 (20:11 +0100)] 
libsmartcols: make cell data printing more robust

* use zero terminated data in continuous sample

* don't call strlen() for empty strings

* make sure library check for data size during printing

  Unfortunately, previous library versions support cell data buffer
  update without inform library about a change.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agolibsmartcols: (tests) add test for continuous json output
Thomas Weißschuh [Tue, 12 Dec 2023 18:40:31 +0000 (19:40 +0100)] 
libsmartcols: (tests) add test for continuous json output

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agolibsmartcols: only recognize closed object as final element
Thomas Weißschuh [Tue, 12 Dec 2023 17:42:44 +0000 (18:42 +0100)] 
libsmartcols: only recognize closed object as final element

When streaming JSON normal values also have indent == 1.
For those however it is incorrect to close the stream.

Fixes #2644
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agolibsmartcols: flush correct stream
Thomas Weißschuh [Tue, 12 Dec 2023 17:42:11 +0000 (18:42 +0100)] 
libsmartcols: flush correct stream

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agolibsmartcols: drop spourious newline in between streamed JSON objects
Thomas Weißschuh [Tue, 12 Dec 2023 17:41:33 +0000 (18:41 +0100)] 
libsmartcols: drop spourious newline in between streamed JSON objects

scols_table_print_range() already appends a newline correctly.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoblockdev: add missing verbose output for --getsz
Christoph Anton Mitterer [Tue, 12 Dec 2023 16:23:09 +0000 (17:23 +0100)] 
blockdev: add missing verbose output for --getsz

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
5 months agodmesg: man and coding style changes
Karel Zak [Tue, 12 Dec 2023 10:40:01 +0000 (11:40 +0100)] 
dmesg: man and coding style changes

* add note about delta time to the man page
* make the latest changes to the code less talkative

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agodmesg: support for additional human readable timestamp
Rishabh Thukral [Tue, 5 Dec 2023 19:53:33 +0000 (11:53 -0800)] 
dmesg: support for additional human readable timestamp

The dmesg logs have timestamps in seconds since boot format which can
be converted to other formats. However, there is no option to include
both the original timestamp as present in the buffer along with the
converted timestamp in the specified format.

This change updates the --time-format option in dmesg to enable the
user to specify it multiple times with different formats with each
input providing a timestamp format among the currently supported
choices. This enables seeing the dmesg logs in both seconds since boot
and human readable format simultaneously in each row of the log output.
The sequence of timestamp format follows the order
in which the user provides the desired formats.

Signed-off-by: Rishabh Thukral <rthukral@arista.com>
5 months agoMerge branch 'dmesg/kmsg-file' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 12 Dec 2023 09:22:25 +0000 (10:22 +0100)] 
Merge branch 'dmesg/kmsg-file' of https://github.com/t-8ch/util-linux

* 'dmesg/kmsg-file' of https://github.com/t-8ch/util-linux:
  dmesg: support reading kmsg format from file

5 months agoMerge branch 'dmesg/tests' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 12 Dec 2023 09:21:19 +0000 (10:21 +0100)] 
Merge branch 'dmesg/tests' of https://github.com/t-8ch/util-linux

* 'dmesg/tests' of https://github.com/t-8ch/util-linux:
  dmesg: use symbolic defines for second conversions
  dmesg: add support for reserved and local facilities
  dmesg: (tests) validate json output
  dmesg: only write one message to json
  jsonwrt: add ul_jsonwrt_value_s_sized
  dmesg: open-code LOG_MAKEPRI
  dmesg: correctly print all supported facility names
  dmesg: error out instead of silently ignoring force_prefix

5 months agodmesg: support reading kmsg format from file
Thomas Weißschuh [Mon, 11 Dec 2023 20:38:43 +0000 (21:38 +0100)] 
dmesg: support reading kmsg format from file

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agosetpriv: add landlock support
Thomas Weißschuh [Wed, 6 Dec 2023 17:39:51 +0000 (18:39 +0100)] 
setpriv: add landlock support

landlock [0] is a Linux stackable LSM that can be used by unprivileged
processes to build a sandbox around them.

With support for landlock in setpriv users can easily construct a
sandbox on-the-fly when executing programs.

[0] https://landlock.io/

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agosys-utils: cleanup license lines, add SPDX
Karel Zak [Mon, 11 Dec 2023 12:37:41 +0000 (13:37 +0100)] 
sys-utils: cleanup license lines, add SPDX

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agodmesg: use symbolic defines for second conversions
Thomas Weißschuh [Sun, 10 Dec 2023 08:58:27 +0000 (09:58 +0100)] 
dmesg: use symbolic defines for second conversions

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agodmesg: add support for reserved and local facilities
Thomas Weißschuh [Fri, 8 Dec 2023 17:10:55 +0000 (18:10 +0100)] 
dmesg: add support for reserved and local facilities

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agodmesg: (tests) validate json output
Thomas Weißschuh [Fri, 8 Dec 2023 17:10:53 +0000 (18:10 +0100)] 
dmesg: (tests) validate json output

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agodmesg: only write one message to json
Thomas Weißschuh [Fri, 8 Dec 2023 17:10:50 +0000 (18:10 +0100)] 
dmesg: only write one message to json

Before we would add all of the message buffer.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agojsonwrt: add ul_jsonwrt_value_s_sized
Thomas Weißschuh [Fri, 8 Dec 2023 17:10:47 +0000 (18:10 +0100)] 
jsonwrt: add ul_jsonwrt_value_s_sized

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agodmesg: open-code LOG_MAKEPRI
Thomas Weißschuh [Fri, 8 Dec 2023 17:10:44 +0000 (18:10 +0100)] 
dmesg: open-code LOG_MAKEPRI

LOG_MAKEPRI between musl and glibc differ in their behavior.

musl performs the '<< 3' as part of the macro while glibc expects the
caller to do so.
Just provide our own implementation to avoid the issue.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agodmesg: correctly print all supported facility names
Thomas Weißschuh [Fri, 8 Dec 2023 17:10:42 +0000 (18:10 +0100)] 
dmesg: correctly print all supported facility names

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agodmesg: error out instead of silently ignoring force_prefix
Thomas Weißschuh [Fri, 8 Dec 2023 17:10:34 +0000 (18:10 +0100)] 
dmesg: error out instead of silently ignoring force_prefix

When using the option with one of the input mechanisms the user has to
look at the source to figure out why nothing is happening.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoMerge branch 'uuid-time64_t' of https://github.com/thkukuk/util-linux
Karel Zak [Mon, 11 Dec 2023 09:57:27 +0000 (10:57 +0100)] 
Merge branch 'uuid-time64_t' of https://github.com/thkukuk/util-linux

* 'uuid-time64_t' of https://github.com/thkukuk/util-linux:
  libuuid: Add uuid_time64 for 64bit time_t on 32bit

5 months agoMerge branch 'master' of https://github.com/goldwynr/util-linux
Karel Zak [Mon, 11 Dec 2023 09:52:47 +0000 (10:52 +0100)] 
Merge branch 'master' of https://github.com/goldwynr/util-linux

* 'master' of https://github.com/goldwynr/util-linux:
  more: exit if POLLERR and POLLHUP on stdin is received

5 months agoMerge branch 'fix-bash-completion-rules' of https://github.com/masatake/util-linux
Karel Zak [Mon, 11 Dec 2023 09:52:11 +0000 (10:52 +0100)] 
Merge branch 'fix-bash-completion-rules' of https://github.com/masatake/util-linux

* 'fix-bash-completion-rules' of https://github.com/masatake/util-linux:
  bash-completion: (lslocks): add --bytes option to the rules
  bash-completion: (fadvise): fix a typo

5 months agobash-completion: (lslocks): add --bytes option to the rules
Masatake YAMATO [Fri, 8 Dec 2023 17:33:40 +0000 (02:33 +0900)] 
bash-completion: (lslocks): add --bytes option to the rules

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agobash-completion: (fadvise): fix a typo
Masatake YAMATO [Fri, 8 Dec 2023 17:33:14 +0000 (02:33 +0900)] 
bash-completion: (fadvise): fix a typo

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agofdisk: add support for partition resizing
Thomas Weißschuh [Sun, 19 Nov 2023 16:20:55 +0000 (17:20 +0100)] 
fdisk: add support for partition resizing

Fixes #2555
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agomore: exit if POLLERR and POLLHUP on stdin is received
Goldwyn Rodrigues [Fri, 8 Dec 2023 15:04:39 +0000 (09:04 -0600)] 
more: exit if POLLERR and POLLHUP on stdin is received

more command continues to run in case stdin have closed the file and it
takes 100% of CPU. This is because revents on stdin send
POLLIN | POLLHUP | POLLERR once stdin is closed. more receives it even
though it is not requested in events. This is common Linux behaviour to
never mask out POLLHUP or POLLERR. The loop in more_key_command() runs
infinitely because more_poll() returns 0 and read_command() reads 0
bytes.

Check for POLLERR and POLLHUP, and exit more in case of an error.

Steps to reproduce:
1. Setup /etc/systemd/logind.conf with KillUserProcesses=no
2. Add config "Defaults use_pty" in /etc/sudoers
3. Start an ssh session to the machine
4. # sudo su -
5. # more <big enough file>
6. kill the parent ssh process, say close the tab

At this time "more" runs with 100% CPU utilization.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
5 months agolibuuid: Add uuid_time64 for 64bit time_t on 32bit
Thorsten Kukuk [Thu, 30 Nov 2023 15:28:53 +0000 (16:28 +0100)] 
libuuid: Add uuid_time64 for 64bit time_t on 32bit

Signed-off-by: Thorsten Kukuk <kukuk@suse.com>
5 months agoRevert "more: exit if POLLHUP or POLLERR on stdin is received"
Karel Zak [Fri, 8 Dec 2023 12:26:52 +0000 (13:26 +0100)] 
Revert "more: exit if POLLHUP or POLLERR on stdin is received"

the regression test more/regexp failed.

This reverts commit 9be4122b1d8c1c2b8eb270998838c73bae7ff2ff.

5 months agohwclock: reuse error message
Karel Zak [Fri, 8 Dec 2023 12:16:23 +0000 (13:16 +0100)] 
hwclock: reuse error message

The only hwclock is the place we use this message.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agobash-completion: make sure that "lastb" actually completes
Eli Schwartz [Thu, 7 Dec 2023 00:40:44 +0000 (19:40 -0500)] 
bash-completion: make sure that "lastb" actually completes

Building util-linux logs a warning on Gentoo:

```
 * Problems with installed bash completions were found:
 *
 *  lastb: incorrect name, no completions for 'lastb' command defined.
 *
 * For more details on installing bash-completions, please see:
 * https://wiki.gentoo.org/wiki/Bash/Installing_completion_files
```

A bash-completion file is usually composed of two parts:
- a function that knows how to produce completions
- a specification of which command should be completed

In cases where multiple commands have the same options, e.g. commands
that are symlinked to each other, it is common to symlink the completion
files as well. This shares the first part. But the second part cannot be
shared, it must be implemented twice by specifying two different
commands to be completed.

"lastb" had a symlinked completion, but when the completion system
processes /usr/share/bash-completion/completions/lastb, it would only
define a completion for "last".

Define both completions in one file, so that sourcing it works
regardless of command used.

5 months agomore: exit if POLLHUP or POLLERR on stdin is received
Goldwyn Rodrigues [Wed, 6 Dec 2023 19:19:17 +0000 (13:19 -0600)] 
more: exit if POLLHUP or POLLERR on stdin is received

more command continues to run in case stdin have closed the file and it
takes 100% of CPU. This is because revents on stdin send
POLLIN | POLLHUP | POLLERR once stdin is closed. more receives it even
though it is not requested in events. This is common Linux behaviour to
never mask out POLLHUP or POLLERR. The loop in more_key_command() runs
infinitely because more_poll() returns 0 and read_command() reads 0
bytes.

Steps to reproduce:
1. Setup /etc/systemd/logind.conf with KillUserProcesses=no
2. Add config "Defaults use_pty" in /etc/sudoers
3. Start an ssh session to the machine
4. # sudo su -
5. # more <big enough file>
6. kill the parent ssh process, say close the tab

At this time "more" runs with 100% CPU utilization.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
5 months agoMerge branch 'PR/list-columns' of github.com:karelzak/util-linux-work
Karel Zak [Fri, 8 Dec 2023 10:31:03 +0000 (11:31 +0100)] 
Merge branch 'PR/list-columns' of github.com:karelzak/util-linux-work

* 'PR/list-columns' of github.com:karelzak/util-linux-work:
  findmnt: add --list-columns
  lslocks: improve --list-columns
  lsblk: add --list-columns

5 months agotests: (lslcoks) insert a sleep between taking a lock and running lslocks
Masatake YAMATO [Thu, 7 Dec 2023 19:35:29 +0000 (04:35 +0900)] 
tests: (lslcoks) insert a sleep between taking a lock and running lslocks

Close #2624.

It appears that there is a time lag between locking and its visibility
in /proc/locks.  See the unstbale results of errors I observed in
https://github.com/util-linux/util-linux/pull/2629.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agofindmnt: add --list-columns
Karel Zak [Wed, 6 Dec 2023 12:56:28 +0000 (13:56 +0100)] 
findmnt: add --list-columns

Signed-off-by: Karel Zak <kzak@redhat.com>