]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agobuild-sys: release++ (v2.38-rc3) v2.38-rc3
Karel Zak [Tue, 15 Mar 2022 14:16:31 +0000 (15:16 +0100)] 
build-sys: release++ (v2.38-rc3)

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update v2.38-ReleaseNotes
Karel Zak [Tue, 15 Mar 2022 14:15:33 +0000 (15:15 +0100)] 
docs: update v2.38-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update AUTHORS file
Karel Zak [Tue, 15 Mar 2022 12:40:42 +0000 (13:40 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: merge changes
Karel Zak [Tue, 15 Mar 2022 15:55:59 +0000 (16:55 +0100)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo: merge changes
Karel Zak [Tue, 15 Mar 2022 14:31:42 +0000 (15:31 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo: update tr.po (from translationproject.org)
Mesutcan Kurt [Tue, 15 Mar 2022 14:22:46 +0000 (15:22 +0100)] 
po: update tr.po (from translationproject.org)

2 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 15 Mar 2022 12:23:10 +0000 (13:23 +0100)] 
po: update uk.po (from translationproject.org)

2 years agopo: update ko.po (from translationproject.org)
Seong-ho Cho [Tue, 15 Mar 2022 12:23:09 +0000 (13:23 +0100)] 
po: update ko.po (from translationproject.org)

2 years agopo: update hr.po (from translationproject.org)
Božidar Putanec [Tue, 15 Mar 2022 12:23:09 +0000 (13:23 +0100)] 
po: update hr.po (from translationproject.org)

2 years agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Tue, 15 Mar 2022 12:23:09 +0000 (13:23 +0100)] 
po: update fr.po (from translationproject.org)

2 years agopo: update de.po (from translationproject.org)
Mario Blättermann [Tue, 15 Mar 2022 12:23:09 +0000 (13:23 +0100)] 
po: update de.po (from translationproject.org)

2 years agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 15 Mar 2022 12:23:09 +0000 (13:23 +0100)] 
po: update cs.po (from translationproject.org)

2 years agodocs: update copyright years
Karel Zak [Tue, 15 Mar 2022 12:20:47 +0000 (13:20 +0100)] 
docs: update copyright years

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: remove readline from build-sys output
Karel Zak [Tue, 15 Mar 2022 12:17:28 +0000 (13:17 +0100)] 
tests: remove readline from build-sys output

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'fix-bsd-crashes-when-mount-not-found' of https://github.com/ellcs/util...
Karel Zak [Mon, 14 Mar 2022 09:35:58 +0000 (10:35 +0100)] 
Merge branch 'fix-bsd-crashes-when-mount-not-found' of https://github.com/ellcs/util-linux

* 'fix-bsd-crashes-when-mount-not-found' of https://github.com/ellcs/util-linux:
  Fix crash, when mount was not found on bsd systems

2 years agoMerge branch 'fix_typos' of https://github.com/yurchor/util-linux
Karel Zak [Mon, 14 Mar 2022 09:31:54 +0000 (10:31 +0100)] 
Merge branch 'fix_typos' of https://github.com/yurchor/util-linux

* 'fix_typos' of https://github.com/yurchor/util-linux:
  Fix minor typos

2 years agohardlink: add a missing word to an error message
Benno Schulenberg [Sun, 13 Mar 2022 11:45:56 +0000 (12:45 +0100)] 
hardlink: add a missing word to an error message

Reported-by: Petr Pisar <petr.pisar@atlas.cz>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 years agohardlink: grammaticalize the main description in the man page
Benno Schulenberg [Sun, 13 Mar 2022 09:43:57 +0000 (10:43 +0100)] 
hardlink: grammaticalize the main description in the man page

(Also, hard-wrap the extremely long line to reasonable widths,
so that later small changes are easier to observe in git.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 years agohardlink: set all locale elements, so that messages will get translated
Benno Schulenberg [Sun, 13 Mar 2022 09:43:56 +0000 (10:43 +0100)] 
hardlink: set all locale elements, so that messages will get translated

This setting and binding were lost a year ago, in commit 2180ecc81b.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 years agoFix crash, when mount was not found on bsd systems
ellcs [Sun, 13 Mar 2022 15:56:54 +0000 (16:56 +0100)] 
Fix crash, when mount was not found on bsd systems

2 years agolibuuid: extend cache in uuid_generate_time_generic()
Michael Trapp [Thu, 10 Mar 2022 12:18:52 +0000 (13:18 +0100)] 
libuuid:  extend cache in uuid_generate_time_generic()

Improve throughput and reduce clock sequence increments
for high load situation with time based version 1 uuids.

In a high load scenario, where an application continiously reads time
based version 1 uuids from uuidd, we have noticed the following
behaviour.

The application reads more uuids as there are available in the
corresponding timeframe and each bulk request results in an increment of
the clock sequence because of the 'step back' in time. Due to the
14bit size of the clock sequence this also results in overflows of
the clock sequence.

As uuidd calls
    uuid_generate_time_safe()
       uuid_generate_time_generic()
the default value for the bulk request in the '#ifdef HAVE_TLS' section
of uuid_generate_time_generic() is set to 1000.

Extending the 'cache' of uuid_generate_time_generic() by increasing
the default of num to 1000000 doesn't solve the issue, but reduces
the clock sequence increments by factor 1000 and it also improves
the uuid throughput in our setup by factor 3-4.

It might be possible to implement a cache for
  UUIDD_OP_BULK_TIME_UUID
  UUIDD_OP_TIME_UUID
in the uuidd request handling, but it would not be as simple as this fix
in uuid_generate_time_generic().

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolosetup: fix --direct-io
Karel Zak [Wed, 9 Mar 2022 10:13:26 +0000 (11:13 +0100)] 
losetup: fix --direct-io

losetup checks for empty lo_flags when A_CREATE (action) is not
requested, otherwise it prints

"the options %s are allowed during loop device setup only"

error message. We need to cleanup lo_flags when alone --direct-io
requested.

Fix also typo in man page, "losetup --direct-io" is the same as
"losetup --direct-io=on".

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolosetup: fix memory leak [asan]
Karel Zak [Tue, 8 Mar 2022 12:06:45 +0000 (13:06 +0100)] 
losetup: fix memory leak [asan]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowipefs: increase delay after re-read ioctl
Karel Zak [Tue, 8 Mar 2022 09:28:26 +0000 (10:28 +0100)] 
wipefs: increase delay after re-read ioctl

We usually use 250000 ms delay after EBUSY to repeat read/ioctls.
Let's use the same for wipefs.

Fixes: https://github.com/util-linux/util-linux/issues/1619
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: update variables in Makefile.am
Karel Zak [Mon, 7 Mar 2022 13:17:11 +0000 (14:17 +0100)] 
po-man: update variables in Makefile.am

2 years agopo-man: add new langs to po4a.cfg
Karel Zak [Mon, 7 Mar 2022 13:05:04 +0000 (14:05 +0100)] 
po-man: add new langs to po4a.cfg

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotools: add git-tp-sync-man
Karel Zak [Mon, 7 Mar 2022 12:56:13 +0000 (13:56 +0100)] 
tools: add git-tp-sync-man

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: add uk.po (from translationproject.org)
Yuri Chornoivan [Mon, 7 Mar 2022 12:54:39 +0000 (13:54 +0100)] 
po-man: add uk.po (from translationproject.org)

2 years agopo-man: add pt_BR.po (from translationproject.org)
Rafael Fontenelle [Mon, 7 Mar 2022 12:54:39 +0000 (13:54 +0100)] 
po-man: add pt_BR.po (from translationproject.org)

2 years agopo-man: add fr.po (from translationproject.org)
Frédéric Marchal [Mon, 7 Mar 2022 12:54:39 +0000 (13:54 +0100)] 
po-man: add fr.po (from translationproject.org)

2 years agopo-man: add es.po (from translationproject.org)
Antonio Ceballos Roa [Mon, 7 Mar 2022 12:54:39 +0000 (13:54 +0100)] 
po-man: add es.po (from translationproject.org)

2 years agopo-man: add sr.po (from translationproject.org)
Мирослав Николић [Mon, 7 Mar 2022 12:53:32 +0000 (13:53 +0100)] 
po-man: add sr.po (from translationproject.org)

2 years agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Mon, 7 Mar 2022 12:53:32 +0000 (13:53 +0100)] 
po-man: update de.po (from translationproject.org)

2 years agodocs: update TODO, add "column --output-width unlimited"
Karel Zak [Mon, 7 Mar 2022 09:33:43 +0000 (10:33 +0100)] 
docs: update TODO, add "column --output-width unlimited"

Addresses: https://github.com/util-linux/util-linux/issues/1618
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocolumn: (man) add note about default width in non-interactive mode
Karel Zak [Mon, 7 Mar 2022 09:12:46 +0000 (10:12 +0100)] 
column: (man) add note about default width in non-interactive mode

Fixes: https://github.com/util-linux/util-linux/issues/1618
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoFix minor typos
Yuri Chornoivan [Fri, 4 Mar 2022 20:17:58 +0000 (22:17 +0200)] 
Fix minor typos

2 years agobuild-sys: release++ (v2.38-rc2) v2.38-rc2
Karel Zak [Fri, 4 Mar 2022 15:09:53 +0000 (16:09 +0100)] 
build-sys: release++ (v2.38-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update v2.38-ReleaseNotes
Karel Zak [Fri, 4 Mar 2022 15:06:48 +0000 (16:06 +0100)] 
docs: update v2.38-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update AUTHORS file
Karel Zak [Fri, 4 Mar 2022 15:02:15 +0000 (16:02 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo: merge changes
Karel Zak [Fri, 4 Mar 2022 14:46:53 +0000 (15:46 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibfdisk: (gpt) cleanup verity GUID names
Karel Zak [Fri, 4 Mar 2022 08:57:00 +0000 (09:57 +0100)] 
libfdisk: (gpt) cleanup verity GUID names

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'new-gpt-types' of https://github.com/gyakovlev/util-linux
Karel Zak [Fri, 4 Mar 2022 08:53:49 +0000 (09:53 +0100)] 
Merge branch 'new-gpt-types' of https://github.com/gyakovlev/util-linux

* 'new-gpt-types' of https://github.com/gyakovlev/util-linux:
  libfdisk: add new verity root and /usr part types
  libfdisk: add new root and /usr part types

2 years agotests: (cramfs) make GID and mode use more robust
Karel Zak [Wed, 2 Mar 2022 10:34:06 +0000 (11:34 +0100)] 
tests: (cramfs) make GID and mode use more robust

We already use the same in tests/ts/cramfs/mkfs.

Addresses: https://github.com/util-linux/util-linux/issues/1613
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolast: add note about empty files/entries to the man page
Karel Zak [Wed, 2 Mar 2022 09:42:11 +0000 (10:42 +0100)] 
last: add note about empty files/entries to the man page

Fixes: https://github.com/util-linux/util-linux/issues/1609
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoscriptlive: fix argv[0] for execlp()
Karel Zak [Wed, 2 Mar 2022 09:00:46 +0000 (10:00 +0100)] 
scriptlive: fix argv[0] for execlp()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoscript: fix passing args to execlp()
Jakub Wilk [Tue, 1 Mar 2022 16:15:45 +0000 (17:15 +0100)] 
script: fix passing args to execlp()

Fixes:

    $ SHELL=bash script -q -c 'echo Hello world'
    -c: echo Hello world: No such file or directory

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2 years agoloopdev: add retries on EAGAIN
Karel Zak [Tue, 1 Mar 2022 11:07:07 +0000 (12:07 +0100)] 
loopdev: add retries on EAGAIN

* add limit to number of attempts for LOOP_SET_STATUS64

* use the same for LOOP_SET_BLOCK_SIZE ioctl

Addresses: https://github.com/util-linux/util-linux/issues/1582
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobuild-sys: distribute Meson files
Karel Zak [Tue, 1 Mar 2022 10:22:33 +0000 (11:22 +0100)] 
build-sys: distribute Meson files

This commit makes it possible to use Meson build-system when compiling
util-linux from tarball.

Fixes: https://github.com/util-linux/util-linux/issues/1591
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'lsfd-tests' of https://github.com/masatake/util-linux
Karel Zak [Mon, 28 Feb 2022 10:25:30 +0000 (11:25 +0100)] 
Merge branch 'lsfd-tests' of https://github.com/masatake/util-linux

* 'lsfd-tests' of https://github.com/masatake/util-linux:
  tests: (lsfd) don't check an unused program
  tests: (lsfd) don't use findmnt to verify device numbers
  tests: (lsfd) improve the help messages of test_mkfds helper command

2 years agolosetup: don't skip adding a new device if it already has a device node
Christoph Hellwig [Fri, 25 Feb 2022 18:09:03 +0000 (19:09 +0100)] 
losetup: don't skip adding a new device if it already has a device node

Linux plans to deprecate the auto-creation of block devices based on
access to the device node starting from kernel 5.18.  Without that feature
losetup will fail to create the loop device if a device node already
exists, but the loop device to back it in the kernel does not exist yet.
This is a scenario that should not happen in modern udev based
distributions, but apparently there still are various scripts around that
manually call the superfluous mknod.

Change losetup to unconditionally call loopcxt_add_device when a specific
device node is specified on the command line.  If the loop device
already exists the LOOP_CTL_ADD ioctl will fail, but given that losetup
ignores the return value from loopcxt_add_device that failure has no
further effect.

Reported-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoRevert "unshare: Fix PDEATHSIG race for --kill-child"
Karel Zak [Mon, 28 Feb 2022 10:02:04 +0000 (11:02 +0100)] 
Revert "unshare: Fix PDEATHSIG race for --kill-child"

This reverts commit 764bb68af8e6d1b6c10a154c1dace64c450100c0.

It seems getppid() is use-less in some cases. For more details see:
https://github.com/util-linux/util-linux/pull/1561#issuecomment-1049979795

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude/strutils: mark some arguments as non-null
Karel Zak [Mon, 28 Feb 2022 09:27:05 +0000 (10:27 +0100)] 
include/strutils: mark some arguments as non-null

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: (lsfd) don't check an unused program
Masatake YAMATO [Sat, 26 Feb 2022 18:55:18 +0000 (03:55 +0900)] 
tests: (lsfd) don't check an unused program

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) don't use findmnt to verify device numbers
Masatake YAMATO [Sat, 26 Feb 2022 18:42:09 +0000 (03:42 +0900)] 
tests: (lsfd) don't use findmnt to verify device numbers

This change tries to fix the failures in testing reported in:

* https://lkml.org/lkml/2022/1/31/1333, and
* https://lkml.org/lkml/2022/2/2/171

The original test cases depended on a wrong assumption; if M and M'
are the same, D and D' are the same, too.  Here, M is a mnt_id in
/proc/$pid/mountinfo. D is the device number for M in
/proc/$pid/mountinfo. M' is the mnt_id value in
/proc/$pid/fdinfo/$fd. D' is the device number reported by stat
syscall for /proc/$pid/fd/$fd.

  # ../../lsfd -oCOMMAND,PID,MNTID,DEV,NAME -p 2972623 -Q '(ASSOC =~ "^[0-9]+$") and (TYPE == "REG")'
  COMMAND     PID MNTID  DEV NAME
  a.out   2972623  1578 0:98 /home/jet/var/util-linux/o/merged/y
  # stat -c %d /home/jet/var/util-linux/o/merged/y
  98
  # grep 1578 /proc/2972623/mountinfo
  1578 91 0:91 / /home/jet/var/util-linux/o/merged rw,relatime shared:724 - overlay overlay rw,seclabel,lowerdir=lower-base/lower,upperdir=upper-base/upper,workdir=upper-base/work

The original test compared the device numbers reported by findmnt and
lsfd. findmnt retrieves a device number from /proc/$pid/mountinfo.
lsfd retrieves a device number from stat syscall.

This assumption is not correct for a file on an overlay file system
whose block devices behind lowerdir and upperdir are different.
Using findmnt is not suitable for comparing device numbers.

This change uses stat command instead of findmnt to retrieve the
device number.

Reported-by: Anatoly Pugachev <matorola@gmail.com>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) improve the help messages of test_mkfds helper command
Masatake YAMATO [Sat, 26 Feb 2022 17:42:52 +0000 (02:42 +0900)] 
tests: (lsfd) improve the help messages of test_mkfds helper command

The change notifies users that -I, --parameters option takes a
factory name.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoMerge branch 'master' of https://github.com/vs49688/util-linux
Karel Zak [Mon, 21 Feb 2022 10:05:23 +0000 (11:05 +0100)] 
Merge branch 'master' of https://github.com/vs49688/util-linux

* 'master' of https://github.com/vs49688/util-linux:
  libuuid: fix buffer overrun in uuid_parse_range()

2 years agoMerge branch 'cdown/2022-02-15/dmesg_subsys_after_blank' of https://github.com/cdown...
Karel Zak [Mon, 21 Feb 2022 10:04:31 +0000 (11:04 +0100)] 
Merge branch 'cdown/2022-02-15/dmesg_subsys_after_blank' of https://github.com/cdown/util-linux

* 'cdown/2022-02-15/dmesg_subsys_after_blank' of https://github.com/cdown/util-linux:
  dmesg: Start colouring subsys delimiter only after trailing blank

2 years agoMerge branch 'patch-4' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 21 Feb 2022 10:03:22 +0000 (11:03 +0100)] 
Merge branch 'patch-4' of https://github.com/mariobl/util-linux

* 'patch-4' of https://github.com/mariobl/util-linux:
  Fix markup in su.1.adoc

2 years agohardlink: make it possible to compare paths
Karel Zak [Thu, 17 Feb 2022 12:59:08 +0000 (13:59 +0100)] 
hardlink: make it possible to compare paths

Addresses: https://github.com/util-linux/util-linux/issues/1602
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: fix mnt_fs_is_* return codes
Karel Zak [Thu, 17 Feb 2022 12:48:01 +0000 (13:48 +0100)] 
libmount: fix mnt_fs_is_* return codes

Let's follow the way we already use in context to return 1 or 0 explicitly.

Fixes: https://github.com/util-linux/util-linux/issues/1607
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibuuid: fix buffer overrun in uuid_parse_range()
Zane van Iperen [Tue, 15 Feb 2022 14:57:17 +0000 (00:57 +1000)] 
libuuid: fix buffer overrun in uuid_parse_range()

It attempts to access in_start[36], despite 35 being the maximum
allowed index.

Reported-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2 years agodmesg: Start colouring subsys delimiter only after trailing blank
Chris Down [Tue, 15 Feb 2022 13:39:57 +0000 (13:39 +0000)] 
dmesg: Start colouring subsys delimiter only after trailing blank

This improves colouring when certain message levels are configured to
display a background colour using terminal-colors.d. Previously the
background colour starts at ":" on messages with a subsystem present,
which looks pretty odd. Now it starts from the remaining message after
the subsys (if there is one).

If one only uses foreground colours, this largely makes no difference:
the colon is now coloured with the same subsys colour, but there's no
difference for the blank.

Signed-off-by: Chris Down <chris@chrisdown.name>
2 years agoFix markup in su.1.adoc
Mario Blättermann [Mon, 14 Feb 2022 17:23:10 +0000 (18:23 +0100)] 
Fix markup in su.1.adoc

Small, but important mistake in asciidoc formatting, would lead to a scrambled paragraph.

2 years agohardlink: ignore files specified more than once
Karel Zak [Mon, 14 Feb 2022 13:53:24 +0000 (14:53 +0100)] 
hardlink: ignore files specified more than once

Fixes: https://github.com/util-linux/util-linux/issues/1602
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofindmnt: commit missing flag
Karel Zak [Mon, 14 Feb 2022 13:01:54 +0000 (14:01 +0100)] 
findmnt: commit missing flag

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: update --help output for -y
Karel Zak [Mon, 14 Feb 2022 13:01:35 +0000 (14:01 +0100)] 
lsblk: update --help output for -y

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsipc: add -y,--shell
Karel Zak [Mon, 14 Feb 2022 13:00:14 +0000 (14:00 +0100)] 
lsipc: add -y,--shell

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofindmnt: add -y,--shell
Karel Zak [Mon, 14 Feb 2022 12:59:29 +0000 (13:59 +0100)] 
findmnt: add -y,--shell

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolslogins: add -y,--shell
Karel Zak [Mon, 14 Feb 2022 12:58:30 +0000 (13:58 +0100)] 
lslogins: add -y,--shell

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'manpage-fixes' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 14 Feb 2022 12:16:27 +0000 (13:16 +0100)] 
Merge branch 'manpage-fixes' of https://github.com/mariobl/util-linux

* 'manpage-fixes' of https://github.com/mariobl/util-linux:
  Fix several adoc files as reported by Helge Kreutzmann
  eject.1.adoc: Fix markup
  colors.adoc: format command name bold
  Add missing *.adoc files to Makemodule.am
  Add help-version.adoc to po4a configuration file
  Add new *.adoc files to po4a configuration file
  Fix markup and wording in colors.adoc

2 years agoMerge branch 'lsfd-fix-wrong-fmt-str-and-cast-type' of https://github.com/masatake...
Karel Zak [Mon, 14 Feb 2022 12:14:51 +0000 (13:14 +0100)] 
Merge branch 'lsfd-fix-wrong-fmt-str-and-cast-type' of https://github.com/masatake/util-linux

* 'lsfd-fix-wrong-fmt-str-and-cast-type' of https://github.com/masatake/util-linux:
  lsfd: fix the way to print length of mmap area
  lsfd: fix the way to print stat.st_nlink
  lsfd: fix the way to print stat.st_size

2 years agohexdump: call getline() in more robust way
Karel Zak [Mon, 14 Feb 2022 12:00:55 +0000 (13:00 +0100)] 
hexdump: call getline() in more robust way

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agounshare: call getline() in more robust way
Karel Zak [Mon, 14 Feb 2022 12:00:36 +0000 (13:00 +0100)] 
unshare: call getline() in more robust way

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agochsh, chfn: remove readline support [CVE-2022-0563]
Karel Zak [Thu, 10 Feb 2022 11:03:17 +0000 (12:03 +0100)] 
chsh, chfn: remove readline support [CVE-2022-0563]

The readline library uses INPUTRC= environment variable to get a path
to the library config file. When the library cannot parse the
specified file, it prints an error message containing data from the
file.

Unfortunately, the library does not use secure_getenv() (or a similar
concept) to avoid vulnerabilities that could occur if set-user-ID or
set-group-ID programs.

Reported-by: Rory Mackie <rory.mackie@trailofbits.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoFix several adoc files as reported by Helge Kreutzmann
Mario Blättermann [Sun, 13 Feb 2022 18:26:07 +0000 (19:26 +0100)] 
Fix several adoc files as reported by Helge Kreutzmann

2 years agoeject.1.adoc: Fix markup
Mario Blättermann [Sun, 13 Feb 2022 12:19:51 +0000 (13:19 +0100)] 
eject.1.adoc: Fix markup

2 years agocolors.adoc: format command name bold
Mario Blättermann [Sat, 12 Feb 2022 20:47:39 +0000 (21:47 +0100)] 
colors.adoc: format command name bold

2 years agoMerge branch 'util-linux:master' into manpage-fixes
Mario Blättermann [Fri, 11 Feb 2022 15:15:02 +0000 (16:15 +0100)] 
Merge branch 'util-linux:master' into manpage-fixes

2 years agoAdd missing *.adoc files to Makemodule.am
Mario Blättermann [Fri, 11 Feb 2022 15:13:21 +0000 (16:13 +0100)] 
Add missing *.adoc files to Makemodule.am

2 years agolib/buffer: make sure buffer without data is zero terminated [asan]
Karel Zak [Fri, 11 Feb 2022 12:00:05 +0000 (13:00 +0100)] 
lib/buffer: make sure buffer without data is zero terminated [asan]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: add -y/--shell
Karel Zak [Fri, 11 Feb 2022 11:37:48 +0000 (12:37 +0100)] 
lsblk: add -y/--shell

Fixes: https://github.com/util-linux/util-linux/issues/1594
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: use new libsmartcols functions
Karel Zak [Fri, 11 Feb 2022 11:27:38 +0000 (12:27 +0100)] 
lsfd: use new libsmartcols functions

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocolumn: use new libsmartcols functions
Karel Zak [Fri, 11 Feb 2022 11:27:38 +0000 (12:27 +0100)] 
column: use new libsmartcols functions

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agowipefs: remove dead code
Karel Zak [Fri, 11 Feb 2022 11:25:41 +0000 (12:25 +0100)] 
wipefs: remove dead code

Since d9921b2a12 (2017-06-29) no_heading is enable for parsable
format, so this code is unnecessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude/carefulputc: remove unused function
Karel Zak [Fri, 11 Feb 2022 11:15:30 +0000 (12:15 +0100)] 
include/carefulputc: remove unused function

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibsmartcols: change "export" behavior, add "shellvar" flag
Karel Zak [Fri, 11 Feb 2022 11:06:41 +0000 (12:06 +0100)] 
libsmartcols: change "export" behavior, add "shellvar" flag

In version 2.37 the "export" output format automatically modifies
column names to be compatible with shell's requirements for variable
names. This change was backwardly incompatible for people who use for
example "lsblk -P" in non-shell environment.

It's painful to modify this behavior again in v2.38, but it seems
better to add a way how to control this behavior independently on
output format as it seems attractive feature for more use-cases.

This commit introduces scols_table_enable_shellvar() function to
enable/disable this feature.

It also introduces

scols_column_set_name
scols_column_get_name
scols_column_get_name_as_shellvar
scols_table_is_shellvar

to make it easy to work with column names.

Fixes: https://github.com/util-linux/util-linux/issues/1594
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: fix the way to print length of mmap area
Masatake YAMATO [Thu, 10 Feb 2022 16:18:08 +0000 (01:18 +0900)] 
lsfd: fix the way to print length of mmap area

Suggested-by: Anatoly Pugachev <matorola@gmail.com>.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoAdd help-version.adoc to po4a configuration file
Mario Blättermann [Thu, 10 Feb 2022 11:05:31 +0000 (12:05 +0100)] 
Add help-version.adoc to po4a configuration file

2 years agoAdd new *.adoc files to po4a configuration file
Mario Blättermann [Thu, 10 Feb 2022 10:58:09 +0000 (11:58 +0100)] 
Add new *.adoc files to po4a configuration file

2 years agoFix markup and wording in colors.adoc
Mario Blättermann [Thu, 10 Feb 2022 10:54:54 +0000 (11:54 +0100)] 
Fix markup and wording in colors.adoc

2 years agolsfd: fix the way to print stat.st_nlink
Masatake YAMATO [Thu, 10 Feb 2022 07:14:11 +0000 (16:14 +0900)] 
lsfd: fix the way to print stat.st_nlink

The type used for casting the member was too small; for the
"%ju" format spec, we should use uintmax_t for the purpose.

This change may fix the bug reported in
https://github.com/util-linux/util-linux/issues/1511#issuecomment-1033697617
in GitHub#1511 by Anatoly Pugachev <matorola@gmail.com>.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: fix the way to print stat.st_size
Masatake YAMATO [Thu, 10 Feb 2022 07:06:42 +0000 (16:06 +0900)] 
lsfd: fix the way to print stat.st_size

The format string was wrong and a proper cast operator was missed
for printing the member. See the example in stat(2).

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoman-pages: consolidate COLORS section
Karel Zak [Wed, 9 Feb 2022 10:56:36 +0000 (11:56 +0100)] 
man-pages: consolidate COLORS section

* use man-common/colors.adoc include file

* improve description and add example how to disable colors globally
  or for specific tool

Addresses: https://github.com/util-linux/util-linux/issues/1593
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibfdisk: (MBR) recognize EBBR protective partitions
Vincent Stehlé [Fri, 3 Dec 2021 15:59:08 +0000 (16:59 +0100)] 
libfdisk: (MBR) recognize EBBR protective partitions

The MBR partition type 0xF8 is used by the Arm EBBR specification for
protective partitions over fixed-location firmware images.

References: https://github.com/ARM-software/ebbr
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
2 years agolast: don't assume zero terminate strings
Karel Zak [Mon, 7 Feb 2022 12:34:43 +0000 (13:34 +0100)] 
last: don't assume zero terminate strings

Detected by fuzzer and AddressSanitizer. The utmp strings do not
have to be zero terminated.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobuild-sys: report C++ compiler too
Karel Zak [Mon, 7 Feb 2022 11:56:44 +0000 (12:56 +0100)] 
build-sys: report C++ compiler too

We use clang++ to compile fuzzer tests.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobuild-sys: add missing files from tools/ directory
Karel Zak [Mon, 7 Feb 2022 10:27:56 +0000 (11:27 +0100)] 
build-sys: add missing files from tools/ directory

Fixes: https://github.com/util-linux/util-linux/issues/1597
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomisc: use everywhere mkstemp_cloexec() as fallback to mkostemp()
Karel Zak [Mon, 7 Feb 2022 10:10:03 +0000 (11:10 +0100)] 
misc: use everywhere mkstemp_cloexec() as fallback to mkostemp()

The function mkostemp() does not have to be available everywhere,
and for this reason, we have mkstemp_cloexec() as a fallback solution.
Unfortunately, some codes (usually fuzzy tests) do not use the
fallback. Let's fix it.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agogetopt.1.adoc: render synopsis rules on separate lines
Johannes Altmanninger [Sun, 6 Feb 2022 06:11:58 +0000 (07:11 +0100)] 
getopt.1.adoc: render synopsis rules on separate lines

AsciiDoc ignores single line breaks, so the synopsis of

*getopt* _variant1_
*getopt* _variant2_

will render as one line in the manpage.

Fix this by adding a blank line in between two rules, like we do
elsewhere.  This means that the manpage also has blank lines.

*getopt* _variant1_

*getopt* _variant2_

Alternative solution: we could avoid the blank lines like below,
but that'd be inconsistent with our other manpages.

*getopt* _variant1_ +
*getopt* _variant2_ +

or, equivalently, use the verse[*] directive

[verse]
*getopt* _variant1_
*getopt* _variant2_

[*]: https://docs.asciidoctor.org/asciidoc/latest/blocks/verses/

Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
2 years agokill.1.adoc: clarify syntax of -SIG argument in synopsis
Johannes Altmanninger [Sun, 6 Feb 2022 06:11:57 +0000 (07:11 +0100)] 
kill.1.adoc: clarify syntax of -SIG argument in synopsis

kill.1.adoc has this synopsis line

*kill*  [-signal|*-s* _signal_]

For "-signal", the leading "-" should be typed literally, and the
"signal" suffix should be replaced by a signal name/number.
This means that according to GNU man(1), the "-" should render in
bold font whereas the "signal" placeholder should use italic (which
terminals often render with underscores).

Make it so. Use two askerisks because one is not enough for sub-word
markup [*].

[*] https://docs.asciidoctor.org/asciidoc/latest/text/#unconstrained

Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>