]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
3 years agoManual pages: mount.8: SEE ALSO: add some obvious references
Michael Kerrisk (man-pages) [Thu, 28 May 2020 14:58:20 +0000 (16:58 +0200)] 
Manual pages: mount.8: SEE ALSO: add some obvious references

And correct sort order for "umount(8)" entry.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: mount.8, umount.8: Consistently format pathnames with italic
Michael Kerrisk (man-pages) [Thu, 28 May 2020 14:58:19 +0000 (16:58 +0200)] 
Manual pages: mount.8, umount.8: Consistently format pathnames with italic

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: mount.8, umount.8: Clarify that "namespace" means "mount namespace"
Michael Kerrisk (man-pages) [Thu, 28 May 2020 14:58:18 +0000 (16:58 +0200)] 
Manual pages: mount.8, umount.8: Clarify that "namespace" means "mount namespace"

There are various references to "namespaces" when it would be
clearer to say "mount namespaces". Also, add references to the
mount_namespaces(7) manual page.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: setpriv.1: Minor formatting and typo fixes
Michael Kerrisk (man-pages) [Thu, 28 May 2020 14:58:17 +0000 (16:58 +0200)] 
Manual pages: setpriv.1: Minor formatting and typo fixes

These seem all "obviously correct", so I'm rolling them up
into one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: unshare.1: typo fix
Michael Kerrisk (man-pages) [Thu, 28 May 2020 14:58:16 +0000 (16:58 +0200)] 
Manual pages: unshare.1: typo fix

(Introduced in one of my earlier commits)

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: unshare.1: EXAMPLES: improve persistent mount namespace example
Michael Kerrisk (man-pages) [Thu, 28 May 2020 14:58:15 +0000 (16:58 +0200)] 
Manual pages: unshare.1: EXAMPLES: improve persistent mount namespace example

The text describing the persistent mount namespace example
is rather confused. Explain more clearly the purpose of making
the parent directory a bind mount with private propagation.
Also make a few other wording improvements.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agosetarch: fix stderr handling in uname26 tests
Helge Deller [Wed, 27 May 2020 23:20:58 +0000 (23:20 +0000)] 
setarch: fix stderr handling in uname26 tests

A while ago stdout and stderr have been split in these testcases, but
"FATAL: kernel too old" is actually treated as an "okay" output. However
this FATAL ends up on stderr, so when it happens, it is not seen in
the captured stdout.

Fix this by merging stdout/stderr in these cases once again.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961639
Fixes: cbf858aa085e25aa5afd1d06decaea6e14a8963f
3 years agoManual pages: rename EXAMPLE section to EXAMPLES
Michael Kerrisk (man-pages) [Mon, 25 May 2020 12:59:12 +0000 (14:59 +0200)] 
Manual pages: rename EXAMPLE section to EXAMPLES

Earlier, I patched various pages to consistently use EXAMPLE as a
section heading, rather than EXAMPLES.  (At that time, both headings
occurred in util-linux, with roughly equal frequency.)

Since then, I've observed that EXAMPLES is the more common usage
across a large corpus of manual pages. So, in Linux the man-pages
project, I switched to using EXAMPLES also. This patch makes the same
change for util-linux.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoMan pages: ipcmk.1, ipcs.1, lsipc.1: explicitly mention "System V"
Michael Kerrisk (man-pages) [Mon, 25 May 2020 12:59:11 +0000 (14:59 +0200)] 
Man pages: ipcmk.1, ipcs.1, lsipc.1: explicitly mention "System V"

Explicitly mention "System V" in the description, so that readers do not
get confused with the POSIX IPC mechanisms.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: ipcmk.1, ipcrm.1, ipcs.1, lsipc.1: SEE ALSO: add sysvipc(7)
Michael Kerrisk (man-pages) [Mon, 25 May 2020 12:59:10 +0000 (14:59 +0200)] 
Manual pages: ipcmk.1, ipcrm.1, ipcs.1, lsipc.1: SEE ALSO: add sysvipc(7)

These commands all relate to System V IPC, so point the reader
at the relevant Section 7 page provided by the Linux man-pages
project.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: kill.1: improve the description of the --timout option
Michael Kerrisk (man-pages) [Mon, 25 May 2020 12:59:09 +0000 (14:59 +0200)] 
Manual pages: kill.1: improve the description of the --timout option

The text describing this option is a little hard to understand.
Improve it.

Cc: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: kill.1: various language, spelling, and formatting fixes
Michael Kerrisk (man-pages) [Mon, 25 May 2020 12:59:08 +0000 (14:59 +0200)] 
Manual pages: kill.1: various language, spelling, and formatting fixes

These seem all "obviously correct", so I'm rolling them up into
one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoswapoff: do not use 1 exist status at all
Karel Zak [Thu, 28 May 2020 10:51:26 +0000 (12:51 +0200)] 
swapoff: do not use 1 exist status at all

The make sure we are not in collision with old versions.

Addresses: https://github.com/karelzak/util-linux/issues/1050
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoswapoff: cleanup EXIT STATUS
Karel Zak [Wed, 27 May 2020 16:58:30 +0000 (18:58 +0200)] 
swapoff: cleanup EXIT STATUS

The current code hides details about reason why swapoff(8) and swapoff(2) failed. For example
ENOMEM from swapoff(2) is important as it indicates OOM.

The patch also clean ups --all return codes to be more compatible for
example with [u]mount --all, etc.

Addresses: https://github.com/karelzak/util-linux/issues/1050
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibfdisk: (dos) be more explicit in fdisk_verify_disklabel() output
Karel Zak [Wed, 27 May 2020 15:46:49 +0000 (17:46 +0200)] 
libfdisk: (dos) be more explicit in fdisk_verify_disklabel() output

Let's print number of detected errors or "No errors detected." for
MBR. We already use the same for GPT.

The patch also modifies fdisk_verify_disklabel() return code to inform
caller about number of issues.

Addresses: https://github.com/karelzak/util-linux/issues/1051
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agofdisk: add --lock and LOCK_BLOCK_DEVICE
Karel Zak [Wed, 27 May 2020 14:58:08 +0000 (16:58 +0200)] 
fdisk: add --lock and LOCK_BLOCK_DEVICE

Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agowipefs: add --lock and LOCK_BLOCK_DEVICE
Karel Zak [Wed, 27 May 2020 14:58:08 +0000 (16:58 +0200)] 
wipefs: add --lock and LOCK_BLOCK_DEVICE

Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agosfdisk: add --lock and LOCK_BLOCK_DEVICE
Karel Zak [Wed, 27 May 2020 14:58:08 +0000 (16:58 +0200)] 
sfdisk: add --lock and LOCK_BLOCK_DEVICE

Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agomkswap: add --lock and LOCK_BLOCK_DEVICE
Karel Zak [Wed, 27 May 2020 14:58:08 +0000 (16:58 +0200)] 
mkswap: add --lock and LOCK_BLOCK_DEVICE

Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agocfdisk: add --lock and LOCK_BLOCK_DEVICE
Karel Zak [Wed, 27 May 2020 14:58:08 +0000 (16:58 +0200)] 
cfdisk: add --lock and LOCK_BLOCK_DEVICE

Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolib/blkdev: add support for --lock and LOCK_BLOCK_DEVICE
Karel Zak [Tue, 26 May 2020 15:21:04 +0000 (17:21 +0200)] 
lib/blkdev: add support for --lock and LOCK_BLOCK_DEVICE

All simple function to parse --lock <mode> and $LOCK_BLOCK_DEVICE,
and to flock the fd.

The supported <mode> is:

"1" or "yes" - LOCK_EX
"0" or "no" - do nothing
"nonblock" - LOCK_EX | LOCK_NB

The function tries LOCK_NB before the solo LOCK_EX and prints
inform user that it will wait, for example:

session A:
# sfdisk --lock /dev/sdc

session B:
# sfdisk --lock /dev/sdc
sfdisk: /dev/sdc: device already locked, waiting to get lock ...
^C

# sfdisk --lock=nonblock /dev/sdc
sfdisk: /dev/sdc: device already locked

Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agobuild-sys: add $LDADD and libcommon to test_logindefs_LDADD
Karel Zak [Tue, 26 May 2020 09:43:07 +0000 (11:43 +0200)] 
build-sys: add $LDADD and libcommon to test_logindefs_LDADD

Addresses: https://travis-ci.org/github/karelzak/util-linux/jobs/690915120
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agomore: avoid libmagic telling an empty file is binary
Sami Kerola [Mon, 25 May 2020 07:30:24 +0000 (08:30 +0100)] 
more: avoid libmagic telling an empty file is binary

My earlier change that took libmagic in use to identify mime-type of an input
file caused empty files to be marked binary.  Before the change empty files
were simply displayed as empty.  This change will restore that behavior.

Addresses: 09070e1a658e70ec203150e4fa5f486b32771858
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
3 years agoManual pages: unshare.1: fix examples, part 3
Michael Kerrisk [Sat, 23 May 2020 06:43:25 +0000 (08:43 +0200)] 
Manual pages: unshare.1: fix examples, part 3

The time namespaces example had no explanatory text!  Add some.
Also, use the "uptime -p" option for output that is more compact
(and perhaps more readable).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: unshare.1: fix examples, part 2
Michael Kerrisk [Sat, 23 May 2020 06:43:24 +0000 (08:43 +0200)] 
Manual pages: unshare.1: fix examples, part 2

The explanation of the --kill-child example was quite confused and
also the example shell demo was broken because of quoting issues.

It is not the case that the *children* of 'program' would adopted by
init, but rather that 'program' itself (which would be running as PID
1 inside the namespace and is a child of 'unshare') would be adopted
by init.

Rework the --kill-child example. Add a lot more explanation, and
expand the example shell session to give the reader a much better
picture of what is going on.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: unshare.1: fix examples, part 1
Michael Kerrisk [Sat, 23 May 2020 06:43:23 +0000 (08:43 +0200)] 
Manual pages: unshare.1: fix examples, part 1

The examples section of this manual page is rather hard to grok.
First, the arrangement of the text as follows makes life harder
than needed for the reader:

    shell demo
        explanatory text

It helps the reader if an example *begins* with an explanation of
what is being demonstrated. Therefore, rearrange these examples as:

    explanatory text
        shell demo

In addition, let's provide a bit more explanation for the first three
examples and expand the second example (user namespaces) a little.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: nsenter.1: note that 'file' can be a bind mount
Michael Kerrisk [Sat, 23 May 2020 06:43:22 +0000 (08:43 +0200)] 
Manual pages: nsenter.1: note that 'file' can be a bind mount

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: nsenter.1: clarify the intro discussion
Michael Kerrisk [Sat, 23 May 2020 06:43:21 +0000 (08:43 +0200)] 
Manual pages: nsenter.1: clarify the intro discussion

The intro paragraph talks about entering the namespace of other
processes. That's not quite accurate, since nsenter can be used (via
a bind mount) to enter a namespace that has no member processes.  So
rework NAME and the intro paragraph in DESCRIPTION to remove mention
of "processes".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: unshare.1: improve intro paragraphs
Michael Kerrisk [Sat, 23 May 2020 06:43:20 +0000 (08:43 +0200)] 
Manual pages: unshare.1: improve intro paragraphs

The intro paragraphs of this page are rather hard for a newcomer to
grok. The name of the underlying system call (and consequently the
name of the command) are "strange", but let's help the reader by
naming more clearly what unshare(1) does: creating new namespaces. In
addition, clarify and expand the details on making a namespace
persistent using bind mounts.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: nsenter.1, unshare.1: remove repeated references to clone(2)
Michael Kerrisk [Sat, 23 May 2020 06:43:19 +0000 (08:43 +0200)] 
Manual pages: nsenter.1, unshare.1: remove repeated references to clone(2)

Back in commits f85b9777c2965671cd and 894efece9eb894, in the
description of each namespace type, I added repeated cross references
to clone(2). Drop these references. The Section 7 namespaces pages,
which are already noted in the nsenter(1) and unshare(1) manual pages,
provide much more relevant information. Furthermore, pointing the
reader at clone(2) is perhaps a little misleading, since the system
call underlying nsenter(1) is setns(2) and the system call underlying
unshare(1) is unshare(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: nsenter.1, unshare.1: add a reference to time_namespaces(7)
Michael Kerrisk [Sat, 23 May 2020 06:43:18 +0000 (08:43 +0200)] 
Manual pages: nsenter.1, unshare.1: add a reference to time_namespaces(7)

Linux man-pages now has a page describing time namespaces.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: nsenter.1, unshare.1: update references to *_namespaces(7) pages
Michael Kerrisk [Sat, 23 May 2020 06:43:17 +0000 (08:43 +0200)] 
Manual pages: nsenter.1, unshare.1: update references to *_namespaces(7) pages

Nowadays, the Linux man-pages project provides separate Section 7
manual pages for each type of namespace. Update the cross references
in nsenter.1 and unshare.1 to reflect this.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agobuild-sys: cleanup $vendordir use
Karel Zak [Mon, 25 May 2020 11:44:22 +0000 (13:44 +0200)] 
build-sys: cleanup $vendordir use

- use --with-vendordir= (rather than --enable) to be compatible with
  another package stuuf

- add USE_VENDORDIR automake condition

- add vendordir to global AM_CPPFLAGS to avoid binary specific cflags
  modifications

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'libeconf' of https://github.com/thkukuk/util-linux
Karel Zak [Mon, 25 May 2020 10:23:13 +0000 (12:23 +0200)] 
Merge branch 'libeconf' of https://github.com/thkukuk/util-linux

* 'libeconf' of https://github.com/thkukuk/util-linux:
  Adjust test output to pass test suite
  Add support for libeconf

3 years agofstrim: add --listed-in <file[:file ..]>
Karel Zak [Fri, 22 May 2020 12:39:31 +0000 (14:39 +0200)] 
fstrim: add --listed-in <file[:file ..]>

This new option works like --all but it allows to specify multiple
files with filesystems to make fstrim configuration more portable
between distributions. For example:

 fstrim --listed-in /etc/fstab:/proc/self/mountinfo

forces fstrim to try fstab and if unsuccessful than try mountinfo.

Addresses: https://github.com/karelzak/util-linux/issues/1019
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agobash-completion: chmod -x
Karel Zak [Fri, 22 May 2020 10:02:25 +0000 (12:02 +0200)] 
bash-completion: chmod -x

Addresses: https://github.com/karelzak/util-linux/issues/1042
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agohwclock: improve use of settimeofday() portability
Karel Zak [Mon, 11 May 2020 11:35:21 +0000 (13:35 +0200)] 
hwclock: improve use of settimeofday() portability

The different libc implements TZ deprecation in settimeofday() library
function in the different way. Let's hide these portability issues and
use directly Linux syscall to set timezone.

Addresses: https://github.com/karelzak/util-linux/issues/995
Signed-off-by: Karel Zak <kzak@redhat.com>
CC: J William Piggott <elseifthen@gmx.com>
3 years agotests: sfdisk fill correctly gaps if default start requested
Karel Zak [Fri, 22 May 2020 09:30:27 +0000 (11:30 +0200)] 
tests: sfdisk fill correctly gaps if default start requested

References: 83fdb880b953164fec7cc603c4ece11cb78762db
Addresses: https://github.com/karelzak/util-linux/issues/1044
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'patch-umount-autocomp' of https://github.com/emollier/util-linux
Karel Zak [Fri, 22 May 2020 09:06:27 +0000 (11:06 +0200)] 
Merge branch 'patch-umount-autocomp' of https://github.com/emollier/util-linux

* 'patch-umount-autocomp' of https://github.com/emollier/util-linux:
  bash-completion/umount: shell charaters escape

3 years agobuild-sys: Fix autogenerated URL in ChangeLog
Chris Hofstaedtler [Thu, 21 May 2020 15:42:30 +0000 (15:42 +0000)] 
build-sys: Fix autogenerated URL in ChangeLog

Fixes: b3a3b7eb1a15c5633ae890bec00fe5691b784d99
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
3 years agoManual pages: rename RETURN VALUES to RETURN VALUE
Michael Kerrisk (man-pages) [Thu, 21 May 2020 07:33:15 +0000 (09:33 +0200)] 
Manual pages: rename RETURN VALUES to RETURN VALUE

One page, libuuid/man/uuid_time.3, uses this section name
that differs from the norm.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: order ENVIRONMENT / FILES / CONFORMING TO consistently
Michael Kerrisk (man-pages) [Thu, 21 May 2020 07:28:49 +0000 (09:28 +0200)] 
Manual pages: order ENVIRONMENT / FILES / CONFORMING TO consistently

There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the ENVIRONMENT, FILES, and CONFORMING TO
sections are always placed toward the end of the page, just above NOTES.

One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
Michael Kerrisk (man-pages) [Thu, 21 May 2020 07:28:32 +0000 (09:28 +0200)] 
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently

There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.

One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: order AUTHORS / COPYRIGHT / SEE ALSO / AVAILABILITY consistently
Michael Kerrisk (man-pages) [Thu, 21 May 2020 07:28:21 +0000 (09:28 +0200)] 
Manual pages: order AUTHORS / COPYRIGHT / SEE ALSO / AVAILABILITY consistently

There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the AUTHORS, COPYRIGHT, SEE ALSO, and
AVAILABILITY sections are always placed at the end of the page.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoagetty: ignore ^C
Karel Zak [Fri, 22 May 2020 08:22:12 +0000 (10:22 +0200)] 
agetty: ignore ^C

Danc86 wrote:
 With agetty 2.32.1 and earlier, ^C at the login prompt is ignored. I
 noticed when upgrading to agetty 2.34, typing ^C now causes agetty to
 stop responding for 10 seconds and then it dies (and gets restarted by
 system and a new login prompt is printed).

 It logs this message:

   agetty[46048]: ttyS0: invalid character 0x3 in login name

 Previously the !isprint(ascval) condition would have caused control
 characters like ^C (\x03) to be discarded, whereas now it falls
 through to trying to decode it as part of a UTF-8 sequence, and then
 fails.

Fixes: http://github.com/karelzak/util-linux/commit/5de9751997cf490088f62f41fd92be57cf7ceea4
Addresses: https://github.com/karelzak/util-linux/issues/1046
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agobash-completion/umount: shell charaters escape
Etienne Mollier [Thu, 21 May 2020 15:20:18 +0000 (17:20 +0200)] 
bash-completion/umount: shell charaters escape

This patch brings support for automatic dangerous shell characters
escape in umount autocompletion.  Due to the very peculiar way for
bash to handle autocompletion routines, proper escaping of the shell
sequences only worked properly inside a function: _umount_point_list,
which will add to the user's namespace at the next umount attempt of
autocompleting mount point.

It also translates calls of gensub to the portable alternatives sub
and gsub, in order to allow the use of various awk implementations
(mawk, Gnu, Busybox, etc), and as such kind of undoes a recent change
to enforce the use of Gnu awk. The whole story landed into the Debian
BTS initially:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933934

PS: It's been a few months since the patch is available, sorry for the
    delay; I only got myself a Github account quite recently...

Signed-off-by: Étienne Mollier <etienne.mollier@mailoo.org>
3 years agolibfdisk: (dos) fix default partition start
Karel Zak [Thu, 21 May 2020 13:37:59 +0000 (15:37 +0200)] 
libfdisk: (dos) fix default partition start

The current code implements the default start as first free space, but
it does not check if the space is large enough.

Addresses: https://github.com/karelzak/util-linux/issues/1044
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoAdd to the list of pseudo-filesystem types
Gabriel de Perthuis [Wed, 20 May 2020 17:55:17 +0000 (19:55 +0200)] 
Add to the list of pseudo-filesystem types

Useful commands for maintaining the list:

    grep -w ^nodev /proc/filesystems |sort

In a Linux source checkout:

    git grep -wl file_system_type '*.c' |xargs grep -L FS_REQUIRES_DEV |xargs grep -wA12 file_system_type |grep -F '.name' |uniq |column -t

3 years agoManual pages: use the term "exit status"
Michael Kerrisk (man-pages) [Tue, 19 May 2020 12:54:07 +0000 (14:54 +0200)] 
Manual pages: use the term "exit status"

The manual pages currently use a multitude of terms--"exit code",
"error code", "return code", "exit code", and so on--when what
is always meant is "exit status" (the POSIX term). This patch fixes
as many of these erroneous terms as I could find.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: Standardize on EXIT STATUS as section title
Michael Kerrisk (man-pages) [Tue, 19 May 2020 12:53:21 +0000 (14:53 +0200)] 
Manual pages: Standardize on EXIT STATUS as section title

There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXIT STATUS (18), EXIT CODES (3), RETURN CODE (7),
RETURN CODES (1), or RETURN VALUE (4 instances in pages that document
commands, rather than functions).

Let's standardize on the EXIT STATUS (which is also what is
suggested in man-pages(7), and is the POSIX terminology).

A subsequent patch will clean up corresponding miswordings in
manual page text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: Standardize on ENVIRONMENT as section title
Michael Kerrisk (man-pages) [Tue, 19 May 2020 12:52:51 +0000 (14:52 +0200)] 
Manual pages: Standardize on ENVIRONMENT as section title

There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

But, let's make sure that the section is consistently titled
across pages. Currently we have ENVIRONMENT (many) or ENVIRONMENT
VARIABLES (3).  Let's standardize on ENVIRONMENT (which is also
what is suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: Standardize on OPTIONS as section title
Michael Kerrisk (man-pages) [Tue, 19 May 2020 12:52:34 +0000 (14:52 +0200)] 
Manual pages: Standardize on OPTIONS as section title

There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have OPTIONS (many) or OPTION (1 page, setpriv(1),
which actually supports multiple options!).

Let's standardize on OPTIONS (which is also what is
suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: Standardize on CONFORMING TO as section title
Michael Kerrisk (man-pages) [Tue, 19 May 2020 12:52:20 +0000 (14:52 +0200)] 
Manual pages: Standardize on CONFORMING TO as section title

There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have STANDARDS (3) or CONFORMING TO (6).
Let's standardize on the latter (which is also what is
suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: Standardize on EXAMPLE as section title
Michael Kerrisk (man-pages) [Tue, 19 May 2020 12:51:48 +0000 (14:51 +0200)] 
Manual pages: Standardize on EXAMPLE as section title

There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXAMPLE (10) or EXAMPLES (23).
Let's standardize on the EXAMPLE (which is also what is
suggested in man-pages(7)) and used consistently across
a large number of pages in the Linux man-pages project.

(I realize the choice to go EXAMPLE, rather than EXAMPLES,
may be debatable. If necessary, I'd write a patch that instead
goes the other way, but I'd prefer to follow man-pages(7).)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoManual pages: Standardize on AUTHORS as section title
Michael Kerrisk (man-pages) [Tue, 19 May 2020 12:51:28 +0000 (14:51 +0200)] 
Manual pages: Standardize on AUTHORS as section title

There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

In the Linux man-pages project, I long ago did away with the
AUTHOR(S) section, but I realize some projects like to keep this.

But, let's make sure that the section is consistently titled
across pages. Currently we have AUTHOR (47) or AUTHORS (41).
Let's standardize on the latter (which is also what is
suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agodocs: (man) remove double quotes (") in .SH lines
Michael Kerrisk (man-pages) [Tue, 19 May 2020 08:31:19 +0000 (10:31 +0200)] 
docs: (man) remove double quotes (") in .SH lines

Using double quotes in .SH lines containing multiple words is unneeded,
and in any case is not consistently done in the util-linux manual pages,
where double quotes are used in only around half of the cases.
(This usage was long ago elminated in the man-pages project, with
no ill effects reported to date.)

Remove these quotes, so that .SH lines are more uniform, in preparation
for some (more easily) scripted doiscovery of consistency problems in
(and possibly global fixes to) the manual pages.

Other than stripping the double quotes, this patch makes no changes to
the content of the manual pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoagetty: extend --issue-file to support multiple paths
Karel Zak [Tue, 19 May 2020 08:55:20 +0000 (10:55 +0200)] 
agetty: extend --issue-file to support multiple paths

The current default behavior is to print the first issue file/dir and
all alternative locations are used as a backup solution only. If something
is found than the rest is ignored. The --issue-file allow to overwrite
this default behavior, but currently it supports only one file/dir.

This patch extend --issue-file to support ':' separated list of paths
and *all* the files (if exist and no empty) in the list are printed.

 agetty --issue-file=/etc/issue:/etc/issue.d:/run/issue:/run/issue.d:/usr/lib/issue:/usr/lib/issue.d

Addresses: https://github.com/karelzak/util-linux/issues/1041
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibfdisk: (dos) be more robust about max number of partitions
Karel Zak [Mon, 18 May 2020 12:13:33 +0000 (14:13 +0200)] 
libfdisk: (dos) be more robust about max number of partitions

It seems the previous MAXIMUM_PARTS bug fix has not been generic
enough. Let's use the check for all dos_add_partition().

This patch also remove libfdisk attempt to be smart and search for
unused primary partition. If you need more than 60 partition in MBR
than you have a different problem that cannot be solved by libfdisk
...

References: http://github.com/karelzak/util-linux/commit/b80fb30a5b79ce2cc8c7486e1435ec061aa79e2f
Addresses: https://github.com/karelzak/util-linux/issues/1022
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolib/strutils: fix parse_size() for large numbers
Karel Zak [Mon, 18 May 2020 11:34:55 +0000 (13:34 +0200)] 
lib/strutils: fix parse_size() for large numbers

For example
  ./test_strutils  --size '1.0000000000000000000000000000018000000000000000010M'
  ./test_strutils  --size '1.18446744073709551615M'

ends with infinite loop due to frac_div variable overflow.

Addresses: https://github.com/karelzak/util-linux/issues/1023
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'cal_column' of https://github.com/utix/util-linux
Karel Zak [Mon, 18 May 2020 09:21:22 +0000 (11:21 +0200)] 
Merge branch 'cal_column' of https://github.com/utix/util-linux

* 'cal_column' of https://github.com/utix/util-linux:
  cal: Remove todo
  cal: Add test, all are checked against ncal
  cal: Update man page
  cal: Add column mode
  cal: Add helper functions for left align
  cal: Add weekdays into cal_control

3 years agodocs: Fix dead references to kernel documentation
Yannick Le Pennec [Sun, 17 May 2020 15:13:22 +0000 (23:13 +0800)] 
docs: Fix dead references to kernel documentation

Most date back to reorganisation of the Documentation/ tree in 2016,
new paths based on v5.7-rc5:

fdisk.8:   Documentation/{,admin-guide/}devices.txt
eject.c:   Documentation/{,userspace-api/}ioctl/cdrom.rst
mount.8:   Documentation/filesystems/adfs.{txt,rst}
rfkill.8:  Documentation/{rfkill.txt,driver-api/rfkill.rst}
tunelp.8:  Documentation/{parport.txt,admin-guide/parport.rst}
zramctl.8: Documentation/{blockdev/zram.txt,admin-guide/blockdev/zram.rst}

Signed-off-by: Yannick Le Pennec <yannick.lepennec@live.fr>
3 years agoipcs.1: ipcs no longer needs read permission on IPC resources
Michael Kerrisk [Sat, 16 May 2020 07:45:11 +0000 (09:45 +0200)] 
ipcs.1: ipcs no longer needs read permission on IPC resources

With changes starting around util-linux commit 058e81540fbb0d2b78
that switched from using IPC_STAT to parsing /proc/sysvipc/*,
ipcs now shows all IPC objects rather than just the objects for
which the user has read permission. Update the page to reflect this
fact, and also add a NOTES section describing the historical and
fallback behavior where /proc is not available.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agodocs: Some minor fixes in some manuals
Bjarni Ingi Gislason [Thu, 14 May 2020 23:51:29 +0000 (23:51 +0000)] 
docs: Some minor fixes in some manuals

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ././misc-utils/kill.1

<./misc-utils/kill.1>:173 (macro BR): only 1 argument, but more are expected

Input file is ././misc-utils/lsblk.8

troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-old.tmac':478: macro 'BR'
troff: backtrace: file '<./misc-utils/lsblk.8>':122
troff: <./misc-utils/lsblk.8>:122: warning: trailing space

Input file is ././sys-utils/mount.8

an-old.tmac: <./sys-utils/mount.8>:2427 (.RE): warning: extra .RE or .RS is missing before it; "an-RS-open" is 0.

Input file is ././sys-utils/unshare.1

<./sys-utils/unshare.1>:176 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:181 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:240 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:246 (macro BR): only 1 argument, but more are expected

Input file is ././term-utils/agetty.8

troff: backtrace: file '<./term-utils/agetty.8>':130
troff: <./term-utils/agetty.8>:130: warning: trailing space

Input file is ././text-utils/more.1

troff: backtrace: file '<./text-utils/more.1>':91
troff: <./text-utils/more.1>:91: warning: macro 'b' not defined

  The output from nroff and troff is unchanged, except for the word
"number" in text-utils/more.1, that was missing.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agosfdisk: (man) fix typo
Gaël PORTAY [Fri, 15 May 2020 12:52:06 +0000 (08:52 -0400)] 
sfdisk: (man) fix typo

3 years agoblkzone: deny destructive ioctls on busy blockdev
Johannes Thumshirn [Fri, 15 May 2020 08:41:33 +0000 (17:41 +0900)] 
blkzone: deny destructive ioctls on busy blockdev

If a user submits a zone management ioctl from user-space, like a zone
reset and a file-system (like zonefs or f2fs) is mounted on the zoned
block device, the zone will get reset and the file-system's cached value
of the zone's write-pointer becomes invalid.

Subsequent writes to this zone from the file-system will result in
unaligned writes and the drive will error out.

Open the block device file in exclusive mode for submitting these ioctls.
If a file-system is mounted the kernel will return -EBUSY and we can't
continue issuing the ioctl.

[kzak@redhat.com: - remove unnecessary error message]

Reported-by: Coly Li <colyli@suse.de>
Cc: Damien Le Moal <Damien.LeMoal@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibmount: (umount) fix FD leak
Karel Zak [Fri, 15 May 2020 10:09:43 +0000 (12:09 +0200)] 
libmount: (umount) fix FD leak

References: http://github.com/karelzak/util-linux/commit/7065cc0e5312cafc5ae3e4c342f78f264300fb5f
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolsblk: Ignore hidden devices
Ritika Srivastava [Wed, 13 May 2020 22:06:10 +0000 (15:06 -0700)] 
lsblk: Ignore hidden devices

Lsblk throws the following error for nvmeNcXnY devices.

lsblk: nvme1c1n1: unknown device name

This is because nvmeNcXnY devices are hidden and do not have
the file /sys/block/<nvmeNcXnY>/dev.

Following patch was added
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=d51f05bfecb299a830897106460bf395be440c0a
Which made lsblk read from /sys/block/<nvmeNcXnY>/device/dev
which do exist for nvmeNcXnY devices.

After the above patch, the unknown error goes away.
However, another error is encountered in the very next step.

nvme1c1n1: failed to initialize sysfs handler

This is because lsblk looks for /sys/dev/block/242:1
(nvmeNcXnY major:minor) pathname which usually exists for other
block devices but not for the nvmeNcXnY devices as they are hidden.

Below patch does not even print this error for hidden devices
and exits silently.

[kzak@redhat.com: - add prefix to make sysfs_devname_is_hidden()
                    usable for  /sys dumps
                  - use the function in initialize_device() more early]

Signed-off-by: Ritika Srivastava <ritika.srivastava@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agologin: keep default MOTD_FILE= backwardly compatible
Karel Zak [Tue, 12 May 2020 13:37:39 +0000 (15:37 +0200)] 
login: keep default MOTD_FILE= backwardly compatible

It seems that directories like /etc/motd.d are already used by PAM or
by another stuff. Let's keep it in admin/distro hands and do not
change the current default.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agologin: add MOTD_FIRSTONLY=
Karel Zak [Tue, 12 May 2020 13:21:21 +0000 (15:21 +0200)] 
login: add MOTD_FIRSTONLY=

This login.defs option allow to configure login to be more compatible
with pam_motd.

Addresses: https://github.com/karelzak/util-linux/issues/1034
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agologin: add support for directories in MOTD_FILE=
Karel Zak [Tue, 12 May 2020 12:20:54 +0000 (14:20 +0200)] 
login: add support for directories in MOTD_FILE=

The current standard is to use directories to make it easy for
distributions to share resources. This patch also add /etc/motd.d
and /run/motd.d to the default MOTD_FILE=.

Addresses: https://github.com/karelzak/util-linux/issues/10341
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agomore: make page and arrow up/down to update view
Sami Kerola [Wed, 6 May 2020 19:19:23 +0000 (20:19 +0100)] 
more: make page and arrow up/down to update view

Aim was to introduce page and arrow up/down keys to more(1), but that
also required merging colon_command() and more_key_command() functions.

The more_key_commands enum is pointless from computers point of view.
The command identification performed in read_command() inline with
more_key_command() execution -- but that would be hard for humans, and
source code ought to serve both parties.

Reference: https://github.com/karelzak/util-linux/pull/1003
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
3 years agomore: use libmagic to identify binary files
Sami Kerola [Wed, 6 May 2020 19:19:22 +0000 (20:19 +0100)] 
more: use libmagic to identify binary files

As the old commend said: 'This code would best be shared with the file(1)
program or, perhaps, more should not try to be so smart'.  Now at configure
time one can choose whether more(1) is sharing code with file(1), or not.

Addresses: http://bugs.debian.org/139205
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
3 years agosfdisk: avoid unneeded empty lines with '--list-free'
Wolfram Sang [Mon, 11 May 2020 16:10:48 +0000 (18:10 +0200)] 
sfdisk: avoid unneeded empty lines with '--list-free'

Similar to commit 4a52959d1 ("(s)fdisk: avoid unneeded empty lines with
'--list'"), there were also two superfluous empty lines when /dev/sr0
didn't contain a medium. Refactor the '--list-free' code the same way as
in the mentioned commit.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
3 years agolibblkid: fix fstatat() use in blkid__scan_dir()
Karel Zak [Tue, 12 May 2020 07:16:49 +0000 (09:16 +0200)] 
libblkid: fix fstatat() use in blkid__scan_dir()

Addresses: https://github.com/karelzak/util-linux/issues/1037
References: http://github.com/karelzak/util-linux/commit/2208b3ccb298be2675cf005b761b1668f8cd576f
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agocal: Remove todo
Aurelien LAJOIE [Thu, 7 May 2020 20:14:34 +0000 (22:14 +0200)] 
cal: Remove todo

3 years agocal: Add test, all are checked against ncal
Aurelien LAJOIE [Wed, 6 May 2020 20:53:29 +0000 (22:53 +0200)] 
cal: Add test, all are checked against ncal

ncal -M 09 2006
    September 2006
Mo     4 11 18 25
Tu     5 12 19 26
We     6 13 20 27
Th     7 14 21 28
Fr  1  8 15 22 29
Sa  2  9 16 23 30
Su  3 10 17 24

cal -mv 09 2006
    September 2006
Mo     4 11 18 25
Tu     5 12 19 26
We     6 13 20 27
Th     7 14 21 28
Fr  1  8 15 22 29
Sa  2  9 16 23 30
Su  3 10 17 24

For example `vertical-3sjv` `ncal -wjA2 08 2006`
The differences are 3 letters days when julian calendar with cal
Trailing spaces

3 years agocal: Update man page
Aurelien LAJOIE [Mon, 11 May 2020 15:41:33 +0000 (17:41 +0200)] 
cal: Update man page

3 years agocal: Add column mode
Aurelien LAJOIE [Mon, 13 Apr 2020 20:15:30 +0000 (22:15 +0200)] 
cal: Add column mode

Add`-v` `--vertical` option to get a vertical output
Add it into relative bash-completion

For example `cal -yv`

                             2020

    January            February           March
Su     5 12 19 26         2  9 16 23      1  8 15 22 29
Mo     6 13 20 27         3 10 17 24      2  9 16 23 30
Tu     7 14 21 28         4 11 18 25      3 10 17 24 31
We  1  8 15 22 29         5 12 19 26      4 11 18 25
Th  2  9 16 23 30         6 13 20 27      5 12 19 26
Fr  3 10 17 24 31         7 14 21 28      6 13 20 27
Sa  4 11 18 25         1  8 15 22 29      7 14 21 28

    April              May                June
Su     5 12 19 26         3 10 17 24 31      7 14 21 28
Mo     6 13 20 27         4 11 18 25      1  8 15 22 29
Tu     7 14 21 28         5 12 19 26      2  9 16 23 30
We  1  8 15 22 29         6 13 20 27      3 10 17 24
Th  2  9 16 23 30         7 14 21 28      4 11 18 25
Fr  3 10 17 24         1  8 15 22 29      5 12 19 26
Sa  4 11 18 25         2  9 16 23 30      6 13 20 27

    July               August             September
Su     5 12 19 26         2  9 16 23 30      6 13 20 27
Mo     6 13 20 27         3 10 17 24 31      7 14 21 28
Tu     7 14 21 28         4 11 18 25      1  8 15 22 29
We  1  8 15 22 29         5 12 19 26      2  9 16 23 30
Th  2  9 16 23 30         6 13 20 27      3 10 17 24
Fr  3 10 17 24 31         7 14 21 28      4 11 18 25
Sa  4 11 18 25         1  8 15 22 29      5 12 19 26

    October            November           December
Su     4 11 18 25      1  8 15 22 29         6 13 20 27
Mo     5 12 19 26      2  9 16 23 30         7 14 21 28
Tu     6 13 20 27      3 10 17 24         1  8 15 22 29
We     7 14 21 28      4 11 18 25         2  9 16 23 30
Th  1  8 15 22 29      5 12 19 26         3 10 17 24 31
Fr  2  9 16 23 30      6 13 20 27         4 11 18 25
Sa  3 10 17 24 31      7 14 21 28         5 12 19 26

3 years agocal: Add helper functions for left align
Aurelien LAJOIE [Mon, 13 Apr 2020 19:55:24 +0000 (21:55 +0200)] 
cal: Add helper functions for left align

3 years agocal: Add weekdays into cal_control
Aurelien LAJOIE [Mon, 13 Apr 2020 20:00:08 +0000 (22:00 +0200)] 
cal: Add weekdays into cal_control

3 years ago(s)fdisk: avoid unneeded empty lines with '--list'
Wolfram Sang [Wed, 6 May 2020 10:39:21 +0000 (12:39 +0200)] 
(s)fdisk: avoid unneeded empty lines with '--list'

On my system, I got two superfluous empty lines because /dev/sr0 didn't
contain a medium. Refactor the code to handle the seperator within
print_device_pt() and print it only when assigning the device worked.
This unifies handling between print_all_devices_pt and (s)fdisk because
the latter did not consider the return code for the seperator while the
former did. Also, it saves some lines of code.

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814184 (first part)
Signed-off-by: Wolfram Sang <wsa@kernel.org>
3 years agodocs: Correct ChangeLog URL to history log.
Anatoly Pugachev [Thu, 7 May 2020 09:17:47 +0000 (12:17 +0300)] 
docs: Correct ChangeLog URL to history log.

Debian is using this to make URL with tagged release, and with the old
URL it does return an empty page.

$ apt info util-linux | grep -i version
Version: 2.35.1-2

$ zcat /usr/share/doc/util-linux/changelog.gz
See version control history.

http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=log;h=2.35.1

^^ empty page

Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
3 years agolibblkid: add dax capability detection in topology probing
Anthony Iliopoulos [Tue, 5 May 2020 14:31:45 +0000 (16:31 +0200)] 
libblkid: add dax capability detection in topology probing

The dax (direct access) blockdev capability is exposed via sysfs, add it
to the list of topology values to be obtained while probing.

Expose blkid_topology_get_dax() symbol that programs can link against
for querying the capability.

Reorder the idinfos array to give precedence to the sysfs over ioctl so
that the dax probe has a chance to be executed, as there is no ioctl
interface for it.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
3 years agowipefs: fix man page --no-headings short option
Karel Zak [Wed, 6 May 2020 13:18:52 +0000 (15:18 +0200)] 
wipefs: fix man page --no-headings short option

Addresses: https://github.com/karelzak/util-linux/issues/1029
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agofdisk: better wording for '-B' in the man page
Wolfram Sang [Wed, 6 May 2020 10:38:04 +0000 (12:38 +0200)] 
fdisk: better wording for '-B' in the man page

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814184 (second part)
Signed-off-by: Wolfram Sang <wsa@kernel.org>
3 years agofdisk: specify in '--help' that we can have multiple devices with '-l'
Wolfram Sang [Wed, 6 May 2020 10:37:50 +0000 (12:37 +0200)] 
fdisk: specify in '--help' that we can have multiple devices with '-l'

Matches it with the man-page.

Adresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756187
Signed-off-by: Wolfram Sang <wsa@kernel.org>
3 years agotests: Fix for misc/fallocate test build failure.
Mark Hindley [Tue, 5 May 2020 19:28:55 +0000 (21:28 +0200)] 
tests: Fix for misc/fallocate test build failure.

This was already a known possible failure case. However, in the migration to a
clearer separation of stdout and stderr in the testsuite, the logfile used to
detect the failure was not updated.

Signed-off-by: Mark Hindley <mark@hindley.org.uk>
3 years agolsblk: add dax (direct access) capability column
Anthony Iliopoulos [Tue, 5 May 2020 14:31:44 +0000 (16:31 +0200)] 
lsblk: add dax (direct access) capability column

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
3 years agoMerge branch 'scriptlive' of https://github.com/jwilk-forks/util-linux
Karel Zak [Wed, 6 May 2020 13:04:28 +0000 (15:04 +0200)] 
Merge branch 'scriptlive' of https://github.com/jwilk-forks/util-linux

* 'scriptlive' of https://github.com/jwilk-forks/util-linux:
  scriptlive: fix typo
  scriptlive: fix man page formatting

3 years agolibfdisk: fix partition calculation for BLKPG_* ioctls
Karel Zak [Wed, 6 May 2020 11:32:46 +0000 (13:32 +0200)] 
libfdisk: fix partition calculation for BLKPG_* ioctls

The include/partx.h interface we use in util-linux uses 512-byte
sectors, but libfdisk uses real sector sizes.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoscriptlive: fix typo
Jakub Wilk [Tue, 5 May 2020 12:17:55 +0000 (14:17 +0200)] 
scriptlive: fix typo

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
3 years agoscriptlive: fix man page formatting
Jakub Wilk [Tue, 5 May 2020 12:16:52 +0000 (14:16 +0200)] 
scriptlive: fix man page formatting

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
3 years agoagetty: save the original speed on --keep-baud
Karel Zak [Mon, 4 May 2020 10:27:42 +0000 (12:27 +0200)] 
agetty: save the original speed on --keep-baud

agetty cycling through the baud rates specified on command line
(triggered by BREAK). Unfortunately, the original baud rate (probably
the best one) is tried only first time on --keep-baud.

Addresses: https://github.com/karelzak/util-linux/issues/1025
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agodocs: add swap to 1st fstab field
Karel Zak [Mon, 4 May 2020 09:44:03 +0000 (11:44 +0200)] 
docs: add swap to 1st fstab field

Addresses: https://github.com/karelzak/util-linux/issues/1027
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolsblk: Fall back to ID_SERIAL
Sven Wiltink [Fri, 1 May 2020 14:35:40 +0000 (16:35 +0200)] 
lsblk: Fall back to ID_SERIAL

In some cases ID_SERIAL_SHORT isn't provided by libudev, but ID_SERIAL
is. An example of this are virtio devices. See the output of udevadm
info:
P: /devices/pci0000:00/0000:00:06.0/virtio2/block/vdb
N: vdb
S: disk/by-id/virtio-08491434ee711d3420e9
S: disk/by-path/pci-0000:00:06.0
S: disk/by-path/virtio-pci-0000:00:06.0
E: DEVLINKS=/dev/disk/by-id/virtio-08491434ee711d3420e9 /dev/disk/by-path/pci-0000:00:06.0 /dev/disk/by-path/virtio-pci-0000:00:06.0
E: DEVNAME=/dev/vdb
E: DEVPATH=/devices/pci0000:00/0000:00:06.0/virtio2/block/vdb
E: DEVTYPE=disk
E: ID_PATH=pci-0000:00:06.0
E: ID_PATH_TAG=pci-0000_00_06_0
E: ID_SERIAL=08491434ee711d3420e9
E: MAJOR=252
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=1403804

[kzak@redhat.com: - add ID_SERIAL also to get_properties_by_file()]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agounshare: Fix PID and TIME namespace persistence
michael-dev [Wed, 15 Apr 2020 21:16:53 +0000 (23:16 +0200)] 
unshare: Fix PID and TIME namespace persistence

After unshare(...) is called, /proc/self/ns/pid does not change.
Instead, only /proc/self/ns/pid_for_children is affected. So bind-mounting
/proc/self/ns/pid results in the original namespace getting bind-mounted.

Fix this by instead bind-mounting ns/pid_for_children.

[kzak@redhat.com: - add ns/time_for_children
                  - remove C++ comments
                  - resolve commit conflicts]

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agobash-completion: umount explicitly needs gawk
Wolfram Sang [Tue, 28 Apr 2020 07:13:15 +0000 (09:13 +0200)] 
bash-completion: umount explicitly needs gawk

gensub() is a gawk extension, so use it explicitly. Otherwise users will
get an error if their 'awk' defaults to something else.

Fixes: 3ebfc8d37 ("bash-completion: umount support relative path and ~ as home shorthands")
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
3 years agolibfdisk: fix alignment logic for tiny partitions
Karel Zak [Wed, 29 Apr 2020 09:10:54 +0000 (11:10 +0200)] 
libfdisk: fix alignment logic for tiny partitions

Addresses: https://github.com/karelzak/util-linux/issues/1018 (second case)
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolibfdisk: make sure we check for maximal number of partitions
Karel Zak [Tue, 28 Apr 2020 10:58:42 +0000 (12:58 +0200)] 
libfdisk: make sure we check for maximal number of partitions

Addresses: https://github.com/karelzak/util-linux/issues/1018
Signed-off-by: Karel Zak <kzak@redhat.com>
4 years agolib/strutils: fix floating point exception
Karel Zak [Tue, 28 Apr 2020 10:28:59 +0000 (12:28 +0200)] 
lib/strutils: fix floating point exception

Addresses: https://github.com/karelzak/util-linux/issues/1017
Signed-off-by: Karel Zak <kzak@redhat.com>