]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agohexdump: Add missing section header in man page
Mario Blättermann [Thu, 4 Jan 2024 20:58:04 +0000 (21:58 +0100)] 
hexdump: Add missing section header in man page

2 years agofadvise: Fix markup in man page
Mario Blättermann [Thu, 4 Jan 2024 19:58:53 +0000 (20:58 +0100)] 
fadvise: Fix markup in man page

2 years agomount: Fix markup and typos in man page
Mario Blättermann [Thu, 4 Jan 2024 16:30:27 +0000 (17:30 +0100)] 
mount: Fix markup and typos in man page

2 years agofstab: Fix markup in man page
Mario Blättermann [Thu, 4 Jan 2024 16:22:33 +0000 (17:22 +0100)] 
fstab: Fix markup in man page

2 years agouuidd: Fix markup in man page (uuidd.8)
Mario Blättermann [Thu, 4 Jan 2024 16:20:44 +0000 (17:20 +0100)] 
uuidd: Fix markup in man page (uuidd.8)

2 years agolsfd: Fix typos in man page
Mario Blättermann [Thu, 4 Jan 2024 16:18:20 +0000 (17:18 +0100)] 
lsfd: Fix typos in man page

2 years agolsclocks: Fix markup and typos in man page
Mario Blättermann [Thu, 4 Jan 2024 16:15:29 +0000 (17:15 +0100)] 
lsclocks: Fix markup and typos in man page

2 years agohardlink: Fix markup in man page
Mario Blättermann [Thu, 4 Jan 2024 16:13:01 +0000 (17:13 +0100)] 
hardlink: Fix markup in man page

2 years agosfdisk: Fix markup in man page
Mario Blättermann [Thu, 4 Jan 2024 16:10:01 +0000 (17:10 +0100)] 
sfdisk: Fix markup in man page

2 years 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>
2 years 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

2 years 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

2 years 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

2 years 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

2 years agohwclock: Improve set error in the face of jitter
Eric Badger [Wed, 3 Jan 2024 21:11:43 +0000 (13:11 -0800)] 
hwclock: Improve set error in the face of jitter

set_hardware_clock_exact() spins in a loop, trying to exit when we are
`delay` seconds from an integer time on the system clock. However, there
might be jitter which causes an exit a little bit later than ideal.

The prior code could cause a relatively small error in loop exit time to
produce a relatively large error in the RTC.

For example, suppose upon exit from the loop, we have:

    sethwtime=1704239206
    refsystime=1704239206.000000
    nowsystime=1704239206.500372
    delay=0.5

In this case, the error is very small: 0.000372. However, we will
compute:

    newhwtime = 1704239206 + ceil(0.500371 - 0.5) = 1704239207

And in slightly less than `delay` seconds, the system clock will be
1704239207 while the RTC will be approximately 1704239208, about 1
second of error.

We are better off rounding in this case. The RTC will be behind the
system clock, but only very slightly:

    newhwtime = 1704239206 + round(0.500371 - 0.5) = 1704239206

I find passing `--ul-debug 0xffff` readily produces the original issue.

Signed-off-by: Eric Badger <ebadger@purestorage.com>
2 years agolibmount: reduce utab.lock permissions
Karel Zak [Wed, 3 Jan 2024 13:40:07 +0000 (14:40 +0100)] 
libmount: reduce utab.lock permissions

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: introduce /run/mount/utab.event
Karel Zak [Wed, 3 Jan 2024 13:13:28 +0000 (14:13 +0100)] 
libmount: introduce /run/mount/utab.event

The mnt_monitor_...() API uses /run/mount/utab.lock to monitor utab
changes. The same file is used to control access to the utab file.

The utab can be updated more than once during one mount(8) call, for
example, one update is done in /sbin/mount.nfs and next in mount(8).
This situation triggers two (e.g. inotify) events when monitoring is
based on the lock file.

It seems better to introduce separate file to trigger the event and do
not trigger this event in /sbin/mount.<type> helpers.

References: 477401f0de404aafbc7630f70c2f8b1d670e32f8
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: add mnt_context_within_helper() wrapper
Karel Zak [Wed, 3 Jan 2024 11:38:21 +0000 (12:38 +0100)] 
libmount: add mnt_context_within_helper() wrapper

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years 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>
2 years 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

2 years 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

2 years 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>
2 years 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>
2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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

2 years 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

2 years 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

2 years 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>
2 years 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

2 years 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

2 years agologin: unify pw_shell script test
Tobias Stoeckmann [Fri, 29 Dec 2023 17:11:42 +0000 (18:11 +0100)] 
login: unify pw_shell script test

At first, a blank in pw_shell is sufficient to assume that the user
login shell is actually a shell script.

If execution fails, the test consists of testing argv[0] for "/bin/sh"
which is set in case of shell script.

But "/bin/sh" can also be the actual login shell set for the user.
If execution fails, the error message erroneously talks about a shell
script.

Keep a boolean variable around to perform the test exactly once to
have a precise error message.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 years agologin: simplify name creation
Tobias Stoeckmann [Fri, 29 Dec 2023 17:07:55 +0000 (18:07 +0100)] 
login: simplify name creation

The function xasprintf is simpler to handle than calling xstrncpy
and xstrdup for the same task.

Introduced buff variable to make the whole else-block look like the
if-block.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 years 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>
2 years 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

2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agobuild-sys: (tests) validate that time_t is 64bit
Thomas Weißschuh [Fri, 22 Dec 2023 16:58:41 +0000 (17:58 +0100)] 
build-sys: (tests) validate that time_t is 64bit

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomeson: try to always use 64bit time support on glibc
Thomas Weißschuh [Sun, 16 Apr 2023 07:11:41 +0000 (09:11 +0200)] 
meson: try to always use 64bit time support on glibc

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agobuild-sys: try to always use 64bit time support on glibc
Thomas Weißschuh [Sat, 15 Apr 2023 08:57:02 +0000 (10:57 +0200)] 
build-sys: try to always use 64bit time support on glibc

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agobuild-sys: backport autoconf year2038 macros
Thomas Weißschuh [Fri, 22 Dec 2023 17:02:53 +0000 (18:02 +0100)] 
build-sys: backport autoconf year2038 macros

Backported from 2.72e which is a release candidate for the final 2.72
release.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: add sysinfo to show sizeof(time_t)
Thomas Weißschuh [Sun, 16 Apr 2023 07:11:49 +0000 (09:11 +0200)] 
tests: add sysinfo to show sizeof(time_t)

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: constify a sysinfo helpers struct
Thomas Weißschuh [Sun, 16 Apr 2023 07:13:34 +0000 (09:13 +0200)] 
tests: constify a sysinfo helpers struct

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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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

2 years 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>
2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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

2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>