Commit graph

18268 commits

Author SHA1 Message Date
Masatake YAMATO
d289149385 lsfd: write more about nsfs in comment
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-05-24 00:49:47 +09:00
Thomas Weißschuh
c345a4002b enosys: add support for loongarch
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-23 17:24:01 +02:00
Thomas Weißschuh
3e0bbb1222 enosys: only build if AUDIT_ARCH_NATIVE is defined
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-23 17:24:01 +02:00
Thomas Weißschuh
e2cd74462e meson: require 0.57
It is needed for fs.read()

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-23 17:24:01 +02:00
Thomas Weißschuh
29e3f73784 enosys: split audit arch detection into dedicated header
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-23 17:24:01 +02:00
Thomas Weißschuh
fc5018e801 enosys: add support for sparc
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-23 16:35:14 +02:00
Thomas Weißschuh
9d48efbbe7 lsfd: (tests) don't run mqueue test on byteorder mismatch
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-23 14:27:48 +02:00
Thomas Weißschuh
ffdd75ccee waitpid: only build when pidfd_open is available
Fixes #2256

[kzak@redhat.com: - fix UL_BUILD_INIT() use]

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-23 12:31:23 +02:00
Karel Zak
fb889bab8b Merge branch 'meson' of https://github.com/eworm-de/util-linux
* 'meson' of https://github.com/eworm-de/util-linux:
  meson: install symlink for vigr man page
  meson: include bash-completion for write
  meson: include bash-completion for newgrp
2023-05-23 12:18:00 +02:00
Karel Zak
c733db6114 Merge branch 'lsfd--mqueue' of https://github.com/masatake/util-linux
* 'lsfd--mqueue' of https://github.com/masatake/util-linux:
  tests: (lsfd) add cases for POSIX Mqueue
  tests: (mkfds) add mqueue factory
  lsfd: fill ENDPOINTS column of POSIX Mqueue
  lsfd: add a new type "mqueue", a type for POSIX Mqueue
2023-05-23 12:17:18 +02:00
Karel Zak
3429accb62 Merge branch 'agetty/fileutils' of https://github.com/t-8ch/util-linux
* 'agetty/fileutils' of https://github.com/t-8ch/util-linux:
  agetty: include fileutils.h
2023-05-23 12:16:31 +02:00
Christian Hesse
f6fb7fa713 meson: install symlink for vigr man page 2023-05-23 12:15:41 +02:00
Christian Hesse
e1cd4002c8 meson: include bash-completion for write 2023-05-23 12:15:41 +02:00
Christian Hesse
f265b43296 meson: include bash-completion for newgrp 2023-05-23 12:15:41 +02:00
Karel Zak
54e94f8669 libmount: cleanup enosys returns from mount hoop
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-23 12:13:02 +02:00
Karel Zak
99550bf5aa Merge branch 'libmount/mount_setattr' of https://github.com/t-8ch/util-linux
* 'libmount/mount_setattr' of https://github.com/t-8ch/util-linux:
  libmount: check for availability of mount_setattr
2023-05-23 12:06:36 +02:00
Karel Zak
9105d3cdd8 fstab: add hint about systemd reload
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-23 11:34:19 +02:00
Karel Zak
a5eba5046d mount: improve code readability
Static analyzers (e.g., Coverity) have a hard time understanding why
'optarg' is tested for NULL, and later in another place, code assumes
that it's non-NULL. For idmapping, the optarg is required.

Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-23 10:47:18 +02:00
Karel Zak
a5e0e06cc2 login: fix memory leak [coverity scan]
Let's use ul_path_read_buffer() to avoid memory allocation.

Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-23 10:43:59 +02:00
Karel Zak
fe0b1e793c libmount: don't call mount.<type> helper with usernames
This is v2.39 regression. The "user" mount option is internally
converted to "user=<name>", but this should not be exported to
the mount helpers.

The mount helper accepts the <name> only if specified in mount options
(cifs uses user=). The real username as generated by libmount is not
relevant in this case.

Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-22 17:26:55 +02:00
Thomas Weißschuh
51a97767db agetty: include fileutils.h
It is needed to access xreaddir()

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-22 17:11:17 +02:00
Masatake YAMATO
d6850a7611 tests: (lsfd) add cases for POSIX Mqueue
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-05-22 23:29:19 +09:00
Masatake YAMATO
330555c481 tests: (mkfds) add mqueue factory
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-05-22 23:29:19 +09:00
Masatake YAMATO
29bcb60ee6 lsfd: fill ENDPOINTS column of POSIX Mqueue
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-05-22 23:29:19 +09:00
Karel Zak
e2d6f5e30e tests: add optlist tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-22 15:40:38 +02:00
Masatake YAMATO
ad0569880f lsfd: add a new type "mqueue", a type for POSIX Mqueue
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-05-22 22:25:57 +09:00
Karel Zak
c0267687fd libmount: fix options prepend/insert and merging
* the order of the new options should not be changed
   (for example prepend "a,b,c" to list with "d" has to generate "a,b,c,d", not "c,b,a,d")

 * make sure that  options map is defined when merging options

Fixes: https://github.com/util-linux/util-linux/issues/2238
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-22 15:00:25 +02:00
Karel Zak
096800a0df Merge branch 'agetty-creds' of https://github.com/DaanDeMeyer/util-linux
* 'agetty-creds' of https://github.com/DaanDeMeyer/util-linux:
  Document new systemd credentials support for agetty and login
  login: Initialize noauth from login.noauth credential
  agetty: Load autologin user from agetty.autologin credential
2023-05-22 13:42:48 +02:00
Karel Zak
59dc323560 Merge branch 'map-users' of https://github.com/arachsys-prs/util-linux
* 'map-users' of https://github.com/arachsys-prs/util-linux:
  mount: add --map-users and --map-groups convenience options
2023-05-22 13:36:37 +02:00
Karel Zak
518026915b Merge branch 'ci/openwrt' of https://github.com/t-8ch/util-linux
* 'ci/openwrt' of https://github.com/t-8ch/util-linux:
  ci: add OpenWrt SDK based CI jobs
  enosys: provide a nicer build message for syscalls.h generation
  libsmartcols: (samples): fix format truncation warning
  test_uuidd: make pthread_t formatting more robust
  mkfs.minix: handle 64bit time on 32bit system
  enosys: add support for MIPS, PowerPC and ARC
  enosys: include sys/syscall.h
2023-05-22 13:32:53 +02:00
Karel Zak
f1cd43964d Merge branch 'enosys/speculation' of https://github.com/t-8ch/util-linux 2023-05-22 13:10:31 +02:00
Karel Zak
c8ecfe1e39 Merge branch 'enosys/mips' of https://github.com/t-8ch/util-linux
* 'enosys/mips' of https://github.com/t-8ch/util-linux:
  enosys: add support for MIPS, PowerPC and ARC
2023-05-22 13:09:28 +02:00
Karel Zak
0045193005 Merge branch 'fadvise/big-page' of https://github.com/t-8ch/util-linux
* 'fadvise/big-page' of https://github.com/t-8ch/util-linux:
  fadvise: (test) test with 64k blocks
  fadvise: (test) don't compare fincore page counts
  fadvise: (tests) factor out calls to "fincore"
  fadvise: (test) dynamically calculate expected test values
2023-05-22 13:06:44 +02:00
Karel Zak
3dae5ca16a Merge branch 'test--fix-process-leak' of https://github.com/masatake/util-linux
* 'test--fix-process-leak' of https://github.com/masatake/util-linux:
  lsfd: (tests) fix process leak
2023-05-22 13:04:08 +02:00
Karel Zak
e20944db44 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
2023-05-22 13:01:58 +02:00
Karel Zak
b39f5764b9 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
2023-05-22 13:00:04 +02:00
Karel Zak
392d864b75 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>
2023-05-22 12:45:06 +02:00
Karel Zak
f644f33089 lib/shells: initialize free-able variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-05-22 12:43:53 +02:00
Karel Zak
8128908d32 Merge branch 'econf' of https://github.com/stoeckmann/util-linux
* 'econf' of https://github.com/stoeckmann/util-linux:
  lib/shells: Plug econf memory leak
2023-05-22 12:42:13 +02:00
Karel Zak
ccd06765ce 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
2023-05-22 12:39:59 +02:00
Karel Zak
cc665f33f4 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
2023-05-22 12:36:45 +02:00
Karel Zak
8a53082787 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
2023-05-22 12:32:07 +02:00
Thomas Weißschuh
ced82526a1 enosys: allow CPU speculation
enosys is not a security tool so we can allow the CPU to speculate.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-22 10:00:13 +02:00
Thomas Weißschuh
1bd85b6463 libmount: check for availability of mount_setattr
If mount_setattr is not available but needed fall back to the legacy
mount API.

Fixes #2247

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-22 09:38:07 +02:00
Masatake YAMATO
47035719fc lsfd: (tests) fix process leak
Unifying multiple invocations of kill command and wait command
into two is suggested by Thomas Weißschuh <thomas@t-8ch.de>.

Addresses: https://lore.kernel.org/util-linux/652d32c5-4b33-ce3a-3de7-9ebc064bbdcb@gmail.com/
Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Tested-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-05-22 06:45:22 +09:00
Thomas Weißschuh
c0f31b79f5 fadvise: (test) test with 64k blocks
This will allow the tests to also pass on systems with 64k pagesizes.

Closes #2249
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-21 21:49:41 +02:00
Thomas Weißschuh
33980996d0 fadvise: (test) don't compare fincore page counts
These depend on the machines pagesize and are therefore not a good
comparision.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-21 21:48:50 +02:00
Thomas Weißschuh
e5009e773f fadvise: (tests) factor out calls to "fincore"
This will make it easier to pass argument later.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-21 21:48:20 +02:00
Thomas Weißschuh
8b36444f44 fadvise: (test) dynamically calculate expected test values
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-05-21 21:48:12 +02:00
Thomas Weißschuh
06e05eb0f7 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>
2023-05-21 20:02:21 +02:00