]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agologin: document blank treatment in shell field
Tobias Stoeckmann [Tue, 9 Jan 2024 20:07:39 +0000 (21:07 +0100)] 
login: document blank treatment in shell field

If the shell field contains a blank, then the shell field is
interpreted as a shell script.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 years agolosetup: improve "sector boundary" warning
Karel Zak [Tue, 9 Jan 2024 12:05:30 +0000 (13:05 +0100)] 
losetup: improve "sector boundary" warning

Fixes: https://github.com/util-linux/util-linux/issues/2689
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: fix fiemap use
Karel Zak [Tue, 9 Jan 2024 11:59:24 +0000 (12:59 +0100)] 
hardlink: fix fiemap use

Handle cases where the number of fm_mapped_extents is zero by ignoring
the fm_extents array, as zero is a valid value.

Fixes: https://github.com/util-linux/util-linux/issues/2687
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: explain FSAVAIL in better way
Karel Zak [Tue, 9 Jan 2024 11:45:53 +0000 (12:45 +0100)] 
lsblk: explain FSAVAIL in better way

Addresses: https://github.com/util-linux/util-linux/discussions/2690
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomkswap: implement --file
Vicki Pfau [Sat, 6 Jan 2024 03:50:29 +0000 (19:50 -0800)] 
mkswap: implement --file

Addresses #2359

Signed-off-by: Vicki Pfau <vi@endrift.com>
2 years agorunuser|su: Start supporting option -T|--no-pty
Sebastian Pipping [Fri, 5 Jan 2024 23:46:49 +0000 (00:46 +0100)] 
runuser|su: Start supporting option -T|--no-pty

.. to pave the way for a future with -P|--pty for a default.

2 years agorunuser.1.adoc: Move -m|-p|--preserve-environment in order
Sebastian Pipping [Fri, 5 Jan 2024 23:43:20 +0000 (00:43 +0100)] 
runuser.1.adoc: Move -m|-p|--preserve-environment in order

.. for alphabetical order and to match sibling file su.1.adoc.

2 years agoMerge branch 'libmount/tests/root' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 8 Jan 2024 09:37:54 +0000 (10:37 +0100)] 
Merge branch 'libmount/tests/root' of https://github.com/t-8ch/util-linux

* 'libmount/tests/root' of https://github.com/t-8ch/util-linux:
  libmount: (tests) don't require root for update tests

2 years agoMerge branch 'tests--lsfd--mkfds-inotify-on-btrfs' of https://github.com/masatake...
Karel Zak [Mon, 8 Jan 2024 09:37:09 +0000 (10:37 +0100)] 
Merge branch 'tests--lsfd--mkfds-inotify-on-btrfs' of https://github.com/masatake/util-linux

* 'tests--lsfd--mkfds-inotify-on-btrfs' of https://github.com/masatake/util-linux:
  tests: (lsfd) add a case testing INOTIFY.INODES.RAW column on btrfs
  tests: (test_mkfds::inotify) add "dir" and "file" parameters
  tests: (lsfd::mkfds-inotify) use findmnt(1) instead of stat(1) to get bdev numbers

2 years agolibmount: don't assume errno after failed asprintf()
Karel Zak [Mon, 8 Jan 2024 09:32:54 +0000 (10:32 +0100)] 
libmount: don't assume errno after failed asprintf()

Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'patch-24' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:27:24 +0000 (10:27 +0100)] 
Merge branch 'patch-24' of https://github.com/mariobl/util-linux

* 'patch-24' of https://github.com/mariobl/util-linux:
  hexdump: Add missing section header in man page

2 years agoMerge branch 'patch-25' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:26:53 +0000 (10:26 +0100)] 
Merge branch 'patch-25' of https://github.com/mariobl/util-linux

* 'patch-25' of https://github.com/mariobl/util-linux:
  write: Add missing section header in man page

2 years agoMerge branch 'patch-23' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:26:40 +0000 (10:26 +0100)] 
Merge branch 'patch-23' of https://github.com/mariobl/util-linux

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

2 years agoMerge branch 'patch-21' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:25:54 +0000 (10:25 +0100)] 
Merge branch 'patch-21' of https://github.com/mariobl/util-linux

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

2 years agoMerge branch 'patch-20' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:25:37 +0000 (10:25 +0100)] 
Merge branch 'patch-20' of https://github.com/mariobl/util-linux

* 'patch-20' of https://github.com/mariobl/util-linux:
  uuidd: Fix markup in man page (uuidd.8)

2 years agoMerge branch 'patch-16' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:24:58 +0000 (10:24 +0100)] 
Merge branch 'patch-16' of https://github.com/mariobl/util-linux

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

2 years agoMerge branch 'patch-17' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:24:07 +0000 (10:24 +0100)] 
Merge branch 'patch-17' of https://github.com/mariobl/util-linux

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

2 years agoMerge branch 'patch-18' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:23:38 +0000 (10:23 +0100)] 
Merge branch 'patch-18' of https://github.com/mariobl/util-linux

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

2 years agoMerge branch 'patch-19' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:23:09 +0000 (10:23 +0100)] 
Merge branch 'patch-19' of https://github.com/mariobl/util-linux

* 'patch-19' of https://github.com/mariobl/util-linux:
  lsfd: Fix typos in man page

2 years agoMerge branch 'patch-22' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 8 Jan 2024 09:22:31 +0000 (10:22 +0100)] 
Merge branch 'patch-22' of https://github.com/mariobl/util-linux

* 'patch-22' of https://github.com/mariobl/util-linux:
  mount: Fix markup and typos in man page

2 years agoMerge branch 'hwclock-set-jitter' of https://github.com/badgerious/util-linux
Karel Zak [Mon, 8 Jan 2024 09:08:05 +0000 (10:08 +0100)] 
Merge branch 'hwclock-set-jitter' of https://github.com/badgerious/util-linux

* 'hwclock-set-jitter' of https://github.com/badgerious/util-linux:
  hwclock: Improve set error in the face of jitter

2 years agolibmount: (tests) don't require root for update tests
Thomas Weißschuh [Sat, 6 Jan 2024 08:52:42 +0000 (09:52 +0100)] 
libmount: (tests) don't require root for update tests

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: (lsfd) add a case testing INOTIFY.INODES.RAW column on btrfs
Masatake YAMATO [Fri, 5 Jan 2024 14:31:05 +0000 (23:31 +0900)] 
tests: (lsfd) add a case testing INOTIFY.INODES.RAW column on btrfs

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (test_mkfds::inotify) add "dir" and "file" parameters
Masatake YAMATO [Fri, 5 Jan 2024 14:25:49 +0000 (23:25 +0900)] 
tests: (test_mkfds::inotify) add "dir" and "file" parameters

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd::mkfds-inotify) use findmnt(1) instead of stat(1) to get bdev numbers
Masatake YAMATO [Fri, 5 Jan 2024 08:54:36 +0000 (17:54 +0900)] 
tests: (lsfd::mkfds-inotify) use findmnt(1) instead of stat(1) to get bdev numbers

Close #2349

stat(2) on some filesystems including btrfs reports a block device
number (bdev number) with a offset. On the other hand, "inotify wd"
field of /proc/$pid/fdinfo/$fd for an inotify file reports bdev
numbers without offsets.

The offset caused the failure of lsfd::mkfds-inotify test case on
btrfs.  Unlike stat(2), findmnt can report bdev numbers without
offsets.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agowrite: Add missing section header in man page
Mario Blättermann [Thu, 4 Jan 2024 20:59:43 +0000 (21:59 +0100)] 
write: Add missing section header in man page

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>