aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
4 dayslibblkid: make example more robustHEADmasterKarel Zak1-3/+3
Fixes: https://github.com/util-linux/util-linux/issues/3043 Signed-off-by: Karel Zak <kzak@redhat.com>
4 daysMerge branch 'PR/libmount-fix-atime-remount' of ↵Karel Zak1-12/+21
github.com:karelzak/util-linux-work * 'PR/libmount-fix-atime-remount' of github.com:karelzak/util-linux-work: libmount: Fix atime remount for new API
4 daysMerge branch 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linuxKarel Zak1-5/+6
* 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linux: libuuid: fix v6 generation
4 dayslibuuid: drop duplicate assignment liuuid_la_LDFLAGSKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
4 dayslibuuid: fix v6 generationThomas Weißschuh1-5/+6
get_clock_counter() does not return a gregorian timestamp as required for v6. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 dayspam_lastlog2: drop duplicate assignment pam_lastlog2_la_LDFLAGSThomas Weißschuh1-1/+1
The second assignment ends up on the linker/libtool commandline, potentially confusing the tools. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 dayslibmount: Fix atime remount for new APIKarel Zak1-12/+21
All atime settings are mutually exclusive, and the attr_set mask for the mount_setattr() syscall cannot contain multiple MOUNT_ATTR_ atime related options. Unfortunately, during a remount, the list of options is composed of both old and new options. In this case, libmount sets more atime options to the mask. The correct behavior is to use the last atime related option from the list. Fixes: https://github.com/util-linux/util-linux/issues/3032 Signed-off-by: Karel Zak <kzak@redhat.com>
5 daysMerge branch 'uuidv7' of https://github.com/t-8ch/util-linuxKarel Zak12-17/+185
* 'uuidv7' of https://github.com/t-8ch/util-linux: uuidgen: add support for RFC9562 UUIDs uuidparse: add support for RFC9562 UUIDs libuuid: add support for RFC9562 UUIDs
5 daysMerge branch 'pidfd-enosys' of https://github.com/t-8ch/util-linuxKarel Zak1-2/+22
* 'pidfd-enosys' of https://github.com/t-8ch/util-linux: include/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing
5 daysMerge branch 'lsfd--use-new-ul_path-functions' of ↵Karel Zak2-8/+6
https://github.com/masatake/util-linux * 'lsfd--use-new-ul_path-functions' of https://github.com/masatake/util-linux: lsfd: (refactor) use ul_path_statf and ul_path_readlinkf
5 dayswipefs: fix typoKarel Zak1-1/+1
Fixes: https://github.com/util-linux/util-linux/issues/3027 Signed-off-by: Karel Zak <kzak@redhat.com>
5 daysinclude/pidfd-utils: provide ENOSYS stubs if pidfd functions are missingThomas Weißschuh1-2/+22
This allows code which can gracefully fall back to compile. This should fix the CI on Ubuntu 18.04. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 dayslib/path: use _vreadf_buffer for _cpuparse()Thomas Weißschuh1-20/+2
ul_path_vreadf_buffer already provides zero-termination and newline trimming, so make use of it. We now could read more than a single line, but the files this is used on contain only a single line anyways. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 dayslib/path: introduce ul_path_vreadf_bufferThomas Weißschuh2-3/+14
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 dayslsfd: (refactor) use ul_path_statf and ul_path_readlinkfMasatake YAMATO2-8/+6
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
6 dayslib/path: use _read_buffer for _read_string()Thomas Weißschuh1-8/+2
ul_path_read_buffer already provides zero-termination and newline trimming, so make use of it. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
6 daysinclude/pidfd-utils: remove hardcoded syscall fallbackKarel Zak1-13/+0
Based on https://github.com/util-linux/util-linux/pull/3018 The syscall numbers should not be hardcoded in the header file. If we really need them, there is UL_CHECK_SYSCALL() to define the numbers for different architectures. I doubt it's really necessary. Just update your kernel header files to get the latest kernel updates ... Signed-off-by: Karel Zak <kzak@redhat.com>
6 daysMerge branch 'structlceanup' of https://github.com/penguin42/util-linuxKarel Zak1-8/+0
* 'structlceanup' of https://github.com/penguin42/util-linux: cfdisk: Remove unused struct 'cfdisk_extra'
6 daysMerge branch 'fix-column-example' of https://github.com/4KiB/util-linuxKarel Zak1-1/+1
* 'fix-column-example' of https://github.com/4KiB/util-linux: Fix fstab order in `column` manpage example.
6 daysMerge branch 'pidfs-pseudo' of https://github.com/YHNdnzj/util-linuxKarel Zak1-0/+1
* 'pidfs-pseudo' of https://github.com/YHNdnzj/util-linux: libmount/utils: add pidfs to pseudo fs list
6 daysMerge branch 'mkswap-file' of https://github.com/YHNdnzj/util-linuxKarel Zak1-2/+2
* 'mkswap-file' of https://github.com/YHNdnzj/util-linux: mkswap.8.adoc: update note regarding swapfile creation
6 daysMerge branch 'fix' of https://github.com/DaanDeMeyer/util-linuxKarel Zak1-1/+1
* 'fix' of https://github.com/DaanDeMeyer/util-linux: Fix ul_path_read_buffer()
6 daysMerge branch 'flock-test-doc' of https://github.com/Villemoes/util-linuxKarel Zak13-65/+111
* 'flock-test-doc' of https://github.com/Villemoes/util-linux: tests: add --fcntl testing to flock tests: prepare flock for testing --fcntl flock: document --fcntl flock: bash-completion: add --fcntl
6 daysMerge branch 'meson-fix-Python.h-check' of ↵Karel Zak2-26/+32
https://github.com/jwillikers/util-linux * 'meson-fix-Python.h-check' of https://github.com/jwillikers/util-linux: meson: Correctly require the Python.h header for the python dependency meson: Only require Python module when building pylibmount meson: Fix build-python option
6 daysMerge branch 'lsns--refactor-related-to-2987' of ↵Karel Zak3-125/+185
https://github.com/masatake/util-linux * 'lsns--refactor-related-to-2987' of https://github.com/masatake/util-linux: lsns: (refactor) use ls_path_{openf|statf} to make the code simple lib/path: add ul_path_statf() and ul_path_vstatf() lsns: verify the uniqueness of a namespace in ls->namespaces list lsns: (refactor) make the function names for reading namespaces consistent lsns: (refactor) rename read_related_namespaces to connect_namespaces lsns: (refactor) rename get_ns_ino() to get_ns_inos() lsns: (refactor) use get_{parent|owner}_ns_ino() in add_namespace_for_nsfd lsns: (refactor) add get_{parent|owner}_ns_ino() implementing some parts of get_ns_ino() lsns: (refactor) give a enumeration name 'lsns_type' to LSNS_TYPE_ enumerators lsns: (refactor) rename LSNS_ID_.* to LSNS_TYPE_.*
6 dayscfdisk: Remove unused struct 'cfdisk_extra'Dr. David Alan Gilbert1-8/+0
'cfdisk_extra' looks unused since it's original commit (I think because it ended up using libscols instead). Remove it. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
7 daysFix fstab order in `column` manpage example.Rom1-1/+1
fstab is: 1. fs_spec 2. fs_file 3. fs_vfstype 4. fs_mntops 5. fs_freq 6. fs_passno In other words it's: SOURCE,TARGET,TYPE,OPTIONS,FREQ,PASS
8 dayslibmount/utils: add pidfs to pseudo fs listMike Yuan1-0/+1
8 daysmkswap.8.adoc: update note regarding swapfile creationMike Yuan1-2/+2
Follow-up for 7377b0d99560460806eab9efa9d8224d084c2082 (the addition of --file option)
9 daysuuidgen: add support for RFC9562 UUIDsThomas Weißschuh5-2/+39
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
9 daysuuidparse: add support for RFC9562 UUIDsThomas Weißschuh3-2/+21
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
9 dayslibuuid: add support for RFC9562 UUIDsThomas Weißschuh4-13/+125
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
9 daysmeson: Correctly require the Python.h header for the python dependencyJordan Williams1-0/+5
The current solution to require the Python.h header works around a bug in Meson that has been fixed for version 1.4.1 of Meson. Refer to https://github.com/mesonbuild/meson/issues/12862. This change uses an explicit check for the Python.h include. This verifies the required header exists. This check is only necessary prior to version 1.4.1 of Meson. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
9 daysmeson: Only require Python module when building pylibmountJordan Williams2-6/+7
Only the python executable is required for tests. Version 1.4.1 of Meson will require the Python.h for find_installation. This will result in the tests requiring Python.h unnecessarily. Use find_program to find the Python program for the tests instead. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
9 daysmeson: Fix build-python optionJordan Williams1-20/+20
The build-python option is for controlling whether or not pylibmount is built. Unfortunately, commit b6799cc rendered the option unused. This change uses the build-python option again. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
10 daysFix ul_path_read_buffer()Daan De Meyer1-1/+1
The current implementation cuts off the last character of the buffer if there is no trailing newline.
10 daystests: add --fcntl testing to flockRasmus Villemoes11-1/+29
All the existing tests are also done with --fcntl in effect, and then we add one more test, namely that a flock(2) lock can be be obtained even while a fcntl(2) lock is held - not that anyone should ever need that, but it does show that the lock types are completely independent.
10 daystests: prepare flock for testing --fcntlRasmus Villemoes2-65/+76
Prepare the test script for doing all the same things, but with --fcntl in effect. The diff is much smaller when viewed with git show -w.
10 daysflock: document --fcntlRasmus Villemoes1-1/+7
I'm not sure how much technical detail/symbolic constants to include in the explanation.
10 daysflock: bash-completion: add --fcntlRasmus Villemoes1-0/+1
2024-05-03lsns: (refactor) use ls_path_{openf|statf} to make the code simpleMasatake YAMATO1-10/+4
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-03lib/path: add ul_path_statf() and ul_path_vstatf()Karel Zak2-0/+22
Signed-off-by: Karel Zak <kzak@redhat.com> (cherry picked from commit 9b47899495e229ace482afca9e14b9b95ef6fde9)
2024-05-02hwclock: free temporary variable before returnKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02agetty: make reload code more robustKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02libmount: fix possible memory leakKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02wall: check sysconf() returnvalueKarel Zak1-2/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02getopt: remove free-before-exitKarel Zak1-1/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02fsck.minix: fix possible overrunKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02agetty: fix resource leakKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02suL fix use after free on errorKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02cal: use unsigned int to follow union with unsigned intKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02wall: fix possible memory leakKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02hwclock: initialize parser variablesKarel Zak1-5/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02lsclocks: fix FD leakKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02libfdisk: add initializer to geometryKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02wall: make sure unsigned variable not underflowKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-05-02lsns: verify the uniqueness of a namespace in ls->namespaces listMasatake YAMATO1-0/+2
In read_open_ns_inos(), a namespace is added to the list without verifying its uniqueness in the list. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-02lsns: (refactor) make the function names for reading namespaces consistentMasatake YAMATO1-18/+32
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-02lsns: (refactor) rename read_related_namespaces to connect_namespacesMasatake YAMATO1-2/+2
read_related_namespaces() itself doesn't read names of new namespaces. Connecting namespaces for making a tree is the the main job the function. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-02lsns: (refactor) rename get_ns_ino() to get_ns_inos()Masatake YAMATO1-4/+4
The function gets three inode numbers. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-02lsns: (refactor) use get_{parent|owner}_ns_ino() in add_namespace_for_nsfdMasatake YAMATO1-27/+10
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-02lsns: (refactor) add get_{parent|owner}_ns_ino() implementing some parts of ↵Masatake YAMATO1-31/+72
get_ns_ino() get_ns_ino() returns three inode numbers. The code for the two of three, inodes for PARENT and USERNS, is moved to the new functions. So we can reuse the code in other places in lsns. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-02lsns: (refactor) give a enumeration name 'lsns_type' to LSNS_TYPE_ enumeratorsMasatake YAMATO1-10/+14
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-05-01Merge branch 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-workKarel Zak1-3/+8
* 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-work: libsmartcols: fix column reduction
2024-05-01Merge branch 'bcachefs_correct_max_size_constant' of ↵Karel Zak1-5/+0
https://github.com/tasleson/util-linux * 'bcachefs_correct_max_size_constant' of https://github.com/tasleson/util-linux: bcachefs: Remove BCACHEFS_SB_MAX_SIZE & check
2024-05-01Merge branch 'lsfd/fcntl' of https://github.com/t-8ch/util-linuxKarel Zak5-12/+12
* 'lsfd/fcntl' of https://github.com/t-8ch/util-linux: lsfd: include buffer.h in decode-file-flags.h buffer: replace include of c.h with stddef.h lsfd: move interface of decode-file-flags to header
2024-05-01lsns: (refactor) rename LSNS_ID_.* to LSNS_TYPE_.*Masatake YAMATO1-30/+30
Functions taking LSNS_ID_ as arguments have .*_lsns_type_.* or .*_type_.* as parts of their name. This implies the prefix LSNS_TYPE_ is more consistent than LSNS_ID_. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-30bcachefs: Remove BCACHEFS_SB_MAX_SIZE & checkTony Asleson1-5/+0
This constant had an incorrect value. However, the code already does a max. size check which is correct. Note: bcachefs can theoretically have a superblock of 32MiB, but this is very unlikely to happen. Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-04-30libsmartcols: fix column reductionKarel Zak1-3/+8
4013986: libsmartcols: TAB: [0x5626b97f8e10]: #5 reduce stage (width=38, term=1) 4013986: libsmartcols: COL: [0x5626b97f9130]: [01] (null) reduced 2-->18446744073709551615 Fixes: https://github.com/util-linux/util-linux/issues/3003 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-29losetup.8: Clarify --direct-ioColin Walters1-1/+1
See e.g. https://github.com/containers/bootc/pull/375#issuecomment-1981109022 The phrasing here was in my opinion technically correct but quite confusing and easy to misunderstand. Let's be very clear: - The default is *off* - You can turn it on in two ways - You can also explicitly turn it off Signed-off-by: Colin Walters <walters@verbum.org>
2024-04-29lastlog2: begin descriptions of options with a lowercase letterBenno Schulenberg1-9/+9
These descriptions are not full sentences and do not end with a period, so they should not start with a capital either. (cherry picked from commit 991cb1568a7b3770e33d68c4df49a97068ac8588)
2024-04-29textual: fix some typos and inconsistencies in usage and error messagesBenno Schulenberg8-10/+10
Reported-by: Petr Pisar <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@telfort.nl> (cherry picked from commit eeeb3dc9e662c8cf0383fb109bc5e7d2e2fa7a98)
2024-04-29Merge branch 'lsfd/fcntl.h' of https://github.com/t-8ch/util-linuxKarel Zak3-15/+5
* 'lsfd/fcntl.h' of https://github.com/t-8ch/util-linux: lsfd: include linux/fcntl.h
2024-04-29Merge branch 'lsns--debug-ioctl_ns-test-for-master' of ↵Karel Zak2-1/+5
https://github.com/masatake/util-linux * 'lsns--debug-ioctl_ns-test-for-master' of https://github.com/masatake/util-linux: tests: (lsns::ioctl_ns) add more debug print tests: (lsns::ioctl_ns) record stdout/stderr for debugging the case
2024-04-29Merge branch 'PR/flock-fcntl' of github.com:karelzak/util-linux-workKarel Zak1-2/+76
* 'PR/flock-fcntl' of github.com:karelzak/util-linux-work: flock: add support for using fcntl() with open file description locks
2024-04-29coresched: Manage core scheduling cookies for tasksThijs Raymakers17-6/+626
Co-authored-by: Phil Auld <pauld@redhat.com> Signed-off-by: Phil Auld <pauld@redhat.com> Signed-off-by: Thijs Raymakers <thijs@raymakers.nl> Signed-off-by: Karel Zak <kzak@redhat.com> Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-29lsfd: include linux/fcntl.hThomas Weißschuh3-15/+5
asm/-headers are implementation details and not meant to be included directly. Instead use the linux/ header which will always include the correct asm/-headers. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-28lsfd: include buffer.h in decode-file-flags.hThomas Weißschuh2-9/+1
buffer.h does not pull in the full c.h with it side-effects, so it can be used now. Drop the now unnecessary extern declarations. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-28buffer: replace include of c.h with stddef.hThomas Weißschuh1-1/+1
The interface of the buffer library only requires size_t. It's enough to include stddef.h for that. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-28lsfd: move interface of decode-file-flags to headerThomas Weißschuh4-3/+11
Use a proper header file to declare lsfd_decode_file_flags(). Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-26flock: add support for using fcntl() with open file description locksRasmus Villemoes1-2/+76
Currently, there is no way for shell scripts to safely access resources protected by POSIX locking (fcntl with the F_SETLK/F_SETLKW commands). For example, the glibc function lckpwdf(), used to protect access to the /etc/shadow database, works by taking a F_SETLKW on /etc/.pwd.lock . Due to the odd semantics of POSIX locking (e.g. released when any file descriptor associated to the inode is closed), we cannot usefully directly expose the POSIX F_SETLK/F_SETLKW commands. However, linux 3.15 introduced F_OFD_SETLK[W], with semantics wrt. ownership and release better matching those of flock(2), and crucially they do conflict with locks obtained via F_SETLK[W]. With this, a shell script can do exec 4> /etc/.pwd.lock flock --fcntl 4 <access/modify /etc/shadow ...> flock --fcntl --unlock 4 # or just exit without conflicting with passwd(1) or other utilities that access/modify /etc/shadow. No single-letter shorthand is defined for the option, because this is somewhat low-level and the user really needs to know what he is doing. Also, this leaves the door open for teaching --fcntl to accept an optional argument: "ofd", the default, and "posix", should anyone find a use for flock(1) taking a F_SETLK[W] lock. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-04-26tests: (lsns::ioctl_ns) add more debug printMasatake YAMATO1-0/+4
Signed-off-by: Masatake YAMATO <yamato@redhat.com> (cherry picked from commit 380120a07154d9447edc703d628416c717493b7d)
2024-04-26tests: (lsns::ioctl_ns) record stdout/stderr for debugging the caseMasatake YAMATO2-1/+1
When the test case runs successfully, we expect the case test prints nothing to stderr. If something is printed to stderr, it helps us debug lsns command and the test case. Signed-off-by: Masatake YAMATO <yamato@redhat.com> (cherry picked from commit 82ecf6cf5495f43716fbe9d72411d8bd5994f75d)
2024-04-25Merge branch 'meson-more-build-options' of ↵Karel Zak4-99/+191
https://github.com/jwillikers/util-linux * 'meson-more-build-options' of https://github.com/jwillikers/util-linux: (21 commits) meson: Add build-lsclocks option meson: Add build-enosys option meson: Define _DARWIN_C_SOURCE on macOS as is done in Autotools strutils.h: Include strings.h header for strncasecmp function xalloc.h: Include stdio.h header for vasprintf function meson: Fix build by default and install behavior for build-pipesz option meson: Add build-fadvise option meson: Add build-scriptlive option meson: Add build-script option meson: Require pty for the su and runuser executables meson: Add have_pty variable to check if pty is available meson: Add build-blockdev option meson: Add build-chcpu option meson: Use has_type instead of sizeof to detect cpu_set_t type meson: Add build-setarch option meson: Add build-rtcwake option meson: Add build-ldattach option meson: Add build-blkdiscard option meson: Add build-fsfreeze option meson: Add build-blkzone option ...
2024-04-24meson: Add build-lsclocks optionJordan Williams2-3/+9
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-enosys optionJordan Williams2-13/+18
Add a check to ensure that the linux/audit.h header exists for enosys. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Define _DARWIN_C_SOURCE on macOS as is done in AutotoolsJordan Williams1-0/+4
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24strutils.h: Include strings.h header for strncasecmp functionJordan Williams1-0/+1
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24xalloc.h: Include stdio.h header for vasprintf functionJordan Williams1-0/+1
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Fix build by default and install behavior for build-pipesz optionJordan Williams1-2/+3
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-fadvise optionJordan Williams2-2/+8
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-scriptlive optionJordan Williams2-4/+10
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-script optionJordan Williams2-6/+14
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Require pty for the su and runuser executablesJordan Williams1-2/+2
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add have_pty variable to check if pty is availableJordan Williams1-4/+4
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-blockdev optionJordan Williams2-3/+10
Only build blockdev on Linux. The BLKROSET macro is used in blockdev.c from blkdev.h. The blkdev.h header only defines this macro when it is missing on Linux. Add blockdev to the list of executables, which appears to have been omitted previously. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-chcpu optionJordan Williams2-4/+10
The cpu_set_t type does not exist on macOS. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Use has_type instead of sizeof to detect cpu_set_t typeJordan Williams1-2/+1
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-setarch optionJordan Williams2-23/+31
The sys/personality.h header does not exist on macOS. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-rtcwake optionJordan Williams2-4/+10
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-ldattach optionJordan Williams2-4/+10
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-blkdiscard optionJordan Williams2-6/+14
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24meson: Add build-fsfreeze optionJordan Williams2-4/+10
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-24docs: fix GPL name typoKarel Zak23-113/+113
References: https://github.com/util-linux/util-linux/pull/2988 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-24Merge branch 'lsfd' of https://github.com/jwilk-forks/util-linuxKarel Zak1-12/+12
* 'lsfd' of https://github.com/jwilk-forks/util-linux: lsfd: (man) add commas between SEE ALSO items lsfd: (man) fix license name lsfd: (man) fix typos
2024-04-24Merge branch 'PR/libmount-fix-umount-r' of github.com:karelzak/util-linux-workKarel Zak1-0/+4
* 'PR/libmount-fix-umount-r' of github.com:karelzak/util-linux-work: libmount: fix umount --read-only
2024-04-23Merge branch 'PR/lsns-fix-netns' of github.com:karelzak/util-linux-workKarel Zak1-0/+3
* 'PR/lsns-fix-netns' of github.com:karelzak/util-linux-work: lsns: fix netns use
2024-04-23Merge branch 'PR/libmount-utab-access' of github.com:karelzak/util-linux-workKarel Zak1-2/+1
* 'PR/libmount-utab-access' of github.com:karelzak/util-linux-work: libmount: Fix access check for utab in context
2024-04-23libmount: fix umount --read-onlyKarel Zak1-0/+4
Reported-by: Krzysztof Olędzki <ole@ans.pl> Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-22lsfd: (man) add commas between SEE ALSO itemsJakub Wilk1-9/+9
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2024-04-22lsfd: (man) fix license nameJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2024-04-22lsfd: (man) fix typosJakub Wilk1-2/+2
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2024-04-22meson: Add build-blkzone optionJordan Williams2-8/+12
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-22meson: Add build-blkpr optionJordan Williams2-8/+12
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-22lsns: fix netns useKarel Zak1-0/+3
# ip netns add vpn # lsns -T -t net Segmentation fault (core dumped) The function interpolate_missing_namespaces() reads data from /proc. However, in the case of a persistent namespace, there is no procfs entry for the namespace. Therefore, this function should ignore it. Fixes: https://github.com/util-linux/util-linux/issues/2982 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-22libfdisk: add missing va_end() [coverity scan]Karel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-22libmount: Fix access check for utab in contextKarel Zak1-2/+1
The function mnt_has_regular_utab() properly detects that the utab is not writable, but this is ignored by the high-level context API. As a result, the library later attempts to update the file and ends up with a warning in mount(8): $ mkdir sys $ unshare --map-root-user --mount $ mount --rbind /sys sys $ umount --lazy sys; echo $? umount: /home/user/sys: filesystem was unmounted, but failed to update userspace mount table. 16 In this case, the utab should be ignored. Fixes: https://github.com/util-linux/util-linux/issues/2981 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-22Merge branch 'typofix' of https://github.com/uudiin/util-linuxKarel Zak1-1/+1
* 'typofix' of https://github.com/uudiin/util-linux: libmount: fix comment typo for mnt_fs_get_comment()
2024-04-22Merge branch 'fix' of https://github.com/DaanDeMeyer/util-linuxKarel Zak1-1/+2
* 'fix' of https://github.com/DaanDeMeyer/util-linux: agetty: Don't override TERM passed by the user
2024-04-22Merge branch 'lsns--filter-option-in-usage' of ↵Karel Zak2-0/+2
https://github.com/masatake/util-linux * 'lsns--filter-option-in-usage' of https://github.com/masatake/util-linux: lsns: add --filter option to the --help optout and the completion rule
2024-04-22Merge branch 'meson-build-dmesg' of https://github.com/jwillikers/util-linuxKarel Zak2-3/+7
* 'meson-build-dmesg' of https://github.com/jwillikers/util-linux: meson: Add build-dmesg option
2024-04-22Merge branch 'meson-fix-absolute-check' of ↵Karel Zak1-1/+1
https://github.com/jwillikers/util-linux * 'meson-fix-absolute-check' of https://github.com/jwillikers/util-linux: meson: Use is_absolute to determine if the prefix directory is absolute
2024-04-22lsblk: simplify SOURCES codeKarel Zak2-6/+4
This complicated implementation originated from an early version of zero-separated items for libsmartcols. It is no longer necessary. References: https://github.com/util-linux/util-linux/pull/2983 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-22libmount: fix comment typo for mnt_fs_get_comment()Tianjia Zhang1-1/+1
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
2024-04-21findmnt: always zero-terminate SOURCES dataThomas Weißschuh1-4/+1
libsmartcols expects it's data fields to be zero terminated. See the call to strlen() in scols_column_greatest_wrap(). ul_buffer however does not guarantee that termination, ul_buffer_append_strings() discard the zero-termination. Always zero-terminate in get_data_col_sources() and drop the now unnecessary variable "i". Closes: https://github.com/util-linux/util-linux/issues/2980 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-19agetty: Don't override TERM passed by the userDaan De Meyer1-1/+2
Before 4869b259d68f65ea88df625ce8df9c0177d55a01, any TERM passed on the agetty command line would be used instead of the default TERM. After 4869b259d68f65ea88df625ce8df9c0177d55a01, the default TERM is used unconditionally. Fix the regression by checking if the user passed a custom TERM. Fixes: 4869b259d68f65ea88df625ce8df9c0177d55a01
2024-04-20lsns: add --filter option to the --help optout and the completion ruleMasatake YAMATO2-0/+2
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-18meson: Add build-dmesg optionJordan Williams2-3/+7
Require the sys/klog.h header to exist in order to enable the feature. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-18meson: Use is_absolute to determine if the prefix directory is absoluteJordan Williams1-1/+1
Meson's check for an absolute path does not work on Windows. Meson 0.54.0 introduced the fs.is_absolute function. Use this instead. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-18docs: update READMEKarel Zak1-42/+36
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-18Merge branch 'meson-fix-build-ipcrm-option' of ↵Karel Zak2-9/+21
https://github.com/jwillikers/util-linux * 'meson-fix-build-ipcrm-option' of https://github.com/jwillikers/util-linux: meson: Require the seminfo type for ipcmk, ipcrm, and ipcs meson: Add build-ipcmk option meson: Add missing check for build-ipcrm option
2024-04-18Merge branch 'PR/from-coverity' of github.com:karelzak/util-linux-workKarel Zak2-3/+2
* 'PR/from-coverity' of github.com:karelzak/util-linux-work: lslocks: remove deadcode [coverity scan] hardlink: use xcalloc rather than xmalloc
2024-04-18Merge branch 'uuid/variant' of https://github.com/t-8ch/util-linuxKarel Zak2-21/+23
* 'uuid/variant' of https://github.com/t-8ch/util-linux: uuidparse: only report type/version for DCE variant
2024-04-18Merge branch 'PR/fdisk-trim' of github.com:karelzak/util-linux-workKarel Zak10-34/+305
* 'PR/fdisk-trim' of github.com:karelzak/util-linux-work: blkdiscard: (man) add note about fdisk fdisk: add 'T' command to discard sectors libfdisk: add fdisk_ask_menu() fdisk: improve list_freespace()
2024-04-17meson: Require the seminfo type for ipcmk, ipcrm, and ipcsJordan Williams1-3/+5
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-17meson: Add build-ipcmk optionJordan Williams2-4/+10
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-17meson: Add missing check for build-ipcrm optionJordan Williams1-4/+8
The build-ipcrm option exists in meson_options.txt but has no effect. Use the option to gate building the ipcrm executable. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-17Merge branch 'sed' of https://github.com/t-8ch/util-linuxKarel Zak5-10/+10
* 'sed' of https://github.com/t-8ch/util-linux: all_errnos/all_syscalls: use sed to extract defines from headers
2024-04-17lslocks: remove deadcode [coverity scan]Karel Zak1-2/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-17hardlink: use xcalloc rather than xmallocKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-17Merge branch 'PR/libsmartcols-fix-wrap' of github.com:karelzak/util-linux-workKarel Zak4-9/+60
* 'PR/libsmartcols-fix-wrap' of github.com:karelzak/util-linux-work: libsmartcols: (sample) add wrap repeating example libsmartcols: reset wrap after calculation
2024-04-17blkdiscard: (man) add note about fdiskKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-17fdisk: add 'T' command to discard sectorsKarel Zak3-2/+147
We currently have blkdiscard(8), but it can be difficult to use for unpartitioned areas or for partitions when working with a whole-disk device. This commit adds BLKDISCARD support to fdisk, so that the user does not have to specify any range, but instead follows the partition table. Addresses: https://github.com/util-linux/util-linux/issues/2804 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-17libfdisk: add fdisk_ask_menu()Karel Zak4-0/+54
Currently, only libfdisk has the ability to prompt the user with a menu. However, this functionality is not accessible through the public library API. This commit exports this functionality through the use of a simple function, fdisk_ask_menu(). Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-17uuidparse: only report type/version for DCE variantThomas Weißschuh2-21/+23
The type/version is only defined in scope for the DCE variant. From RFC4122 Section 4.1.1: "the interpretation of all other bits in the UUID depends on the setting of the bits in the variant field." Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-17fdisk: improve list_freespace()Karel Zak2-32/+102
Make the function usable in other dialogs: * Return a table of the free spaces. * Return the "best" table entry (to be used as the default in dialogs). * Print the order number of entries. Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-17lsfd: add meson.build for the commandMasatake YAMATO1-0/+14
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-16all_errnos/all_syscalls: use sed to extract defines from headersThomas Weißschuh5-10/+10
Posix-compliant awk does not seem capable of matching lines and extracting capture groups of them. Use sed instead. Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Link: https://lore.kernel.org/util-linux/051624b9256db27a731d62c031cb627d9f5a256e.camel@physik.fu-berlin.de/ Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-16lsfd: (po-man) update po4a.cfgKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-16Merge branch 'lsfd-cmd--dir' of https://github.com/masatake/util-linuxKarel Zak19-46/+32
* 'lsfd-cmd--dir' of https://github.com/masatake/util-linux: lsfd: move the source code to new ./lsfd-cmd directory
2024-04-16Merge branch 'getwc' of https://github.com/t-8ch/util-linuxKarel Zak16-18/+49
* 'getwc' of https://github.com/t-8ch/util-linux: textutils: introduce and use fgetwc_or_err treewide: use fgetc() instead of getc() textutils: use fgetwc() instead of getwc()
2024-04-16Merge branch 'awk' of https://github.com/t-8ch/util-linuxKarel Zak5-8/+18
* 'awk' of https://github.com/t-8ch/util-linux: all_errnos/all_syscalls: don't hardcode AWK invocation all_errnos/all_syscalls: don't warn during cleanup all_errnos/all_syscalls: fail if any step fails
2024-04-16Merge branch 'patch-1' of https://github.com/I-use-Arch-btw-00111/util-linuxKarel Zak1-3/+3
* 'patch-1' of https://github.com/I-use-Arch-btw-00111/util-linux: (minor) update sulogin.c
2024-04-16libsmartcols: (sample) add wrap repeating exampleKarel Zak2-0/+42
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-16libsmartcols: reset wrap after calculationKarel Zak2-9/+18
Fixes: https://github.com/util-linux/util-linux/issues/2956 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-16all_errnos/all_syscalls: don't hardcode AWK invocationThomas Weißschuh5-6/+14
Use the buildsystem to find a usable awk implementation and use that. Reported-by: Firas Khalil Khana <firasuke@gmail.com> Link: https://github.com/util-linux/util-linux/pull/2949 Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> https://lore.kernel.org/util-linux/31ccace2e5912ffc428e065cd66764088c625c4d.camel@physik.fu-berlin.de/ Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-16all_errnos/all_syscalls: don't warn during cleanupThomas Weißschuh2-2/+2
On failure the output files may not have been created. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-16all_errnos/all_syscalls: fail if any step failsThomas Weißschuh2-0/+2
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-15(minor) update sulogin.cLeaflet1-3/+3
Make the root password prompt more technical
2024-04-15libsmartcols: (filter) emulate YYerror for old BisonKarel Zak2-3/+7
The special YYerror token is supported in Bison 3.6 and above. Fortunately, it is possible to emulate this functionality in older versions as well. Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-15libsmartcols: (filter) check vasprintf() return valueKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-15libsmartcols: (filter) accept prefixes like k, M, G as a parts of a numberKarel Zak2-2/+30
Co-Author: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-15libsmartcols: (filter) use variable argument lists for yyerror()Karel Zak1-5/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-15libsmartcols; (filter) make libscols_filter accessible in lexKarel Zak2-0/+3
In the reentrant parser, we cannot easily extend the argument list for yylex() using %lex-param. Instead, we must use a lex-extra pointer. Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-15lsfd: move the source code to new ./lsfd-cmd directoryMasatake YAMATO19-46/+32
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-15tests: (lsfd) don't refer "$?" on the line follwoing the use of "local"Masatake YAMATO1-2/+7
Suggested by ShellCheck. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-15tests: (functions.sh) add a helper funcion making a device number from given ↵Masatake YAMATO2-1/+16
major and minor nums Fixes #2919. Suggested by Karel Zak <kzak@redhat.com>. The original code used an obsolete formula to make a device number from given major and minor numbers. ts_device_make is a new helper function based on the formula of __SYSMACROS_DEFINE_MAKEDEV macro defined in /usr/include/bits/sysmacros.h of GNU libc. Suggested by Karel Zak <kzak@redhat.com> in #2919. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-15Merge branch 'pager/less-quirk' of https://github.com/t-8ch/util-linuxKarel Zak1-9/+3
* 'pager/less-quirk' of https://github.com/t-8ch/util-linux: Revert "lib/pager: Apply pager-specific fixes only when needed"
2024-04-15Merge branch 'lslocks--no-sleep-in-test-case' of ↵Karel Zak2-18/+4
https://github.com/masatake/util-linux * 'lslocks--no-sleep-in-test-case' of https://github.com/masatake/util-linux: lslocks: remove a unused local variable lslocks: don't abort gathering per-process information even if opening a /proc/[0-9]* fails
2024-04-15Merge branch 'PR/autotools' of github.com:karelzak/util-linux-workKarel Zak1-1/+13
* 'PR/autotools' of github.com:karelzak/util-linux-work: autotools: add --disable-enosys, check for linux/audit.h autotools: check for sys/vfs.h and linux/bpf.h
2024-04-15Merge branch 'fix-mnt-update' of https://github.com/gavinhungry/util-linuxKarel Zak1-3/+3
* 'fix-mnt-update' of https://github.com/gavinhungry/util-linux: Fix misplaced else in mnt_update_already_done
2024-04-15Merge branch 'meson-version-script-libblkid' of ↵Karel Zak2-4/+20
https://github.com/jwillikers/util-linux * 'meson-version-script-libblkid' of https://github.com/jwillikers/util-linux: meson: Only use the --version-script linker flag where it is supported
2024-04-15Merge branch 'meson-fix-libmount-libblkid-feature-dep' of ↵Karel Zak1-1/+1
https://github.com/jwillikers/util-linux * 'meson-fix-libmount-libblkid-feature-dep' of https://github.com/jwillikers/util-linux: meson: Remove libblkid dependency on libmount
2024-04-15Merge branch 'meson-have-sys-vfs-header' of ↵Karel Zak1-2/+7
https://github.com/jwillikers/util-linux * 'meson-have-sys-vfs-header' of https://github.com/jwillikers/util-linux: meson: Require the sys/vfs.h header for libmount and fstrim
2024-04-15Merge branch 'zlib-disabler' of https://github.com/jwillikers/util-linuxKarel Zak1-0/+1
* 'zlib-disabler' of https://github.com/jwillikers/util-linux: meson: Make the zlib dependency a disabler when not found
2024-04-15Merge branch 'tinfo-disabler' of https://github.com/jwillikers/util-linuxKarel Zak1-0/+2
* 'tinfo-disabler' of https://github.com/jwillikers/util-linux: meson: Make ncurses dependency a disabler when not found meson: Make tinfo dependency a disabler when not found
2024-04-15tests: (lsns::filedesc) skip if NS_GET_NSTYPE ioctl cmd not availableMasatake YAMATO2-1/+25
Currently, Qemu userspace emulation doesn't support the ioctl cmd. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-15lsns: report with warnx if a namespace related ioctl fails with ENOSYSMasatake YAMATO1-1/+1
Qemu userspace emulation reports ENOSYS if it doesn't support a given ioctl command. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-15lsns: fill the netsid member of lsns_process with reliable valueMasatake YAMATO1-1/+2
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-15lsns: tolerate lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failing with ENOSYSMasatake YAMATO1-2/+10
With the original code, "lsns/filedesc" test case failed on "build (qemu-user, s390x)" and "build (qemu-user, riscv64)". On the platforms, lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failed with ENOSYS. The error stoped the iteration for gathering information from /proc/[0-9]+. As a result, lsns printed nothing. We don't expect this behavior. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-13textutils: introduce and use fgetwc_or_errThomas Weißschuh13-14/+45
A return value of WEOF of fgetwc() can either mean end-of-file or an error in errno. The error was ignored and interpreted as end-of-file. Introduce a new helper that aborts on error and use it in text-utils. This replaces all calls to plain fgetwc(). Closes #2909 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-13treewide: use fgetc() instead of getc()Thomas Weißschuh3-4/+4
fgetc() is similar to getc() but is guaranteed to be a function. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-13textutils: use fgetwc() instead of getwc()Thomas Weißschuh3-9/+9
getwc() has the same semantics as fgetwc() but may be a function or macro. According to the manpage "there is no reason ever to use it". Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-13Revert "lib/pager: Apply pager-specific fixes only when needed"Thomas Weißschuh1-9/+3
Less is not always detectable, as it can be hidden behind symlinks or wrapper as for example in a default Debian installation. Also testing for the literal string "less" does not match full path specifications like "/usr/bin/less". Instead always apply the fixes. This reverts commit c10ad975895372122f72c8d9da089b6ea69f778b. Closes #2951 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-04-13lsns: add more print-debug codeMasatake YAMATO1-5/+13
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-13tests: (lsns::filedesc) enable debug output and show the exit statusMasatake YAMATO1-1/+2
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-13lslocks: remove a unused local variableMasatake YAMATO1-3/+2
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-13lslocks: don't abort gathering per-process information even if opening a ↵Masatake YAMATO2-15/+2
/proc/[0-9]* fails If a process ($pid) taking a lock is gone while running lslocks, gathering per-process information for the process may fail in opening /proc/$pid. Though lslocks should work with incomplete information, the original code stopped gathering per-process information for the other processes. As a result of the original behavior, tests/ts/lslocks/lslocks really failed in an environment where multiple test cases ran simultaneously. Close #2624 again. See also #2633. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-13docs: lsns(8): ENVIRONMENT: describe LSNS_DEBUGMasatake YAMATO1-0/+5
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-13lsns: continue the executing even if opening a /proc/$pid failsMasatake YAMATO1-1/+11
In the original code, lsns printed nothing if it failed in opening the last dntry in /proc/[0-9]* though lsns should work partially. The original behavior caused the combination of the following two test cases failed: $ tests/ts/lsns/filter & tests/ts/lsns/ioctl_ns & [1] 19178 [2] 19179 $ lsns: ownership and hierarchy ... \ lsns: -Q, --filter option ... FAILED FAILED [1]- Done tests/ts/lsns/filter [2]+ Done tests/ts/lsns/ioctl_ns Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2024-04-13tests: (lsns::filter) don't use double-quotes chars for PIDMasatake YAMATO1-1/+1
2024-04-13tests: (lsns::filter) add more debug printingMasatake YAMATO1-7/+17
2024-04-13tests: (lsns::filter) delete an unused variableMasatake YAMATO1-1/+0
2024-04-10meson: Remove libblkid dependency on libmountJordan Williams1-1/+1
I added this incorrect dependency between libblkid and libmount. The option to build libblkid should be allowed whether or not the build-libmount feature is allowed. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-10meson: Make the zlib dependency a disabler when not foundJordan Williams1-0/+1
This disables targets that require zlib when it is not found. Currently, targets requiring zlib are built when it is not found. Fixes #2930. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-10meson: Make ncurses dependency a disabler when not foundJordan Williams1-0/+1
This disables targets that require ncurses when it is not found. Currently, targets requiring ncurses are built when it is not found. Fixes #2929. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-10meson: Make tinfo dependency a disabler when not foundJordan Williams1-0/+1
This disables targets that require tinfo when it is not found. Currently, targets requiring tinfo are built when it is not found. Fixes #2927. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-04-10autotools: add --disable-enosys, check for linux/audit.hKarel Zak1-1/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-10autotools: check for sys/vfs.h and linux/bpf.hKarel Zak1-0/+5
Addresses: https://github.com/util-linux/util-linux/pull/2933 Addresses: https://github.com/util-linux/util-linux/issues/2945 Signed-off-by: Karel Zak <kzak@redhat.com>
2024-04-09Fix misplaced else in mnt_update_already_doneGavin Lloyd1-3/+3
See 477401f0de