]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
3 years agolibblkid: (topology) init variables for DM
Karel Zak [Fri, 19 Aug 2022 09:40:27 +0000 (11:40 +0200)] 
libblkid: (topology) init variables for DM

Addresses: https://github.com/util-linux/util-linux/issues/1776
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'master' of https://github.com/jamacku/util-linux
Karel Zak [Fri, 19 Aug 2022 08:18:31 +0000 (10:18 +0200)] 
Merge branch 'master' of https://github.com/jamacku/util-linux

* 'master' of https://github.com/jamacku/util-linux:
  ci(lint): add shell linter - Differential ShellCheck

3 years agoMerge branch 'master' of https://github.com/jiayi0118/util-linux
Karel Zak [Fri, 19 Aug 2022 07:41:55 +0000 (09:41 +0200)] 
Merge branch 'master' of https://github.com/jiayi0118/util-linux

* 'master' of https://github.com/jiayi0118/util-linux:
  libblkid/src/topology/dm: close redundant write file description for pipe before reading data.

3 years agoMerge branch 'meson-pidfd-header' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 19 Aug 2022 07:32:25 +0000 (09:32 +0200)] 
Merge branch 'meson-pidfd-header' of https://github.com/t-8ch/util-linux

* 'meson-pidfd-header' of https://github.com/t-8ch/util-linux:
  meson: check for sys/pidfd.h

3 years agoMerge branch 'lsfd-pidfd' of https://github.com/masatake/util-linux
Karel Zak [Fri, 19 Aug 2022 07:29:56 +0000 (09:29 +0200)] 
Merge branch 'lsfd-pidfd' of https://github.com/masatake/util-linux

* 'lsfd-pidfd' of https://github.com/masatake/util-linux:
  lsfd.1.adoc: write about how pidfds are represented in NAME column
  lsfd: show pids targeted by pidfds in NAME column
  lsfd: add a helper function to get 'struct proc' object for given pid
  lsfd: introduce a method table for supporting various anon inodes
  lsfd.1.adoc: write more about TYPE column
  lsfd.1.adoc: fix a wrong formatting
  lsfd.1.adoc: fix typos
  lsfd.1.adoc: use monospace face instead of italic face
  lsfd: delete __unused__ attr from a used parameter

3 years agolibblkid/src/topology/dm: close redundant write file description for pipe before...
jiayi0118 [Wed, 17 Aug 2022 14:25:27 +0000 (22:25 +0800)] 
libblkid/src/topology/dm: close redundant write file description for pipe before reading data.

3 years agoci(lint): add shell linter - Differential ShellCheck
Jan Macku [Tue, 16 Aug 2022 13:40:06 +0000 (15:40 +0200)] 
ci(lint): add shell linter - Differential ShellCheck

It performs differential ShellCheck scans and report results directly in
pull request.

documentation:
https://github.com/redhat-plumbers-in-action/differential-shellcheck

3 years agomeson: check for sys/pidfd.h
Thomas Weißschuh [Mon, 15 Aug 2022 18:07:27 +0000 (20:07 +0200)] 
meson: check for sys/pidfd.h

84732a8849a introduced this check for autotools.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 years agolib/sysfs: fix typo
Karel Zak [Thu, 11 Aug 2022 11:25:30 +0000 (13:25 +0200)] 
lib/sysfs: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agosfdisk: inform about failed fsync() [coverity scan]
Karel Zak [Thu, 11 Aug 2022 11:14:18 +0000 (13:14 +0200)] 
sfdisk: inform about failed fsync() [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolib/canonicalize: improve code readability for coverity scan
Karel Zak [Thu, 11 Aug 2022 11:13:39 +0000 (13:13 +0200)] 
lib/canonicalize: improve code readability for coverity scan

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibfdisk: (gpt) don't ignore fsync() errors
Karel Zak [Thu, 11 Aug 2022 11:09:05 +0000 (13:09 +0200)] 
libfdisk: (gpt) don't ignore fsync() errors

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agosfdisk: improve code readability for coverity scan
Karel Zak [Thu, 11 Aug 2022 11:04:58 +0000 (13:04 +0200)] 
sfdisk: improve code readability for coverity scan

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agotaskset: warn if affinity is not settable
Karel Zak [Thu, 11 Aug 2022 08:59:40 +0000 (10:59 +0200)] 
taskset: warn if affinity is not settable

Let's read /proc/#/stat to get process flags and print warning
if the affinity is not settable.

Based on patch from Carsten.

Tested-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolib/procfs: add function to parse /proc/#/stat
Karel Zak [Thu, 11 Aug 2022 08:56:02 +0000 (10:56 +0200)] 
lib/procfs: add function to parse /proc/#/stat

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agotests: (mkfds) use getpagesize()
Karel Zak [Thu, 11 Aug 2022 08:55:17 +0000 (10:55 +0200)] 
tests: (mkfds) use getpagesize()

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolsfd.1.adoc: write about how pidfds are represented in NAME column
Masatake YAMATO [Sat, 6 Aug 2022 20:04:06 +0000 (05:04 +0900)] 
lsfd.1.adoc: write about how pidfds are represented in NAME column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd: show pids targeted by pidfds in NAME column
Masatake YAMATO [Thu, 4 Aug 2022 15:48:15 +0000 (00:48 +0900)] 
lsfd: show pids targeted by pidfds in NAME column

Example output:

  $ sudo ./lsfd -Q '(NAME =~ "pidfd: .*")'
  COMMAND           PID  ... TYPE       SOURCE ... NAME
  dbus-broker-lau  1010  ... UNKN anon_inodefs ... pidfd: pid=1015 comm=dbus-broker nspid=1015
  dbus-broker-lau 14786  ... UNKN anon_inodefs ... pidfd: pid=14788 comm=dbus-broker nspid=14788
  dbus-broker-lau 15051  ... UNKN anon_inodefs ... pidfd: pid=15053 comm=dbus-broker nspid=15053

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd: add a helper function to get 'struct proc' object for given pid
Masatake YAMATO [Thu, 4 Aug 2022 15:47:10 +0000 (00:47 +0900)] 
lsfd: add a helper function to get 'struct proc' object for given pid

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd: introduce a method table for supporting various anon inodes
Masatake YAMATO [Wed, 27 Jul 2022 19:17:34 +0000 (04:17 +0900)] 
lsfd: introduce a method table for supporting various anon inodes

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd.1.adoc: write more about TYPE column
Masatake YAMATO [Sat, 6 Aug 2022 19:33:33 +0000 (04:33 +0900)] 
lsfd.1.adoc: write more about TYPE column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd.1.adoc: fix a wrong formatting
Masatake YAMATO [Sat, 6 Aug 2022 19:32:39 +0000 (04:32 +0900)] 
lsfd.1.adoc: fix a wrong formatting

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd.1.adoc: fix typos
Masatake YAMATO [Sat, 6 Aug 2022 19:16:32 +0000 (04:16 +0900)] 
lsfd.1.adoc: fix typos

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd.1.adoc: use monospace face instead of italic face
Masatake YAMATO [Sat, 6 Aug 2022 18:58:39 +0000 (03:58 +0900)] 
lsfd.1.adoc: use monospace face instead of italic face

We should the italic font face for representing parameter alike words.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolsfd: delete __unused__ attr from a used parameter
Masatake YAMATO [Wed, 27 Jul 2022 17:41:49 +0000 (02:41 +0900)] 
lsfd: delete __unused__ attr from a used parameter

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agoMerge branch '1' of https://github.com/neheb/util-linux
Karel Zak [Mon, 8 Aug 2022 09:34:32 +0000 (11:34 +0200)] 
Merge branch '1' of https://github.com/neheb/util-linux

3 years agoMerge branch 'master' of https://github.com/kraj/util-linux
Karel Zak [Mon, 8 Aug 2022 09:31:46 +0000 (11:31 +0200)] 
Merge branch 'master' of https://github.com/kraj/util-linux

* 'master' of https://github.com/kraj/util-linux:
  check for sys/pidfd.h

3 years agoMerge branch 'lsfd--testing-mmapped-packet-socket' of https://github.com/masatake...
Karel Zak [Mon, 8 Aug 2022 09:18:49 +0000 (11:18 +0200)] 
Merge branch 'lsfd--testing-mmapped-packet-socket' of https://github.com/masatake/util-linux

* 'lsfd--testing-mmapped-packet-socket' of https://github.com/masatake/util-linux:
  test: (lsfd) add a case for displaying PROTONAME column of mmap'ed AF_PACKET socket

3 years agocheck for sys/pidfd.h
Khem Raj [Sun, 7 Aug 2022 21:39:19 +0000 (14:39 -0700)] 
check for sys/pidfd.h

This header in newer glibc defines the signatures of functions
pidfd_send_signal() and pidfd_open() and when these functions are
defined by libc then we need to include the relevant header to get
the definitions. Clang 15+ has started to error out when function
signatures are missing.

Fixes errors like
misc-utils/kill.c:402:6: error: call to undeclared function 'pidfd_send_signal'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        if (pidfd_send_signal(pfd, ctl->numsig, &info, 0) < 0)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 years agotest: (lsfd) add a case for displaying PROTONAME column of mmap'ed AF_PACKET socket
Masatake YAMATO [Fri, 5 Aug 2022 21:49:27 +0000 (06:49 +0900)] 
test: (lsfd) add a case for displaying PROTONAME column of mmap'ed AF_PACKET socket

Tools like tcpdump do mmap sockets!
This test case proves lsfd can extract information such a exotic
source of mmap.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agoblkzone: make alignment check for zone size generic
Pankaj Raghav [Fri, 22 Apr 2022 15:02:03 +0000 (17:02 +0200)] 
blkzone: make alignment check for zone size generic

The zone offset and length alignment checks are based on a power-of-2(po2)
zone size assumption.

Make that calculation generic as there are ongoing efforts[1] to support
zoned devices with non-po2 zone sizes.

[1]
https://lore.kernel.org/all/20220803094801.177490-1-p.raghav@samsung.com/
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
3 years agocolumn: fix greedy mode on -l
Karel Zak [Thu, 4 Aug 2022 08:13:49 +0000 (10:13 +0200)] 
column: fix greedy mode on -l

In the 'greedy' mode strtok() skips leading white chars, but code for
-l (merge remaining data to the last column) do not count the skipped
chars.

Old version:

$ printf '  a b c\n1 2 3\n' | column -t -o '-' -l2
a-a
1-2 3

Fixed version:

$ printf '  a b c\n1 2 3\n' | column -t -o '-' -l2
a-b c
1-2 3

Note, see leading white chars '  a b c'.

Fexes: https://github.com/util-linux/util-linux/issues/1763
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agocolumn: fix buffer overflow when -l specified
Karel Zak [Thu, 4 Aug 2022 08:10:19 +0000 (10:10 +0200)] 
column: fix buffer overflow when -l specified

$ printf 'a b c\n1 2 3\n' | column -s : -t -o '-' -l2
a b c-ġ
1 2 3-

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'add/tags-man' of https://github.com/alberand/util-linux
Karel Zak [Wed, 3 Aug 2022 05:38:44 +0000 (07:38 +0200)] 
Merge branch 'add/tags-man' of https://github.com/alberand/util-linux

* 'add/tags-man' of https://github.com/alberand/util-linux:
  libblkid: add tags list to the man

3 years agoMerge branch 'lsfd-fix-segv-for-empty-Q' of https://github.com/masatake/util-linux
Karel Zak [Tue, 2 Aug 2022 08:57:43 +0000 (10:57 +0200)] 
Merge branch 'lsfd-fix-segv-for-empty-Q' of https://github.com/masatake/util-linux

3 years agoMerge branch 'build-in-flatpak' of https://github.com/pothos/util-linux
Karel Zak [Tue, 2 Aug 2022 08:56:25 +0000 (10:56 +0200)] 
Merge branch 'build-in-flatpak' of https://github.com/pothos/util-linux

* 'build-in-flatpak' of https://github.com/pothos/util-linux:
  meson: Install binaries to prefix

3 years agoswitch_root: (man) fix return code description
Karel Zak [Tue, 2 Aug 2022 08:55:16 +0000 (10:55 +0200)] 
switch_root: (man) fix return code description

Fixes: https://github.com/util-linux/util-linux/issues/1761
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibblkid: add tags list to the man
Andrey Albershteyn [Tue, 2 Aug 2022 08:26:11 +0000 (10:26 +0200)] 
libblkid: add tags list to the man

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
3 years agolsfd: fix crash triggered by an empty filter expression
Masatake YAMATO [Thu, 28 Jul 2022 03:56:52 +0000 (12:56 +0900)] 
lsfd: fix crash triggered by an empty filter expression

  $ lsfd -Q ''

or

  $ lsfd --filter ''

made lsfd process crash.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agosulogin: print features on --version
Karel Zak [Wed, 20 Jul 2022 14:57:15 +0000 (16:57 +0200)] 
sulogin: print features on --version

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agosulogin: fix includes
Karel Zak [Wed, 20 Jul 2022 14:55:02 +0000 (16:55 +0200)] 
sulogin: fix includes

* support --enable-sulogin-emergency-mount on Linux only

* don't include unnecessary linux/magic.h

* don't include linux/fs.h, sys/mount.h should be enough, otherwise
  define a fallback for MS_RELATIME

Reported-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolib/fileutils: fix compiler warning
Karel Zak [Wed, 20 Jul 2022 13:23:01 +0000 (15:23 +0200)] 
lib/fileutils: fix compiler warning

lib/fileutils.c: In function ‘dup_fd_cloexec’:
lib/fileutils.c:75:35: warning: unused parameter ‘lowfd’ [-Wunused-parameter]
int dup_fd_cloexec(int oldfd, int lowfd)
                                  ^
Addresses: https://github.com/util-linux/util-linux/issues/1755
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibuuid: (man) uuid_copy() -- add missing parenthesis
Andrew Price [Fri, 15 Jul 2022 14:55:13 +0000 (15:55 +0100)] 
libuuid: (man) uuid_copy() -- add missing parenthesis

Signed-off-by: Andrew Price <anprice@redhat.com>
3 years agoRemove closing braces in Apple cores names
ThomasKaiser [Mon, 18 Jul 2022 10:56:44 +0000 (12:56 +0200)] 
Remove closing braces in Apple cores names

3 years agolscpu: add MODELNAME column (for -e)
Karel Zak [Mon, 18 Jul 2022 10:49:12 +0000 (12:49 +0200)] 
lscpu: add MODELNAME column (for -e)

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolscpu: (arm) don't use space in names
Karel Zak [Mon, 18 Jul 2022 10:37:25 +0000 (12:37 +0200)] 
lscpu: (arm) don't use space in names

It's seems better to be consistent and use the same convention for all
the names.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'apple-midr' of https://github.com/chadmed/util-linux
Karel Zak [Mon, 18 Jul 2022 10:34:18 +0000 (12:34 +0200)] 
Merge branch 'apple-midr' of https://github.com/chadmed/util-linux

* 'apple-midr' of https://github.com/chadmed/util-linux:
  lscpu: add missing Apple parts
  lscpu: make Apple part names human-friendly

3 years agomeson: Install binaries to prefix
Kai Lüke [Thu, 14 Jul 2022 21:49:16 +0000 (23:49 +0200)] 
meson: Install binaries to prefix

When compiled in Flatpak /usr is read-only and the /app prefix is used.
However, the binary installation did not use the prefix but had /usr
hardcoded.
Use the prefix instead of /usr when assembling the prefix/(s)bin paths.

Signed-off-by: Kai Lüke <kailueke@riseup.net>
3 years agolscpu: add missing Apple parts
James Calligeros [Sat, 9 Jul 2022 05:08:41 +0000 (15:08 +1000)] 
lscpu: add missing Apple parts

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
3 years agolibfdisk: fix typos
Karel Zak [Mon, 11 Jul 2022 18:09:56 +0000 (20:09 +0200)] 
libfdisk: fix typos

Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agosfdisk: (man) fix sector-size description
Karel Zak [Mon, 11 Jul 2022 17:51:21 +0000 (19:51 +0200)] 
sfdisk: (man) fix sector-size description

Addresses: https://github.com/util-linux/util-linux/issues/1744
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibfdisk: make scripts portable between different sector sizes
Karel Zak [Mon, 11 Jul 2022 12:02:30 +0000 (14:02 +0200)] 
libfdisk: make scripts portable between different sector sizes

Fixes: https://github.com/util-linux/util-linux/issues/1744
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibfdisk: (gpt) fix PMBR read overflow
Karel Zak [Mon, 11 Jul 2022 10:49:21 +0000 (12:49 +0200)] 
libfdisk: (gpt) fix PMBR read overflow

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolscpu: make Apple part names human-friendly
James Calligeros [Sat, 9 Jul 2022 04:52:35 +0000 (14:52 +1000)] 
lscpu: make Apple part names human-friendly

The internal Apple model numbers for the SoCs are somewhat
confusing given that they are mostly similar and differ by only
one or two digits. Instead, use the public nomenclature for these
chips to avoid ambiguity and beautify the output.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
3 years agounshare: Fix "you (user xxxx) don't exist" error when uid differs from primary gid
Sol Boucher [Fri, 8 Jul 2022 16:09:13 +0000 (12:09 -0400)] 
unshare: Fix "you (user xxxx) don't exist" error when uid differs from primary gid

This problem affected the --map-auto and --map-groups=auto command-line switches.
The root cause is that /etc/subgid is indexed by user or uid, not by group or gid;
therefore, we should be using the effective uid to find entries in this file, just
as we do for /etc/subuid.

Signed-off-by: Sol Boucher <sboucher@cmu.edu>
3 years agolscpu: keep bogomips locale output locale sensitive
Karel Zak [Thu, 7 Jul 2022 11:41:37 +0000 (13:41 +0200)] 
lscpu: keep bogomips locale output locale sensitive

Fixes: https://github.com/util-linux/util-linux/issues/1743
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibuuid: Implement continuous clock handling for time based UUIDs
Michael Trapp [Mon, 20 Jun 2022 15:10:36 +0000 (17:10 +0200)] 
libuuid: Implement continuous clock handling for time based UUIDs

In a uuidd setup, the daemon is a singleton and can maintain it's own
resources for time based UUID generation. This requires a dedicated
'clock sequence range' but does not need any further lock/update of
the LIBUUID_CLOCK_FILE from uuidd. The range of available clock values
is extended by a continuous handling of the clock updates - instead of
updating the value to the current timestamp, it is incremented by
the number of requested UUIDs.

3 years agoMerge branch 'misc-utils-fix-rename-from-empty' of https://github.com/ChickenProp...
Karel Zak [Mon, 4 Jul 2022 10:15:17 +0000 (12:15 +0200)] 
Merge branch 'misc-utils-fix-rename-from-empty' of https://github.com/ChickenProp/util-linux

* 'misc-utils-fix-rename-from-empty' of https://github.com/ChickenProp/util-linux:
  rename tests: stop clobbering error output.
  Fix `rename -a ''`.
  Rename: fix empty 'from' with / in filename.

3 years agorename tests: stop clobbering error output.
Philip Hazelden [Sun, 3 Jul 2022 22:22:58 +0000 (23:22 +0100)] 
rename tests: stop clobbering error output.

Fortunately there doesn't seem to have been any to clobber.

3 years agoFix `rename -a ''`.
Philip Hazelden [Sun, 3 Jul 2022 17:54:43 +0000 (18:54 +0100)] 
Fix `rename -a ''`.

It previously entered an infinite loop. Now it inserts the `to` string
between every character of `from`, including at the beginning and end.

    rename -a '' _ 123.txt # renames to _1_2_3_._t_x_t_

3 years agoRename: fix empty 'from' with / in filename.
Philip Hazelden [Sun, 3 Jul 2022 21:46:16 +0000 (22:46 +0100)] 
Rename: fix empty 'from' with / in filename.

Previously, if we did e.g.

    rename '' _ ./foo.txt

it would try to rename to ._/foo.txt, because `string_replace` was
passed `s="/foo.txt"` and `from` would match at the front. Now we pass
`s="foo.txt"`.

This doesn't affect the case when `to` contains a slash. In that
situation we'll still place `to` at the very beginning of the path, e.g.

    rename '' _/ ./foo.txt # rename to _/./foo.txt
    rename '' /_ ./foo.txt # rename to /_./foo.txt

3 years agoFix formatting.
Thomas Kaiser [Fri, 1 Jul 2022 12:16:49 +0000 (14:16 +0200)] 
Fix formatting.

3 years agoAdding Apple core names, distinguish by SoC/SiP name
ThomasKaiser [Fri, 1 Jul 2022 09:24:04 +0000 (11:24 +0200)] 
Adding Apple core names, distinguish by SoC/SiP name

3 years agoAdd Makalu/Makalu-ELP (A715/X3)
ThomasKaiser [Thu, 30 Jun 2022 05:32:40 +0000 (07:32 +0200)] 
Add Makalu/Makalu-ELP (A715/X3)

Also fix names of A510/A710 cores

3 years agolscpu: add --hierarchic
Karel Zak [Wed, 29 Jun 2022 13:35:43 +0000 (15:35 +0200)] 
lscpu: add --hierarchic

Fixes: https://github.com/util-linux/util-linux/issues/1735
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoscript: (man) be more explicit about log purpose
Karel Zak [Wed, 29 Jun 2022 10:36:18 +0000 (12:36 +0200)] 
script: (man) be more explicit about log purpose

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'lsns-man-see-also' of https://github.com/masatake/util-linux
Karel Zak [Mon, 27 Jun 2022 11:03:56 +0000 (13:03 +0200)] 
Merge branch 'lsns-man-see-also' of https://github.com/masatake/util-linux

* 'lsns-man-see-also' of https://github.com/masatake/util-linux:
  lsns: (man) add ip-netns to "SEE ALSO" section

3 years agoMerge branch 'bobbyboy5069-date-pad' of https://github.com/bobbyboy5069/util-linux
Karel Zak [Mon, 27 Jun 2022 11:03:17 +0000 (13:03 +0200)] 
Merge branch 'bobbyboy5069-date-pad' of https://github.com/bobbyboy5069/util-linux

* 'bobbyboy5069-date-pad' of https://github.com/bobbyboy5069/util-linux:
  add padding to dates in issue file

3 years agolibblkid: simplify 'leaf' detection
Karel Zak [Mon, 27 Jun 2022 11:00:55 +0000 (13:00 +0200)] 
libblkid: simplify 'leaf' detection

References: https://github.com/util-linux/util-linux/pull/1729
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'dm_leaf_holders' of https://github.com/wjordan/util-linux
Karel Zak [Mon, 27 Jun 2022 10:40:29 +0000 (12:40 +0200)] 
Merge branch 'dm_leaf_holders' of https://github.com/wjordan/util-linux

* 'dm_leaf_holders' of https://github.com/wjordan/util-linux:
  Improve is_dm_leaf performance Read from `/holders` instead of `/slaves` to determine whether the device is a leaf node, eliminating a scan across all block devices in the system.

3 years agoMerge branch 'master' of https://github.com/lishengyu/util-linux
Karel Zak [Mon, 27 Jun 2022 10:37:05 +0000 (12:37 +0200)] 
Merge branch 'master' of https://github.com/lishengyu/util-linux

* 'master' of https://github.com/lishengyu/util-linux:
  lsns: fix the memory leak.

3 years agoMerge branch 'lsfd--fix-ipc-memleak' of https://github.com/masatake/util-linux
Karel Zak [Mon, 27 Jun 2022 10:36:01 +0000 (12:36 +0200)] 
Merge branch 'lsfd--fix-ipc-memleak' of https://github.com/masatake/util-linux

* 'lsfd--fix-ipc-memleak' of https://github.com/masatake/util-linux:
  lsfd: fix memory leak related to ENDPOINTS field

3 years agolsns: (man) add ip-netns to "SEE ALSO" section
Masatake YAMATO [Sun, 26 Jun 2022 06:04:36 +0000 (15:04 +0900)] 
lsns: (man) add ip-netns to "SEE ALSO" section

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agoadd padding to dates in issue file
bobbyboy5069 [Fri, 24 Jun 2022 20:02:15 +0000 (23:02 +0300)] 
add padding to dates in issue file

Pad the day of the month so the length of the date string doesn't change.

3 years agoImprove is_dm_leaf performance
Will Jordan [Wed, 22 Jun 2022 22:13:11 +0000 (15:13 -0700)] 
Improve is_dm_leaf performance
Read from `/holders` instead of `/slaves` to determine
whether the device is a leaf node, eliminating a scan
across all block devices in the system.

3 years agolsns: fix the memory leak.
lishengyu [Thu, 23 Jun 2022 06:02:49 +0000 (14:02 +0800)] 
lsns: fix the memory leak.

==28129== 96 bytes in 3 blocks are possibly lost in loss record 1 of 4
==28129==    at 0x4837B65: calloc (vg_replace_malloc.c:752)
==28129==    by 0x405C83: xcalloc (xalloc.h:60)
==28129==    by 0x405C83: netnsid_cache_add (lsns.c:389)
==28129==    by 0x405C83: get_netnsid (lsns.c:486)
==28129==    by 0x405C83: read_process (lsns.c:549)
==28129==    by 0x403FB4: read_processes (lsns.c:586)
==28129==    by 0x403FB4: main (lsns.c:1417)
==28129==
==28129== 119,664 (384 direct, 119,280 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
==28129==    at 0x4837B65: calloc (vg_replace_malloc.c:752)
==28129==    by 0x4055F5: xcalloc (xalloc.h:60)
==28129==    by 0x4055F5: read_process (lsns.c:516)
==28129==    by 0x403FB4: read_processes (lsns.c:586)
==28129==    by 0x403FB4: main (lsns.c:1417)

3 years agolsfd: fix memory leak related to ENDPOINTS field
Masatake YAMATO [Tue, 21 Jun 2022 17:39:09 +0000 (02:39 +0900)] 
lsfd: fix memory leak related to ENDPOINTS field

`struct ipc' is the data structure used behind ENDPOINTS field.
The objects of the data structure and its hash table were not
freed.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agoMerge branch 'master' of https://github.com/blacknon/util-linux
Karel Zak [Tue, 21 Jun 2022 07:38:03 +0000 (09:38 +0200)] 
Merge branch 'master' of https://github.com/blacknon/util-linux

* 'master' of https://github.com/blacknon/util-linux:
  update. Since the specified column is shifted by one column, subtract it.

3 years agotests: (lsfd) update the expected output for "test_mkfds symlink"
Masatake YAMATO [Mon, 20 Jun 2022 13:56:22 +0000 (22:56 +0900)] 
tests: (lsfd) update the expected output for "test_mkfds symlink"

Though the code of lsfd was changed in 4b496e50ee4f6bd8256d082a85fc027a7eaa45cb,
the expected output of the test case was not updated.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agoupdate. Since the specified column is shifted by one column, subtract it.
blacknon [Mon, 20 Jun 2022 13:56:00 +0000 (22:56 +0900)] 
update. Since the specified column is shifted by one column, subtract it.

3 years agohardlink: use info rather than warning message
Karel Zak [Mon, 20 Jun 2022 12:00:38 +0000 (14:00 +0200)] 
hardlink: use info rather than warning message

Fixes: https://github.com/util-linux/util-linux/issues/1710
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agosfdiks: (man) fix example
Karel Zak [Mon, 20 Jun 2022 11:42:35 +0000 (13:42 +0200)] 
sfdiks: (man) fix example

Fixes: https://github.com/util-linux/util-linux/discussions/1719
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agocolumn: support ranges when addressing columns by numbers
Karel Zak [Mon, 20 Jun 2022 11:25:59 +0000 (13:25 +0200)] 
column: support ranges when addressing columns by numbers

Fixes: https://github.com/util-linux/util-linux/issues/1723
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'lsfd-fix-contatns-for-decode-flags' of https://github.com/masatake...
Karel Zak [Mon, 20 Jun 2022 10:44:36 +0000 (12:44 +0200)] 
Merge branch 'lsfd-fix-contatns-for-decode-flags' of https://github.com/masatake/util-linux

* 'lsfd-fix-contatns-for-decode-flags' of https://github.com/masatake/util-linux:
  lsfd: fix wrongly checked flag constants

3 years agoMerge branch 'fix-github-issue-1720' of https://github.com/masatake/util-linux
Karel Zak [Mon, 20 Jun 2022 10:43:31 +0000 (12:43 +0200)] 
Merge branch 'fix-github-issue-1720' of https://github.com/masatake/util-linux

* 'fix-github-issue-1720' of https://github.com/masatake/util-linux:
  lsfd: try including asm/fcntl.h first for decoding flags of fdinfo

3 years agoMerge branch 'fix-github-issue-1717' of https://github.com/masatake/util-linux
Karel Zak [Mon, 20 Jun 2022 10:40:59 +0000 (12:40 +0200)] 
Merge branch 'fix-github-issue-1717' of https://github.com/masatake/util-linux

3 years agolibmount: remove mtab locking
Karel Zak [Fri, 17 Jun 2022 16:04:06 +0000 (18:04 +0200)] 
libmount: remove mtab locking

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolsfd: fix wrongly checked flag constants
Masatake YAMATO [Fri, 17 Jun 2022 15:48:41 +0000 (00:48 +0900)] 
lsfd: fix wrongly checked flag constants

The definition of O_FOLLOW was checked. However, it was
a typo of O_NOFOLLOW.

The definition of O_FASYNC was checked. However, it was
a typo of FASYNC.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolibmount: remove mtab related code
Karel Zak [Fri, 17 Jun 2022 15:45:29 +0000 (17:45 +0200)] 
libmount: remove mtab related code

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolsfd: try including asm/fcntl.h first for decoding flags of fdinfo
Masatake YAMATO [Fri, 17 Jun 2022 15:28:38 +0000 (00:28 +0900)] 
lsfd: try including asm/fcntl.h first for decoding flags of fdinfo

Close #1720

The original code tried including asm-generic/fcntl.h before trying
including asm/fcntl.h. This caused a bug in decoding flag of fdinfo
on Linux running on armv7l.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agolibmount: remove support for writable /etc/mtab
Karel Zak [Fri, 17 Jun 2022 11:42:11 +0000 (13:42 +0200)] 
libmount: remove support for writable /etc/mtab

This commit removes --enable-libmount-support-mtab.

The classic /etc/mtab is broken by design. It does not support
namespaces, chroots, etc. The only sane way to keep track of
mounted filesystems is to ask the kernel. It's a bad idea to maintain
a mount table in userspace.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agotest: (lsfd) ignore noatime mnt flag when testing a fd opening / directory
Masatake YAMATO [Thu, 16 Jun 2022 13:42:12 +0000 (22:42 +0900)] 
test: (lsfd) ignore noatime mnt flag when testing a fd opening / directory

Close #1717.

If the file system where the target directory is is mounted with
"noatime" flag, Linux kernel may set O_NOATIME to the fd associated
with the target directory. As a result, mkfds-directory test failed.

With this change, mkfds-directory deletes "noatime" from the output
of lsfd before verifying the output if "noatime" mount flag is set
to the file system where the directory opened by mkfds-directory is.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agomore: (man) add note about POSIXLY_CORRECT
Karel Zak [Wed, 15 Jun 2022 08:15:53 +0000 (10:15 +0200)] 
more: (man) add note about POSIXLY_CORRECT

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agomore: restore exit-on-eof if POSIXLY_CORRECT is not set
Karel Zak [Wed, 15 Jun 2022 08:03:44 +0000 (10:03 +0200)] 
more: restore exit-on-eof if POSIXLY_CORRECT is not set

In version 2.38, exit-on-eof has been disabled by default. This change
is annoying for users and forces many users to use 'alias more="more
-e"'. It seems better to force POSIX lovers to use POSIXLY_CORRECT
env. variable and stay backwardly compatible by default.

Addresses: https://github.com/util-linux/util-linux/issues/1703
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2088493
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agobuild-sys: don't call AC_SUBST() if unnecessary
Karel Zak [Tue, 14 Jun 2022 14:13:03 +0000 (16:13 +0200)] 
build-sys: don't call AC_SUBST() if unnecessary

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agobuild-sys: use PKG_CHECK_VAR()
Karel Zak [Tue, 14 Jun 2022 13:47:05 +0000 (15:47 +0200)] 
build-sys: use PKG_CHECK_VAR()

Do not call 'PKG_CONFIG --exists' and '$PKG_CONFIG --variable' if
there is a much more robust PKG_CHECK_VAR() macro.

It's also not necessary to check for the dirs if all the feature
(systemd or bashcompletiondir) is disabled.

Reported-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'fix-github-issue-1709' of https://github.com/masatake/util-linux
Karel Zak [Mon, 13 Jun 2022 10:16:39 +0000 (12:16 +0200)] 
Merge branch 'fix-github-issue-1709' of https://github.com/masatake/util-linux

* 'fix-github-issue-1709' of https://github.com/masatake/util-linux:
  lsfd: use constants defined in asm/fctl.h flags field of a fdinfo

3 years agoinclude/c: add prefix to print_features()
Karel Zak [Mon, 13 Jun 2022 10:10:51 +0000 (12:10 +0200)] 
include/c: add prefix to print_features()

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agohardlink: print supported feature on --version
Karel Zak [Mon, 13 Jun 2022 10:03:26 +0000 (12:03 +0200)] 
hardlink: print supported feature on --version

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolib/fileeq: clean up ifdefs use
Karel Zak [Mon, 13 Jun 2022 10:02:49 +0000 (12:02 +0200)] 
lib/fileeq: clean up ifdefs use

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