]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agoMerge branch 'enosys/include' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 22 May 2023 11:01:58 +0000 (13:01 +0200)] 
Merge branch 'enosys/include' of https://github.com/t-8ch/util-linux

* 'enosys/include' of https://github.com/t-8ch/util-linux:
  enosys: include sys/syscall.h

2 years agoMerge branch 'libblkid/const' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 22 May 2023 11:00:04 +0000 (13:00 +0200)] 
Merge branch 'libblkid/const' of https://github.com/t-8ch/util-linux

* 'libblkid/const' of https://github.com/t-8ch/util-linux:
  libblkid: constify cached disk data

2 years agolib/shells: remove space after function name
Karel Zak [Mon, 22 May 2023 10:45:06 +0000 (12:45 +0200)] 
lib/shells: remove space after function name

Cats and ponies die when they see a space after a function name ...

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/shells: initialize free-able variables
Karel Zak [Mon, 22 May 2023 10:43:53 +0000 (12:43 +0200)] 
lib/shells: initialize free-able variables

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'econf' of https://github.com/stoeckmann/util-linux
Karel Zak [Mon, 22 May 2023 10:42:13 +0000 (12:42 +0200)] 
Merge branch 'econf' of https://github.com/stoeckmann/util-linux

* 'econf' of https://github.com/stoeckmann/util-linux:
  lib/shells: Plug econf memory leak

2 years agoMerge branch 'lsfd--eventfd' of https://github.com/masatake/util-linux
Karel Zak [Mon, 22 May 2023 10:39:59 +0000 (12:39 +0200)] 
Merge branch 'lsfd--eventfd' of https://github.com/masatake/util-linux

* 'lsfd--eventfd' of https://github.com/masatake/util-linux:
  test_mkfds: avoid "ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’"
  tests: (lsfd) add cases for eventfd
  tests: (mkfds) add eventfd factory
  tests: (mkfds) provide the way to declare the number of extra printing values
  tests: (mkfds) print a whitespace only when the running factory has "report" method
  lsfd: fill ENDPOINTS column for eventfd
  lsfd: add a helper macro, foreach_endpoint
  lsfd: add a helper function, init_endpoint
  lsfd: add a helper function, add_endpoint
  lsfd: add a helper function, new_ipc
  lsfd: add a back pointer as a member of anon_eventfd_data
  lsfd: move a local variable to a narrower scope
  lsfd: add EVENTFD.ID column
  lsfd: delete redundant parentheses surrounding return value
  ldfd: delete unnecessary ';'
  lsfd: choose anon_ops declarative way

2 years agoMerge branch 'hexdump-one-byte-hex' of https://github.com/tpwo/util-linux
Karel Zak [Mon, 22 May 2023 10:36:45 +0000 (12:36 +0200)] 
Merge branch 'hexdump-one-byte-hex' of https://github.com/tpwo/util-linux

* 'hexdump-one-byte-hex' of https://github.com/tpwo/util-linux:
  hexdump: add new format-strings test case
  hexdump: add '--one-byte-hex' format option

2 years agoMerge branch 'allow-disabling-waitpid' of https://github.com/mrc0mmand/util-linux
Karel Zak [Mon, 22 May 2023 10:32:07 +0000 (12:32 +0200)] 
Merge branch 'allow-disabling-waitpid' of https://github.com/mrc0mmand/util-linux

* 'allow-disabling-waitpid' of https://github.com/mrc0mmand/util-linux:
  build-sys: add --disable-waitpid

2 years agolibmount: don't pass option "defaults" to helper
Thomas Weißschuh [Sun, 21 May 2023 17:58:47 +0000 (19:58 +0200)] 
libmount: don't pass option "defaults" to helper

"defaults" is only a pseudo-option that expands to other options.
It should not be passed to helpers.

Reported-by: Quentin Rameau <quinq@fifth.space>
Closes: https://lore.kernel.org/util-linux/20230521181814.0b0f2d38.quinq@fifth.space/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: include sys/syscall.h
Thomas Weißschuh [Fri, 19 May 2023 08:51:25 +0000 (10:51 +0200)] 
enosys: include sys/syscall.h

Otherwise there is no guarantee that all syscall numbers detected by
tools/all_syscalls are actually available to enosys.c.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: constify cached disk data
Thomas Weißschuh [Thu, 18 May 2023 20:37:10 +0000 (22:37 +0200)] 
libblkid: constify cached disk data

The data returned from blkid_probe_get_buffer() and friends may or may
not be cached between different calls.
If one copy is modified this may not be visible in other copies.

This issue can be avoided by making any modification illegal.

See also #2165

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotest_mkfds: avoid "ignoring return value of ‘write’ declared with attribute ‘warn_unu...
Masatake YAMATO [Thu, 18 May 2023 15:14:21 +0000 (00:14 +0900)] 
test_mkfds: avoid "ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’"

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) add cases for eventfd
Masatake YAMATO [Sat, 11 Mar 2023 05:42:59 +0000 (14:42 +0900)] 
tests: (lsfd) add cases for eventfd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) add eventfd factory
Masatake YAMATO [Sun, 5 Mar 2023 18:04:13 +0000 (03:04 +0900)] 
tests: (mkfds) add eventfd factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) provide the way to declare the number of extra printing values
Masatake YAMATO [Wed, 8 Mar 2023 12:51:08 +0000 (21:51 +0900)] 
tests: (mkfds) provide the way to declare the number of extra printing values

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) print a whitespace only when the running factory has "report" method
Masatake YAMATO [Tue, 7 Mar 2023 14:09:32 +0000 (23:09 +0900)] 
tests: (mkfds) print a whitespace only when the running factory has "report" method

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: fill ENDPOINTS column for eventfd
Masatake YAMATO [Sat, 4 Mar 2023 05:38:57 +0000 (14:38 +0900)] 
lsfd: fill ENDPOINTS column for eventfd

An example output:

  $ ./lsfd -Q '(TYPE == "eventfd") and (ENDPOINTS =~ ".+") ' -o+ENDPOINTS
  COMMAND          PID USER ASSOC MODE    TYPE       SOURCE MNTID INODE NAME   ENDPOINTS
  pipewire       17251  jet    40  rw- eventfd anon_inodefs    15  1060 id=818 17255,pipewire-pulse,26
  pipewire       17251  jet    52  rw- eventfd anon_inodefs    15  1060 id=695 17255,pipewire-pulse,30
       17255,pipewire-pulse,37
       17255,pipewire-pulse,49
  pipewire       17251  jet    54  rw- eventfd anon_inodefs    15  1060 id=845 17255,pipewire-pulse,31
  pipewire       17251  jet    61  rw- eventfd anon_inodefs    15  1060 id=212 17255,pipewire-pulse,45
  pipewire       17251  jet    62  rw- eventfd anon_inodefs    15  1060 id=224 17255,pipewire-pulse,46
  pipewire-pulse 17255  jet    26  rw- eventfd anon_inodefs    15  1060 id=818 17251,pipewire,40
  pipewire-pulse 17255  jet    30  rw- eventfd anon_inodefs    15  1060 id=695 17251,pipewire,52
       17255,pipewire-pulse,37
       17255,pipewire-pulse,49
  pipewire-pulse 17255  jet    31  rw- eventfd anon_inodefs    15  1060 id=845 17251,pipewire,54
  pipewire-pulse 17255  jet    37  rw- eventfd anon_inodefs    15  1060 id=695 17251,pipewire,52
       17255,pipewire-pulse,30
       17255,pipewire-pulse,49
  pipewire-pulse 17255  jet    45  rw- eventfd anon_inodefs    15  1060 id=212 17251,pipewire,61
  pipewire-pulse 17255  jet    46  rw- eventfd anon_inodefs    15  1060 id=224 17251,pipewire,62
  pipewire-pulse 17255  jet    49  rw- eventfd anon_inodefs    15  1060 id=695 17251,pipewire,52
       17255,pipewire-pulse,30
       17255,pipewire-pulse,37

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add a helper macro, foreach_endpoint
Masatake YAMATO [Sat, 4 Mar 2023 05:51:33 +0000 (14:51 +0900)] 
lsfd: add a helper macro, foreach_endpoint

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add a helper function, init_endpoint
Masatake YAMATO [Sat, 4 Mar 2023 05:25:20 +0000 (14:25 +0900)] 
lsfd: add a helper function, init_endpoint

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add a helper function, add_endpoint
Masatake YAMATO [Sat, 4 Mar 2023 05:16:44 +0000 (14:16 +0900)] 
lsfd: add a helper function, add_endpoint

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add a helper function, new_ipc
Masatake YAMATO [Sat, 4 Mar 2023 04:37:20 +0000 (13:37 +0900)] 
lsfd: add a helper function, new_ipc

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add a back pointer as a member of anon_eventfd_data
Masatake YAMATO [Fri, 3 Mar 2023 18:21:33 +0000 (03:21 +0900)] 
lsfd: add a back pointer as a member of anon_eventfd_data

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: move a local variable to a narrower scope
Masatake YAMATO [Fri, 3 Mar 2023 18:17:58 +0000 (03:17 +0900)] 
lsfd: move a local variable to a narrower scope

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add EVENTFD.ID column
Masatake YAMATO [Fri, 3 Mar 2023 17:28:04 +0000 (02:28 +0900)] 
lsfd: add EVENTFD.ID column

The files under of /proc/$pid/fdinfo/* provide IDs for eventfd files.
With this change, lsfd extacts the IDs. All eventfd files share the
same inode. So the IDs are useful to distinguish two different
envetfds.

An example output:

  $ ./lsfd -Q '(TYPE == "eventfd")' -o+EVENTFD.ID | head
  COMMAND             PID USER ASSOC MODE    TYPE       SOURCE MNTID INODE NAME   EVENTFD.ID
  gnome-session-b   17113  jet     3  rw- eventfd anon_inodefs    15  1060 id=43          43
  gnome-session-b   17113  jet     4  rw- eventfd anon_inodefs    15  1060 id=44          44
  gnome-session-b   17113  jet     6  rw- eventfd anon_inodefs    15  1060 id=158        158
  gnome-session-b   17113  jet     8  rw- eventfd anon_inodefs    15  1060 id=167        167
  at-spi-bus-laun   17160  jet     3  rw- eventfd anon_inodefs    15  1060 id=341        341
  at-spi-bus-laun   17160  jet     4  rw- eventfd anon_inodefs    15  1060 id=342        342
  at-spi-bus-laun   17160  jet     5  rw- eventfd anon_inodefs    15  1060 id=343        343
  at-spi-bus-laun   17160  jet     9  rw- eventfd anon_inodefs    15  1060 id=344        344
  gvfsd             17169  jet     3  rw- eventfd anon_inodefs    15  1060 id=369        369

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: delete redundant parentheses surrounding return value
Masatake YAMATO [Fri, 10 Mar 2023 06:10:11 +0000 (15:10 +0900)] 
lsfd: delete redundant parentheses surrounding return value

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoldfd: delete unnecessary ';'
Masatake YAMATO [Fri, 3 Mar 2023 17:09:12 +0000 (02:09 +0900)] 
ldfd: delete unnecessary ';'

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: choose anon_ops declarative way
Masatake YAMATO [Fri, 3 Mar 2023 15:28:37 +0000 (00:28 +0900)] 
lsfd: choose anon_ops declarative way

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agobuild-sys: add --disable-waitpid
Frantisek Sumsal [Thu, 18 May 2023 16:56:15 +0000 (18:56 +0200)] 
build-sys: add --disable-waitpid

The new pidfd stuff waitpid uses is not compatible with older kernel
headers, but the rest of the util-linux is still perfectly fine, so
allow disabling just the waitpid utility to make the builds happy again.

2 years agolib/shells: Plug econf memory leak
Tobias Stoeckmann [Thu, 18 May 2023 15:48:46 +0000 (17:48 +0200)] 
lib/shells: Plug econf memory leak

You can see the memory leak with address sanitizer if util-linux is
compiled with `--with-vendordir=/usr/etc`.

How to reproduce:

1. Prepare a custom shell file as root
```
mkdir -p /etc/shells.d
echo /bin/myshell > /etc/shells.d/custom
```

2. Run chsh as regular user
```
chsh
```

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 years agolib/caputils: fix integer handling issues [coverity scan]
Karel Zak [Thu, 18 May 2023 08:26:02 +0000 (10:26 +0200)] 
lib/caputils: fix integer handling issues [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomesg.1 cleanups/updates
наб [Sun, 14 May 2023 23:19:58 +0000 (01:19 +0200)] 
mesg.1 cleanups/updates

First hunk:  grammar.
Second hunk: (a) mentioning BSD ptys and not UNIX98 ones is odd,
             (b) mentioning /only/ ptys is odder still.
Third hunk:  mesg is found in the UNIX Programmer's Manual;
             it takes its modern form in V7
             (it's unclear to me why V6 specifically is mentioned,
              since it's still default-invert + always-report-"was X").

2 years agoMerge branch 'nsenter-keep-caps' of https://github.com/dgibson/util-linux
Karel Zak [Wed, 17 May 2023 11:43:40 +0000 (13:43 +0200)] 
Merge branch 'nsenter-keep-caps' of https://github.com/dgibson/util-linux

* 'nsenter-keep-caps' of https://github.com/dgibson/util-linux:
  Add --keep-caps option to nsenter, similar to the one in unshare
  unshare: Move implementation of --keep-caps option to library function

2 years agoMerge branch 'libmount/syscall'
Karel Zak [Wed, 17 May 2023 11:42:01 +0000 (13:42 +0200)] 
Merge branch 'libmount/syscall'

2 years agoMerge branch 'enosys' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 17 May 2023 11:34:34 +0000 (13:34 +0200)] 
Merge branch 'enosys' of https://github.com/t-8ch/util-linux

* 'enosys' of https://github.com/t-8ch/util-linux:
  enosys: properly block execve syscall
  enosys: don't require end-of-options marker
  enosys: find syscalls at build time
  enosys: remove long jumps from BPF
  enosys: add --list
  enosys: validate syscall architecture
  enosys: add manpage
  enosys: add bash completion
  enosys: make messages useful for users
  enosys: translate messages
  enosys: add common arguments
  enosys: add test
  enosys: fix native arch for s390x
  enosys: syscall numbers are "long"
  enosys: mark variable static
  enosys: remove unneeded inline variable declaration
  enosys: improve checks for EXIT_NOTSUPP
  enosys: move from tests/helpers/test_enosys.c
  c.h: make err_nonsys available

2 years agoMerge branch 'mkswap/offset' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 17 May 2023 11:27:55 +0000 (13:27 +0200)] 
Merge branch 'mkswap/offset' of https://github.com/t-8ch/util-linux

* 'mkswap/offset' of https://github.com/t-8ch/util-linux:
  mkswap: implement --offset
  mkswap: (tests) don't overwrite logfiles
  mkswap: (tests) validate existence of truncate command

2 years agoMerge branch 'blockdev/zonesz' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 17 May 2023 11:26:34 +0000 (13:26 +0200)] 
Merge branch 'blockdev/zonesz' of https://github.com/t-8ch/util-linux

* 'blockdev/zonesz' of https://github.com/t-8ch/util-linux:
  blockdev: add support for BLKGETZONESZ

2 years agoMerge branch 'mount/tests/fstab' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 17 May 2023 11:25:25 +0000 (13:25 +0200)] 
Merge branch 'mount/tests/fstab' of https://github.com/t-8ch/util-linux

* 'mount/tests/fstab' of https://github.com/t-8ch/util-linux:
  mount: (tests) reuse well-known per-test fstab location
  tests: (functions.sh) use per-test fstab file
  mount: (tests) explicitly use test fstab location
  tests: (functions.sh) create variable for test fstab location

2 years agobuild-sys: release++ (v2.39) v2.39
Karel Zak [Wed, 17 May 2023 09:58:48 +0000 (11:58 +0200)] 
build-sys: release++ (v2.39)

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update v2.39-ReleaseNotes
Karel Zak [Wed, 17 May 2023 09:57:07 +0000 (11:57 +0200)] 
docs: update v2.39-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: merge changes
Karel Zak [Wed, 17 May 2023 09:54:01 +0000 (11:54 +0200)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo: merge changes
Karel Zak [Wed, 17 May 2023 09:53:42 +0000 (11:53 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 17 May 2023 09:45:41 +0000 (11:45 +0200)] 
po-man: update uk.po (from translationproject.org)

2 years agopo-man: update sr.po (from translationproject.org)
Мирослав Николић [Wed, 17 May 2023 09:45:41 +0000 (11:45 +0200)] 
po-man: update sr.po (from translationproject.org)

2 years agopo-man: update fr.po (from translationproject.org)
Frédéric Marchal [Wed, 17 May 2023 09:45:41 +0000 (11:45 +0200)] 
po-man: update fr.po (from translationproject.org)

2 years agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Wed, 17 May 2023 09:45:41 +0000 (11:45 +0200)] 
po-man: update de.po (from translationproject.org)

2 years agopo-man: update cs.po (from translationproject.org)
Petr Písař [Wed, 17 May 2023 09:45:41 +0000 (11:45 +0200)] 
po-man: update cs.po (from translationproject.org)

2 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 17 May 2023 09:44:17 +0000 (11:44 +0200)] 
po: update uk.po (from translationproject.org)

2 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Wed, 17 May 2023 09:44:17 +0000 (11:44 +0200)] 
po: update pl.po (from translationproject.org)

2 years agopo: update ko.po (from translationproject.org)
Seong-ho Cho [Wed, 17 May 2023 09:44:17 +0000 (11:44 +0200)] 
po: update ko.po (from translationproject.org)

2 years agopo: update hr.po (from translationproject.org)
Božidar Putanec [Wed, 17 May 2023 09:44:17 +0000 (11:44 +0200)] 
po: update hr.po (from translationproject.org)

2 years agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Wed, 17 May 2023 09:44:17 +0000 (11:44 +0200)] 
po: update fr.po (from translationproject.org)

2 years agopo: update de.po (from translationproject.org)
Mario Blättermann [Wed, 17 May 2023 09:44:17 +0000 (11:44 +0200)] 
po: update de.po (from translationproject.org)

2 years agopo: update cs.po (from translationproject.org)
Petr Písař [Wed, 17 May 2023 09:44:17 +0000 (11:44 +0200)] 
po: update cs.po (from translationproject.org)

2 years agoenosys: properly block execve syscall
Thomas Weißschuh [Tue, 16 May 2023 21:18:58 +0000 (23:18 +0200)] 
enosys: properly block execve syscall

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: don't require end-of-options marker
Thomas Weißschuh [Sun, 14 May 2023 19:35:58 +0000 (21:35 +0200)] 
enosys: don't require end-of-options marker

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: find syscalls at build time
Thomas Weißschuh [Thu, 4 May 2023 22:39:40 +0000 (00:39 +0200)] 
enosys: find syscalls at build time

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: remove long jumps from BPF
Thomas Weißschuh [Thu, 4 May 2023 22:38:11 +0000 (00:38 +0200)] 
enosys: remove long jumps from BPF

BPF encodes the jump distance in a uint8_t. To avoid overflows of this
value reorganize the generated bytecode to work without long jumps.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: add --list
Thomas Weißschuh [Fri, 28 Apr 2023 11:42:11 +0000 (13:42 +0200)] 
enosys: add --list

2 years agoenosys: validate syscall architecture
Thomas Weißschuh [Thu, 27 Apr 2023 21:48:31 +0000 (23:48 +0200)] 
enosys: validate syscall architecture

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: add manpage
Thomas Weißschuh [Thu, 4 May 2023 18:31:32 +0000 (20:31 +0200)] 
enosys: add manpage

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: add bash completion
Thomas Weißschuh [Thu, 4 May 2023 18:15:04 +0000 (20:15 +0200)] 
enosys: add bash completion

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: make messages useful for users
Thomas Weißschuh [Fri, 28 Apr 2023 07:57:57 +0000 (09:57 +0200)] 
enosys: make messages useful for users

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: translate messages
Thomas Weißschuh [Fri, 28 Apr 2023 07:56:31 +0000 (09:56 +0200)] 
enosys: translate messages

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: add common arguments
Thomas Weißschuh [Thu, 4 May 2023 18:23:30 +0000 (20:23 +0200)] 
enosys: add common arguments

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: add test
Thomas Weißschuh [Thu, 27 Apr 2023 22:04:19 +0000 (00:04 +0200)] 
enosys: add test

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: fix native arch for s390x
Thomas Weißschuh [Sun, 7 May 2023 08:59:46 +0000 (10:59 +0200)] 
enosys: fix native arch for s390x

s390 also defines __s390__ so we first have to check for __s390x__.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: syscall numbers are "long"
Thomas Weißschuh [Fri, 28 Apr 2023 14:45:58 +0000 (16:45 +0200)] 
enosys: syscall numbers are "long"

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: mark variable static
Thomas Weißschuh [Thu, 27 Apr 2023 22:04:35 +0000 (00:04 +0200)] 
enosys: mark variable static

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: remove unneeded inline variable declaration
Thomas Weißschuh [Thu, 11 May 2023 10:23:01 +0000 (12:23 +0200)] 
enosys: remove unneeded inline variable declaration

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: improve checks for EXIT_NOTSUPP
Thomas Weißschuh [Thu, 11 May 2023 10:48:33 +0000 (12:48 +0200)] 
enosys: improve checks for EXIT_NOTSUPP

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoenosys: move from tests/helpers/test_enosys.c
Thomas Weißschuh [Thu, 27 Apr 2023 21:40:28 +0000 (23:40 +0200)] 
enosys: move from tests/helpers/test_enosys.c

2 years agoc.h: make err_nonsys available
Thomas Weißschuh [Thu, 11 May 2023 10:42:27 +0000 (12:42 +0200)] 
c.h: make err_nonsys available

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agohexdump: add new format-strings test case
Tomasz Wojdat [Tue, 16 May 2023 19:43:54 +0000 (21:43 +0200)] 
hexdump: add new format-strings test case

Signed-off-by: Tomasz Wojdat <tpwojdat@gmail.com>
2 years agohexdump: add '--one-byte-hex' format option
Tomasz Wojdat [Tue, 16 May 2023 18:10:13 +0000 (20:10 +0200)] 
hexdump: add '--one-byte-hex' format option

Signed-off-by: Tomasz Wojdat <tpwojdat@gmail.com>
2 years agoMerge branch 'chown' of https://github.com/mbeijen/util-linux
Karel Zak [Mon, 15 May 2023 10:18:17 +0000 (12:18 +0200)] 
Merge branch 'chown' of https://github.com/mbeijen/util-linux

* 'chown' of https://github.com/mbeijen/util-linux:
  Use non-deprecated chown syntax

2 years agoMerge branch 'po-man/warning' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 15 May 2023 07:41:11 +0000 (09:41 +0200)] 
Merge branch 'po-man/warning' of https://github.com/t-8ch/util-linux

* 'po-man/warning' of https://github.com/t-8ch/util-linux:
  po-man: add warning for replaced unicode dashes

2 years agobuild: align build-time checks between meson and autotools
Thomas Weißschuh [Sun, 14 May 2023 16:35:30 +0000 (18:35 +0200)] 
build: align build-time checks between meson and autotools

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomount: (tests) reuse well-known per-test fstab location
Thomas Weißschuh [Sat, 22 Apr 2023 15:50:03 +0000 (17:50 +0200)] 
mount: (tests) reuse well-known per-test fstab location

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: (functions.sh) use per-test fstab file
Thomas Weißschuh [Sat, 22 Apr 2023 15:20:45 +0000 (17:20 +0200)] 
tests: (functions.sh) use per-test fstab file

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomount: (tests) explicitly use test fstab location
Thomas Weißschuh [Sat, 22 Apr 2023 15:34:28 +0000 (17:34 +0200)] 
mount: (tests) explicitly use test fstab location

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: (functions.sh) create variable for test fstab location
Thomas Weißschuh [Sat, 22 Apr 2023 15:48:58 +0000 (17:48 +0200)] 
tests: (functions.sh) create variable for test fstab location

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoUse non-deprecated chown syntax
Chris Hofstaedtler [Tue, 12 Apr 2022 15:41:05 +0000 (15:41 +0000)] 
Use non-deprecated chown syntax

Closes: #1007139
2 years agopo-man: add warning for replaced unicode dashes
Thomas Weißschuh [Fri, 12 May 2023 08:00:34 +0000 (10:00 +0200)] 
po-man: add warning for replaced unicode dashes

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomkswap: implement --offset
Thomas Weißschuh [Fri, 28 Apr 2023 18:42:01 +0000 (20:42 +0200)] 
mkswap: implement --offset

Addresses #2166

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomkswap: (tests) don't overwrite logfiles
Thomas Weißschuh [Fri, 28 Apr 2023 18:32:00 +0000 (20:32 +0200)] 
mkswap: (tests) don't overwrite logfiles

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomkswap: (tests) validate existence of truncate command
Thomas Weißschuh [Fri, 28 Apr 2023 18:31:43 +0000 (20:31 +0200)] 
mkswap: (tests) validate existence of truncate command

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibfdisk: fix fdisk_check_collisions return code
Karel Zak [Thu, 11 May 2023 08:37:54 +0000 (10:37 +0200)] 
libfdisk: fix fdisk_check_collisions return code

The return code (>0) is nowhere in the library used, but let's be
compatible with function comment ;-)

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibfdisk: fix wipe-partition feature
Karel Zak [Thu, 11 May 2023 07:44:37 +0000 (09:44 +0200)] 
libfdisk: fix wipe-partition feature

Addresses: https://github.com/util-linux/util-linux/issues/2216
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'tests' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 10 May 2023 13:13:17 +0000 (15:13 +0200)] 
Merge branch 'tests' of https://github.com/t-8ch/util-linux

* 'tests' of https://github.com/t-8ch/util-linux:
  ci: don't try to install kernel modules if they are not available
  ci: update package list before trying to determine package availability
  tools: (asciidoctor-unicodeconverter) don't fix multi manpages
  tools: (asciidoctor-unicodeconverter) properly handle dotted commands

2 years agoci: don't try to install kernel modules if they are not available
Thomas Weißschuh [Wed, 10 May 2023 10:20:05 +0000 (12:20 +0200)] 
ci: don't try to install kernel modules if they are not available

It seems linux-modules-extra-5.15.0-1036-azure got dropped from Ubuntu
repos. Maybe for security reasons.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoci: update package list before trying to determine package availability
Thomas Weißschuh [Wed, 10 May 2023 10:37:45 +0000 (12:37 +0200)] 
ci: update package list before trying to determine package availability

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotools: (asciidoctor-unicodeconverter) don't fix multi manpages
Thomas Weißschuh [Wed, 10 May 2023 10:23:20 +0000 (12:23 +0200)] 
tools: (asciidoctor-unicodeconverter) don't fix multi manpages

The logic does not work for manpages describing multiple subjects, so
skip it for them.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotools: (asciidoctor-unicodeconverter) properly handle dotted commands
Thomas Weißschuh [Wed, 10 May 2023 10:21:24 +0000 (12:21 +0200)] 
tools: (asciidoctor-unicodeconverter) properly handle dotted commands

Split from the end of the docname, as otherwise commands like "fsck.foo"
are stripped of their suffix.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/pager: fix output truncation from buffered stdout
Chris Webb [Tue, 9 May 2023 16:46:00 +0000 (17:46 +0100)] 
lib/pager: fix output truncation from buffered stdout

Commit 518a0ad dropped fflush(stdout) and fflush(stderr) from
wait_for_pager() before STDOUT_FILENO and STDERR_FILENO are closed
because it is called from a signal handler and they are async-unsafe.

However, failure to flush output leads to unwanted truncation when
stdout is fully buffered, which it is by default when we are linked
against musl.

Ensure stdout and stderr are line-buffered before redirecting them to
the pager subprocess to avoid this.

Addresses: https://github.com/util-linux/util-linux/issues/2218
Signed-off-by: Chris Webb <chris@arachsys.com>
2 years agofsck: use BLKID_SUBLKS_BADCSUM
Karel Zak [Tue, 9 May 2023 11:25:09 +0000 (13:25 +0200)] 
fsck: use BLKID_SUBLKS_BADCSUM

We need to be a little bit more promiscuou in fsck to see also
inconsistent superblocks.

It would be possible to do not use libmount to ask for filesystem type
and ask directly libblkid, but libmount is also used to parse fstab
and search in the file and in this case it caches FS tags. It seems
better to continue with libmount to reduce overhead and keep the code
simple.

Addresses: https://github.com/util-linux/util-linux/issues/2214
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: allow overwrite how to use libblkid
Karel Zak [Tue, 9 May 2023 11:21:58 +0000 (13:21 +0200)] 
libmount: allow overwrite how to use libblkid

This is unnecessary for classic mount-like tasks, but application
may use libmount in situation when the default for probing is not
optimal.

Addresses: https://github.com/util-linux/util-linux/issues/2214
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibfdisk: use BLKID_SUBLKS_BADCSUM and BLKID_PARTS_FORCE_GPT
Karel Zak [Tue, 9 May 2023 11:19:20 +0000 (13:19 +0200)] 
libfdisk: use BLKID_SUBLKS_BADCSUM and BLKID_PARTS_FORCE_GPT

Let's keep libblkid in more promiscuous mode to detect more possible
signatures.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'sulogin-term' of https://github.com/DaanDeMeyer/util-linux
Karel Zak [Tue, 9 May 2023 09:21:57 +0000 (11:21 +0200)] 
Merge branch 'sulogin-term' of https://github.com/DaanDeMeyer/util-linux

* 'sulogin-term' of https://github.com/DaanDeMeyer/util-linux:
  sulogin: Don't overwrite TERM if already set

2 years agoMerge branch 'ci/riscv' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 9 May 2023 09:21:37 +0000 (11:21 +0200)] 
Merge branch 'ci/riscv' of https://github.com/t-8ch/util-linux

* 'ci/riscv' of https://github.com/t-8ch/util-linux:
  ci: also build on riscv64
  lsns: (tests) skip test if rtnetlin is nonfunctional

2 years agopo-man: add cs to po4a.cfg
Karel Zak [Tue, 9 May 2023 08:52:02 +0000 (10:52 +0200)] 
po-man: add cs to po4a.cfg

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