]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 years agorename: fix regression for symlink with non-existing target
Mauricio Faria de Oliveira [Tue, 7 Jul 2020 18:49:13 +0000 (15:49 -0300)] 
rename: fix regression for symlink with non-existing target

Since commit 5454df9c3110 ("rename: check source file access early")
rename fails early for symlinks with non-existing target (regression),
because access() dereferences the link.

From access(2):

  "access() checks whether the calling process can access the file pathname.
   If pathname is a symbolic link, it is dereferenced."

Thus replace access() with faccessat() and lstat() as fallback,
(as in do_symlink()), that is equivalent for symlink and files.

From fsaccess(2) and stat(2):

  "The faccessat() system call operates in exactly the same way as access(),
   except for the differences described here.
   [...]
   If pathname is relative and dirfd is the special value AT_FDCWD, then pathname
   is interpreted relative to the current working directory of the calling process
   (like access()).
   [...]
   AT_SYMLINK_NOFOLLOW
     If pathname is a symbolic link, do not dereference it:
     instead return information about the link itself."

  "lstat() is identical to stat(), except that if pathname is a symbolic link, then
   it returns information about  the  link  itself, not the file that it refers to."

Testing
-------

  1) symlink with existing target
  2) symlink with non-existing target
  3) non-existing symlink
  4) existing file
  5) non-existing file

Before:

  $ touch file-found
  $ ln -s file-found symlink-1
  $ ./rename sym symbolic- symlink-1 # XPASS.
  $ echo $?
  0

  $ ln -s file-not-found symlink-2
  $ ./rename sym symbolic- symlink-2 # FAIL! REGRESSION.
  rename: symlink-2: not accessible: No such file or directory
  $ echo $?
  1

  $ ./rename sym symbolic- symlink-3 # XFAIL.
  rename: symlink-3: not accessible: No such file or directory
  $ echo $?
  1

  $ touch file-found
  $ ./rename found existing file-found # XPASS.
  $ echo $?
  0

  $ ./rename found existing file-not-found # XFAIL.
  rename: file-not-found: not accessible: No such file or directory
  $ echo $?
  1

After:

  $ touch file-found
  $ ln -s file-found symlink-1
  $ ./rename sym symbolic- symlink-1 # XPASS.
  $ echo $?
  0

  $ ln -s file-not-found symlink-2
  $ ./rename sym symbolic- symlink-2 # PASS! REGRESSION FIXED.
  $ echo $?
  0

  $ ./rename sym symbolic- symlink-3 # XFAIL.
  rename: symlink-3: not accessible: No such file or directory
  $ echo $?
  1

  $ touch file-found
  $ ./rename found existing file-found # XPASS.
  $ echo $?
  0

  $ ./rename found existing file-not-found # XFAIL.
  rename: file-not-found: not accessible: No such file or directory
  $ echo $?
  1

And to test/simulate faccessat()'s EINVAL for AT_SYMLINK_NOFOLLOW
for Mac OS X, per commit 826538bf64c5 ("rename: skip faccessat()
failure if AT_SYMLINK_NOFOLLOW is not a valid flag"), forced 'if'
to evaluate to false so that lstat() is taken.

It still fails early; the error messages are slightly different
('not accessible' vs. 'stat of ... failed') but still tell same
'No such file or directory'; exit code is the same as well.

  $ ./rename sym symbolic- symlink-3 # XFAIL. DIFF MSG/SAME RC.
  rename: stat of symlink-3 failed: No such file or directory
  $ echo $?
  1

  $ ./rename found existing file-not-found # XFAIL. DIFF MSG/SAME RC.
  rename: stat of file-not-found failed: No such file or directory
  $ echo $?
  1

Tested on commit 2b41c409e ("Merge branch 'blkd-err' of ...")

Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
5 years agoMerge branch 'blkd-err' of https://github.com/evverx/util-linux
Karel Zak [Tue, 7 Jul 2020 12:24:41 +0000 (14:24 +0200)] 
Merge branch 'blkd-err' of https://github.com/evverx/util-linux

* 'blkd-err' of https://github.com/evverx/util-linux:
  tests: turn off detect_leaks on s390x, use more asan options
  tests: skip "blkid/dm-err" when `mknod` doesn't work

5 years agotests: turn off detect_leaks on s390x, use more asan options
Evgeny Vereshchagin [Fri, 3 Jul 2020 13:26:08 +0000 (13:26 +0000)] 
tests: turn off detect_leaks on s390x, use more asan options

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
5 years agotests: skip "blkid/dm-err" when `mknod` doesn't work
Evgeny Vereshchagin [Fri, 3 Jul 2020 10:54:49 +0000 (10:54 +0000)] 
tests: skip "blkid/dm-err" when `mknod` doesn't work

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
5 years agocal: use size_t to calculate width [lgtm scan]
Karel Zak [Fri, 3 Jul 2020 11:17:51 +0000 (13:17 +0200)] 
cal: use size_t to calculate width [lgtm scan]

We use size_t for width. This patch makes it consistent for
years_width too.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agounshare: (man) add note about signals on --fork
Karel Zak [Fri, 3 Jul 2020 11:03:58 +0000 (13:03 +0200)] 
unshare: (man) add note about signals on --fork

Addresses: https://github.com/karelzak/util-linux/pull/1087
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'unshare-signals' of https://github.com/DaanDeMeyer/util-linux
Karel Zak [Fri, 3 Jul 2020 10:56:54 +0000 (12:56 +0200)] 
Merge branch 'unshare-signals' of https://github.com/DaanDeMeyer/util-linux

5 years agolibfdisk: (gpt) fix compiler warning [-Wmaybe-uninitialized]
Karel Zak [Fri, 3 Jul 2020 10:29:06 +0000 (12:29 +0200)] 
libfdisk: (gpt) fix compiler warning [-Wmaybe-uninitialized]

Make sure that variables used in  gpt_calculate_* are always initialized.

Addresses: https://github.com/karelzak/util-linux/issues/1091
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'werror' of https://github.com/evverx/util-linux
Karel Zak [Fri, 3 Jul 2020 09:34:12 +0000 (11:34 +0200)] 
Merge branch 'werror' of https://github.com/evverx/util-linux

5 years agoMerge branch 'travis-arch' of https://github.com/evverx/util-linux
Karel Zak [Fri, 3 Jul 2020 09:32:36 +0000 (11:32 +0200)] 
Merge branch 'travis-arch' of https://github.com/evverx/util-linux

* 'travis-arch' of https://github.com/evverx/util-linux:
  travis: build util-linux on arm64, ppc64le and s390x

5 years agotravis: turn on CIFuzz
Evgeny Vereshchagin [Thu, 2 Jul 2020 02:48:39 +0000 (02:48 +0000)] 
travis: turn on CIFuzz

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: ignore the python libmount tests when they're run under UBSan
Evgeny Vereshchagin [Wed, 1 Jul 2020 21:26:56 +0000 (21:26 +0000)] 
tests: ignore the python libmount tests when they're run under UBSan

ts_init_py meddles with LD_LIBRARY_PATH causing those tests to fail with
```
+Traceback (most recent call last):
+  File "/home/travis/build/karelzak/util-linux/libmount/python/test_mount_tab.py", line 8, in <module>
+    import pylibmount as mnt
+ImportError: /home/travis/build/karelzak/util-linux/.libs/libblkid.so.1: undefined symbol: __ubsan_handle_negate_overflow
}}}-diff
```

5 years agotravis: install llvm-* to get llvm-symbolizer
Evgeny Vereshchagin [Wed, 1 Jul 2020 20:42:49 +0000 (20:42 +0000)] 
travis: install llvm-* to get llvm-symbolizer

Backtraces like
```
misc-utils/cal.c:295:4: runtime error: signed integer overflow: 2147483647 + 5 cannot be represented in type 'int'
==1405==WARNING: invalid path to external symbolizer!
==1405==WARNING: Failed to use and restart external symbolizer!
    #0 0x4c4c09  (/home/travis/build/karelzak/util-linux/cal+0x4c4c09)
    #1 0x7f4363046b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #2 0x41bab9  (/home/travis/build/karelzak/util-linux/cal+0x41bab9)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior misc-utils/cal.c:295:4 in
```
aren't very helpful

It's follow-up to https://github.com/karelzak/util-linux/pull/1075

5 years agotravis: turn on UBsan on Travis CI to see how it goes
Evgeny Vereshchagin [Wed, 1 Jul 2020 20:07:07 +0000 (20:07 +0000)] 
travis: turn on UBsan on Travis CI to see how it goes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: add --enable-ubsan to make it possible to build util-linux with UBSan
Evgeny Vereshchagin [Wed, 1 Jul 2020 19:52:51 +0000 (19:52 +0000)] 
build-sys: add --enable-ubsan to make it possible to build util-linux with UBSan

mostly to prepare for https://github.com/karelzak/util-linux/pull/1068
but it's useful even without fuzzing.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agounshare --fork: Ignore SIGINT and SIGTERM in parent
Daan De Meyer [Thu, 2 Jul 2020 14:26:39 +0000 (16:26 +0200)] 
unshare --fork: Ignore SIGINT and SIGTERM in parent

5 years agoskip hwclock/systohc on Travis CI on Ubuntu Precise
Evgeny Vereshchagin [Thu, 2 Jul 2020 11:26:47 +0000 (11:26 +0000)] 
skip hwclock/systohc on Travis CI on Ubuntu Precise

It's flaky there.

Closes https://github.com/karelzak/util-linux/issues/1082

5 years agotravis: turn off -Werror on precise and osx
Evgeny Vereshchagin [Thu, 2 Jul 2020 10:51:04 +0000 (10:51 +0000)] 
travis: turn off -Werror on precise and osx

I'm not sure anyone is particularly interested in what the compilers
have to say there.

5 years agorevert a680b2abe725f4d5240
Evgeny Vereshchagin [Thu, 2 Jul 2020 10:16:22 +0000 (10:16 +0000)] 
revert a680b2abe725f4d5240

It's not clear what that commit was supposed to fix. Looks like
772420322deb14b2ff should have helped there.

5 years agotravis: turn on -Werror
Evgeny Vereshchagin [Thu, 2 Jul 2020 09:15:51 +0000 (09:15 +0000)] 
travis: turn on -Werror

5 years agotravis: build util-linux on arm64, ppc64le and s390x
Evgeny Vereshchagin [Thu, 2 Jul 2020 08:08:41 +0000 (08:08 +0000)] 
travis: build util-linux on arm64, ppc64le and s390x

5 years agolibblkid: remove blkid_llseek()
Karel Zak [Wed, 1 Jul 2020 13:47:20 +0000 (15:47 +0200)] 
libblkid: remove blkid_llseek()

Let's use libc lseek() everywhere like we use in another tools. It's
year 2020 ...

Addresses: https://github.com/karelzak/util-linux/issues/1083
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: add --enable-werror
Karel Zak [Wed, 1 Jul 2020 13:23:10 +0000 (15:23 +0200)] 
build-sys: add --enable-werror

Add new ./configure option to make all compiler warnings into errors.

Addresses: https://github.com/karelzak/util-linux/issues/1083
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: remove drone.io, add lgtm.com
Karel Zak [Wed, 1 Jul 2020 07:33:27 +0000 (09:33 +0200)] 
docs: remove drone.io, add lgtm.com

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: add -Waddress-of-packed-member
Karel Zak [Wed, 1 Jul 2020 07:32:58 +0000 (09:32 +0200)] 
build-sys: add -Waddress-of-packed-member

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'bionic' of https://github.com/evverx/util-linux
Karel Zak [Wed, 1 Jul 2020 07:28:23 +0000 (09:28 +0200)] 
Merge branch 'bionic' of https://github.com/evverx/util-linux

* 'bionic' of https://github.com/evverx/util-linux:
  travis: make it easier to switch to the next clang/gcc
  travis: switch to clang-10
  travis: switch to gcc-10
  travis: ignore memory leaks in checkusage
  travis: install all the "official" build dependencies
  travis: switch to Bionic

5 years agotravis: make it easier to switch to the next clang/gcc
Evgeny Vereshchagin [Tue, 30 Jun 2020 16:43:49 +0000 (16:43 +0000)] 
travis: make it easier to switch to the next clang/gcc

by just changing the compiler option in .travis.yml

In https://travis-ci.org/github/karelzak/util-linux/builds/703664282 I switched
to gcc-9/clang-9 by simply applying the following patch:
```
diff --git a/.travis.yml b/.travis.yml
index ec1284717..12a247d91 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,8 +7,8 @@ git:
   depth: 1500

 compiler:
-  - gcc-10
-  - clang-10
+  - gcc-9
+  - clang-9

 env:
   - MAKE_CHECK="nonroot"
```

5 years agotravis: switch to clang-10
Evgeny Vereshchagin [Mon, 29 Jun 2020 14:40:19 +0000 (14:40 +0000)] 
travis: switch to clang-10

to prepare the infrastructure for https://github.com/karelzak/util-linux/pull/1068

5 years agotravis: switch to gcc-10
Evgeny Vereshchagin [Mon, 29 Jun 2020 13:56:06 +0000 (13:56 +0000)] 
travis: switch to gcc-10

to get around an ASan bug mentioned in https://github.com/karelzak/util-linux/issues/1076

5 years agotravis: ignore memory leaks in checkusage
Evgeny Vereshchagin [Mon, 29 Jun 2020 12:36:48 +0000 (12:36 +0000)] 
travis: ignore memory leaks in checkusage

Closes https://github.com/karelzak/util-linux/issues/1077

5 years agoMerge branch 'ufiformat-reference' of https://github.com/wojtekka/util-linux
Karel Zak [Mon, 29 Jun 2020 10:49:20 +0000 (12:49 +0200)] 
Merge branch 'ufiformat-reference' of https://github.com/wojtekka/util-linux

* 'ufiformat-reference' of https://github.com/wojtekka/util-linux:
  disk-utils: Add reference to ufiformat(8)

5 years agochfn: Make readline prompt for each field on a separate line
Damien Goutte-Gattat [Sat, 27 Jun 2020 18:58:13 +0000 (19:58 +0100)] 
chfn: Make readline prompt for each field on a separate line

When readline is called to get user input, it is called without
a prompt argument. As a result, if the user does not enter anything
for a given field, then the next field is displayed on the same
line, yielding the following output:

  $ chfn
  Changing finger information for user.
  Password:
  Name []: Office []: Office Phone []: Home Phone []:

instead of the expected:

  $ chfn
  Changing finger information for user.
  Password:
  Full Name []:
  Room Number []:
  Work Phone []:
  Home Phone []:

This patch restores the expected behavior by feeding readline with
a character to display as "prompt".

[kzak@redhat.com: - do the same change in chsh
                  - use ' ' rather than '\n' for non-readline code]

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotravis: install all the "official" build dependencies
Evgeny Vereshchagin [Sun, 28 Jun 2020 18:14:40 +0000 (20:14 +0200)] 
travis: install all the "official" build dependencies

5 years agotravis: switch to Bionic
Evgeny Vereshchagin [Sun, 28 Jun 2020 17:58:07 +0000 (19:58 +0200)] 
travis: switch to Bionic

To judge from fc412fe4cee960, back in 2016 it was the latest version
of Ubuntu available on Travis CI. Now build tools there are too old
for testing purposes.

Other than that, Ubuntu Trusty hasn't been supported at https://apt.llvm.org/
since August 2019, which makes it kind of hard at this point to bring the latest clang
along with ASan, UBsan, Msan and libFuzzer to Travis CI.

5 years agodisk-utils: Add reference to ufiformat(8)
Wojtek Kaniewski [Sat, 27 Jun 2020 19:15:10 +0000 (21:15 +0200)] 
disk-utils: Add reference to ufiformat(8)

fdformat(8) doesn't handle USB floppy disk drives. As legacy floppy
disk drives have become a scarce resource it would be nice to point
those poor souls trying to format their floppy disks to a utility that
doesn't throw "Invalid argument" at them.

Signed-off-by: Wojtek Kaniewski <wojtekka@toxygen.net>
5 years agolibmount: (parser) fix memory leak on error before end-of-file
Karel Zak [Fri, 26 Jun 2020 10:59:32 +0000 (12:59 +0200)] 
libmount: (parser) fix memory leak on error before end-of-file

Let's simplify the loop where we add FS to the table. The optimization
for recoverable errors is a fragile overkill. The new code always
allocates and unrefs FS for each loop.

Addresses: https://github.com/karelzak/util-linux/pull/1068
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: mark some branches as github-only
Karel Zak [Wed, 24 Jun 2020 14:38:03 +0000 (16:38 +0200)] 
docs: mark some branches as github-only

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: Fix mountpoint test failure in build chroots.
Mark Hindley [Mon, 22 Jun 2020 23:52:09 +0000 (23:52 +0000)] 
tests: Fix mountpoint test failure in build chroots.

The test assumed that / was a mountpoint. This is not always the case, for
example in pbuilder/cowbuilder chroots. So use / if findmnt verifies it is a
mountpoint, otherwise use the first mountpoint found. Skip the test if no
mountpoints are found.

Signed-off-by: Mark Hindley <mark@hindley.org.uk>
5 years agosys-utils: mount.8: split a long line into two
Bjarni Ingi Gislason [Sun, 21 Jun 2020 22:58:27 +0000 (22:58 +0000)] 
sys-utils: mount.8: split a long line into two

  Split two long lines, adding '\e' at the end of the first part,
as otherwise the last part of them disappears at the right margin in
the printed output (pdf).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoMerge branch 'bug422' of https://github.com/kerolasa/util-linux
Karel Zak [Wed, 24 Jun 2020 13:40:02 +0000 (15:40 +0200)] 
Merge branch 'bug422' of https://github.com/kerolasa/util-linux

5 years agoMerge branch 'some/small/fixes' of https://github.com/lnslbrty/util-linux
Karel Zak [Wed, 24 Jun 2020 13:32:54 +0000 (15:32 +0200)] 
Merge branch 'some/small/fixes' of https://github.com/lnslbrty/util-linux

* 'some/small/fixes' of https://github.com/lnslbrty/util-linux:
  login: fixed invalid sizeof usage
  libfdisk, unshare: fix gcc-4.9.4 warnings

5 years agosetarch: add arm and aarch64 architectures to transition rules
Alexey Gladkov [Tue, 23 Jun 2020 14:56:20 +0000 (16:56 +0200)] 
setarch: add arm and aarch64 architectures to transition rules

Since aarch64 kernel can be configured with compat 32-bit support
enabled, extend translation rules in a way similar to x86/x86_64.

Suggested-by: "Dmitry V. Levin" <ldv@altlinux.org>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
5 years agosetarch: make verify_arch_domain extendable
Alexey Gladkov [Tue, 23 Jun 2020 14:56:19 +0000 (16:56 +0200)] 
setarch: make verify_arch_domain extendable

When other compatible architectures are introduced, they will also have
to be added to the verifier.

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
5 years agocol: fix output when first line does not have newline character
Sami Kerola [Sat, 20 Jun 2020 08:22:24 +0000 (09:22 +0100)] 
col: fix output when first line does not have newline character

Commit I made while back and has been part of util-linux v2.30 to v2.35 made
col(1) not to output anything when first line did not have newline character.

    printf "gone from output" | col

This commit fixes the issue.  Admittedly the col source code is unnecessarily
hard to work with.  It could be a good idea to refactor the col(1) as low
priority task, Assuming refactoring is done the first commit to get that done
should add tests that exhaust all possible input handling including all command
line option directives.

Addresses: https://github.com/karelzak/util-linux/issues/422
Fixes: b6b5272b03ea9d3fa15601801d4d0f76ea4440f1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agologin: fixed invalid sizeof usage
Toni Uhlig [Fri, 19 Jun 2020 16:38:15 +0000 (18:38 +0200)] 
login: fixed invalid sizeof usage

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
5 years agolibfdisk, unshare: fix gcc-4.9.4 warnings
Toni Uhlig [Fri, 19 Jun 2020 15:25:25 +0000 (17:25 +0200)] 
libfdisk, unshare: fix gcc-4.9.4 warnings

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
5 years agobuild-sys: fix blkdiscard blkid.h use
Karel Zak [Fri, 19 Jun 2020 17:04:10 +0000 (19:04 +0200)] 
build-sys: fix blkdiscard blkid.h use

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/sysfs: fix prefix use in sysfs_devname_is_hidden()
Karel Zak [Fri, 19 Jun 2020 08:06:25 +0000 (10:06 +0200)] 
lib/sysfs: fix prefix use in sysfs_devname_is_hidden()

Addresses: https://github.com/karelzak/util-linux/issues/1062
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoManual pages: losetup.8: Fix "--direct-io" defaults
Rupesh Girase [Thu, 18 Jun 2020 13:47:41 +0000 (19:17 +0530)] 
Manual pages: losetup.8: Fix "--direct-io" defaults

"--direct-io" option is "off" by default while configuring
loop device but it's mentioned "on" in man page.

Signed-off-by: Rupesh Girase <rgirase@redhat.com>
5 years agoblkdiscard: Refuse to proceed if signatures are found
Lukas Czerner [Thu, 18 Jun 2020 10:50:34 +0000 (12:50 +0200)] 
blkdiscard: Refuse to proceed if signatures are found

Currently the blkdiscard has the ability to wipe out entere device in a
matter of seconds. This is fine as long as it's intentional, it is
potentially catastrophic if it's not.

With this commit blkdiscard will check for existing signatures on the
device and refuse to continue if any are found unless the operation is
forced with the -f option.

In an attempt to avoid breaking existing automation scripts the force is
only required when stdin refers to a terminal.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
5 years agounshare: fix man page formatting
Jakub Wilk [Tue, 16 Jun 2020 18:11:38 +0000 (20:11 +0200)] 
unshare: fix man page formatting

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
5 years agologin: cleanup get_hushlogin_status() use
Karel Zak [Tue, 16 Jun 2020 12:00:58 +0000 (14:00 +0200)] 
login: cleanup get_hushlogin_status() use

* use 1 bit for context->quiet
* get_hushlogin_status() return -1 on error, make sure we do not
  interpret it as "hush mode enabled"

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agologin: use PAM_SILENT to propagate hushlogin to PAM
Karel Zak [Tue, 16 Jun 2020 11:49:48 +0000 (13:49 +0200)] 
login: use PAM_SILENT to propagate hushlogin to PAM

login(1) follows /etc/hushlogin and ~/.hushlogin to enable silent
mode, but it's not propagated to PAM now. Note that login(1) from
shadow-utils uses PAM_SILENT too.

Addresses: https://github.com/linux-pam/linux-pam/issues/233
Addresses: https://github.com/karelzak/util-linux/issues/1059
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: cleanup cramfs checksums
Karel Zak [Mon, 15 Jun 2020 09:47:53 +0000 (11:47 +0200)] 
tests: cleanup cramfs checksums

Let's make the code more readable.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'cramfs-mkfs' of https://github.com/mator/util-linux
Karel Zak [Mon, 15 Jun 2020 09:41:17 +0000 (11:41 +0200)] 
Merge branch 'cramfs-mkfs' of https://github.com/mator/util-linux

* 'cramfs-mkfs' of https://github.com/mator/util-linux:
  tests: add checksum for cramfs/mkfs for BE:8192 (sparc64)

5 years agobash-completion: release preparations
Sami Kerola [Fri, 12 Jun 2020 19:29:54 +0000 (20:29 +0100)] 
bash-completion: release preparations

6e103c7690fe blkzone: Add --force option
9cd88771ef45 fdisk: add --lock and LOCK_BLOCK_DEVICE
921ceaca31bd wipefs: add --lock and LOCK_BLOCK_DEVICE
c3ef1268a0b4 sfdisk: add --lock and LOCK_BLOCK_DEVICE
b8671fe76370 mkswap: add --lock and LOCK_BLOCK_DEVICE
ec8f712157fe cfdisk: add --lock and LOCK_BLOCK_DEVICE
f2229320a9f7 fdisk: add --noauto-pt
7f1f0584c24a nsenter: add support for the time namespace
dd52c4fa011d lsirq: add -n option
ee5a16025046 sfdisk: add --relocate command
99d78b2fefe3 fdisk: add --list-details
65e27d545cb5 sfdisk: add --disk-id to change disk UUID/ID
34fed3ff1740 blkdiscard: use O_EXCL, add --force

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agoManual pages: setpriv.1: warn users of restrictions on capability changes
Michael Kerrisk (man-pages) [Fri, 12 Jun 2020 11:19:33 +0000 (13:19 +0200)] 
Manual pages: setpriv.1: warn users of restrictions on capability changes

The kernel imposes various restrictions on the changes that can be
made to the inheritable, ambient, and bounding sets. Warn the user
about that.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
5 years agoManual pages: setpriv.1: Various minor wording and formatting fixes
Michael Kerrisk (man-pages) [Fri, 12 Jun 2020 11:19:32 +0000 (13:19 +0200)] 
Manual pages: setpriv.1: Various minor wording and formatting fixes

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
5 years agoManual pages: runuser.1: Various wording and formatting fixes
Michael Kerrisk (man-pages) [Fri, 12 Jun 2020 11:19:31 +0000 (13:19 +0200)] 
Manual pages: runuser.1: Various wording and formatting fixes

Most of this is pretty straightforward English language fix-ups
and formatting fix-ups, so I've rolled it into one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
5 years agodoc: text-utils/*: fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Thu, 11 Jun 2020 02:18:20 +0000 (02:18 +0000)] 
doc: text-utils/*: fix some warnings from "mandoc -T lint"

mandoc: ./text-utils/column.1:58:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./text-utils/column.1:63:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./text-utils/column.1:119:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./text-utils/column.1:171:1: WARNING: skipping paragraph macro: sp after PP
mandoc: ./text-utils/column.1:170:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./text-utils/hexdump.1:206:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./text-utils/hexdump.1:356:2: STYLE: fill mode already disabled, skipping: nf
mandoc: ./text-utils/hexdump.1:359:2: STYLE: fill mode already disabled, skipping: nf
mandoc: ./text-utils/hexdump.1:362:2: STYLE: fill mode already disabled, skipping: nf
mandoc: ./text-utils/hexdump.1:366:2: STYLE: fill mode already disabled, skipping: nf
mandoc: ./text-utils/hexdump.1:369:2: STYLE: fill mode already disabled, skipping: nf

####

  There are no changes in the output from "nroff" and "groff", except
for a reformat of a paragraph caused by "fill-mode".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agodoc: term-utils/*: fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Thu, 11 Jun 2020 01:26:37 +0000 (01:26 +0000)] 
doc: term-utils/*: fix some warnings from "mandoc -T lint"

mandoc: ./term-utils/agetty.8:224:36: WARNING: undefined escape, printing literally: \\
mandoc: ./term-utils/agetty.8:12:2: STYLE: fill mode already enabled, skipping: fi
mandoc: ./term-utils/agetty.8:307:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./term-utils/agetty.8:489:2: STYLE: fill mode already enabled, skipping: fi
mandoc: ./term-utils/agetty.8:503:2: STYLE: fill mode already enabled, skipping: fi

mandoc: ./term-utils/script.1:198:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./term-utils/script.1:244:2: WARNING: empty block: RS
mandoc: ./term-utils/script.1:261:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./term-utils/scriptlive.1:77:2: STYLE: fill mode already disabled, skipping: nf

mandoc: ./term-utils/scriptreplay.1:122:2: STYLE: fill mode already disabled, skipping: nf

###

  Additional change:

1)  Changed '  ' once to ' ' in "agetty.8"

2)  Change in the output from "groff":

'-' changed to '\-' in "agetty.8".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agodoc: sys-utils/*: fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Thu, 11 Jun 2020 00:50:33 +0000 (00:50 +0000)] 
doc: sys-utils/*: fix some warnings from "mandoc -T lint"

mandoc: ./sys-utils/adjtime_config.5:26:1: WARNING: skipping paragraph macro: sp after PP

mandoc: ./sys-utils/chcpu.8:98:2: WARNING: skipping paragraph macro: br at the end of SH

mandoc: ./sys-utils/choom.1:26:22: STYLE: unterminated quoted argument

mandoc: ./sys-utils/dmesg.1:90:5: STYLE: unterminated quoted argument
mandoc: ./sys-utils/dmesg.1:147:5: STYLE: unterminated quoted argument
mandoc: ./sys-utils/dmesg.1:33:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./sys-utils/dmesg.1:255:2: WARNING: skipping paragraph macro: br after sp

mandoc: ./sys-utils/flock.1:183:2: WARNING: line scope broken: TQ breaks TP
mandoc: ./sys-utils/flock.1:43:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./sys-utils/fsfreeze.8:79:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./sys-utils/fsfreeze.8:83:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./sys-utils/ipcmk.1:43:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./sys-utils/lsirq.1:16:11: STYLE: unterminated quoted argument
mandoc: ./sys-utils/lsirq.1:31:11: STYLE: unterminated quoted argument
mandoc: ./sys-utils/lsirq.1:34:11: STYLE: unterminated quoted argument

mandoc: ./sys-utils/mount.8:901:4: STYLE: unterminated quoted argument
mandoc: ./sys-utils/mount.8:2239:38: STYLE: unterminated quoted argument
mandoc: ./sys-utils/mount.8:88:2: WARNING: skipping paragraph macro: br after sp
mandoc: ./sys-utils/mount.8:90:2: WARNING: skipping paragraph macro: br before sp

mandoc: ./sys-utils/mountpoint.1:50:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./sys-utils/mountpoint.1:57:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./sys-utils/readprofile.8:10:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./sys-utils/readprofile.8:100:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./sys-utils/renice.1:65:11: STYLE: unterminated quoted argument
mandoc: ./sys-utils/renice.1:68:11: STYLE: unterminated quoted argument
mandoc: ./sys-utils/renice.1:72:11: STYLE: unterminated quoted argument
mandoc: ./sys-utils/renice.1:55:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./sys-utils/swapon.8:227:2: WARNING: skipping paragraph macro: br after SH

mandoc: ./sys-utils/unshare.1:350:32: STYLE: unterminated quoted argument
mandoc: ./sys-utils/unshare.1:253:2: WARNING: skipping paragraph macro: PP after SH

####

  The ouput from "nroff" and "groff" is unchanged.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agodoc: schedutils/*: Fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Thu, 11 Jun 2020 00:18:44 +0000 (00:18 +0000)] 
doc: schedutils/*: Fix some warnings from "mandoc -T lint"

mandoc: ./schedutils/chrt.1:37:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./schedutils/ionice.1:120:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./schedutils/taskset.1:36:2: WARNING: skipping paragraph macro: PP after SH

####

  There is no change in the ouput from "nroff" and "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agodoc: misc-utils/*: Fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Wed, 10 Jun 2020 23:57:22 +0000 (23:57 +0000)] 
doc: misc-utils/*: Fix some warnings from "mandoc -T lint"

mandoc: ./misc-utils/cal.1:214:2: WARNING: skipping paragraph macro: br after sp
mandoc: ./misc-utils/cal.1:216:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/cal.1:225:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./misc-utils/findfs.8:36:2: WARNING: skipping paragraph macro: br after sp
mandoc: ./misc-utils/findfs.8:38:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:41:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:44:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:48:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./misc-utils/logger.1:118:15: STYLE: unterminated quoted argument
mandoc: ./misc-utils/logger.1:231:2: WARNING: skipping paragraph macro: IP empty

mandoc: ./misc-utils/look.1:116:2: STYLE: fill mode already disabled, skipping: nf

mandoc: ./misc-utils/hardlink.1:1:5: STYLE: lower case character in document title: TH hardlink
mandoc: ./misc-utils/hardlink.1:1:2: WARNING: missing date, using today's date: TH
mandoc: ./misc-utils/hardlink.1:9:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./misc-utils/hardlink.1:52:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./misc-utils/hardlink.1:65:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./misc-utils/rename.1:65:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:65:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:97:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:107:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:116:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./misc-utils/whereis.1:82:2: WARNING: line scope broken: IP breaks TP
mandoc: ./misc-utils/whereis.1:152:2: WARNING: skipping paragraph macro: PP empty

####

  There is no change in the ouput of "nroff" or "groff", except for

1) a very long line in "logger.1".

2) '-' changed to '\-' for a option in "logger.1".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agodoc: login-utils/*: Fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Wed, 10 Jun 2020 22:49:59 +0000 (22:49 +0000)] 
doc: login-utils/*: Fix some warnings from "mandoc -T lint"

mandoc: ./login-utils/chfn.1:96:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./login-utils/lslogins.1:14:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./login-utils/newgrp.1:18:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./login-utils/nologin.8:19:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./login-utils/sulogin.8:57:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./login-utils/utmpdump.1:61:2: WARNING: skipping paragraph macro: PP after SS

mandoc: ./login-utils/vipw.8:65:2: WARNING: line scope broken: TP breaks I

####

  There is no change in output from "nroff" or "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agodoc: libuuid/man/*: Fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Wed, 10 Jun 2020 22:27:39 +0000 (22:27 +0000)] 
doc: libuuid/man/*: Fix some warnings from "mandoc -T lint"

mandoc: ./libuuid/man/uuid_generate.3:44:101: STYLE: unterminated quoted argument

mandoc: ./libuuid/man/uuid_generate.3:45:102: STYLE: unterminated quoted argument

####

  There is no change in the output of "nroff" or "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agodoc: disk-utils/*: Fix some warnings from "mandoc -T lint"
Bjarni Ingi Gislason [Wed, 10 Jun 2020 21:49:10 +0000 (21:49 +0000)] 
doc: disk-utils/*: Fix some warnings from "mandoc -T lint"

mandoc: ./disk-utils/fsck.minix.8:123:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./disk-utils/isosize.8:8:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./disk-utils/sfdisk.8:262:4: STYLE: unterminated quoted argument

mandoc: ./disk-utils/swaplabel.8:57:2: WARNING: skipping paragraph macro: PP empty

####

  No change in the output from "nroff" or "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
####

5 years agotests: add checksum for cramfs/mkfs for BE:8192 (sparc64)
Anatoly Pugachev [Thu, 11 Jun 2020 11:25:04 +0000 (14:25 +0300)] 
tests: add checksum for cramfs/mkfs for BE:8192 (sparc64)

Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
5 years agotests: explain why MD tests with metadata v0.90 are KNOWN-FAIL
Karel Zak [Thu, 11 Jun 2020 09:05:30 +0000 (11:05 +0200)] 
tests: explain why MD tests with metadata v0.90 are KNOWN-FAIL

metadata v0.90 is deprecated thing and unsupported to create by some new
mdadm versions. It's possible to assemble this array (with
default_layout=1 on modprobe raid0), but impossible to create a new
one.

References: 4ae96cf77b36660255d5870a4209480bbec47902
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1826251
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'fix_typo' of https://github.com/s-morishima/util-linux
Karel Zak [Wed, 10 Jun 2020 08:26:39 +0000 (10:26 +0200)] 
Merge branch 'fix_typo' of https://github.com/s-morishima/util-linux

5 years agodoc: Fix some warnings from "test-groff" for manuals
Bjarni Ingi Gislason [Wed, 10 Jun 2020 02:17:50 +0000 (02:17 +0000)] 
doc: Fix some warnings from "test-groff" for manuals

Source is current git content.

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 ././disk-utils/sfdisk.8

troff: backtrace: file '<./disk-utils/sfdisk.8>':67
troff: <./disk-utils/sfdisk.8>:67: warning: trailing space

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

troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':133: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: macro 'mF' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'mE' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: bad font number
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':135: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'sP' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':170
troff: <./misc-utils/kill.1>:170: warning: bad font number

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

<./sys-utils/ipcs.1>:103 (macro BR): only 1 argument, but more are expected

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

<./sys-utils/mount.8>:68 (macro RB): only 1 argument, but more are expected
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-old.tmac':467: macro 'RB'
troff: backtrace: file '<./sys-utils/mount.8>':68
troff: <./sys-utils/mount.8>:68: warning [p 1, 3.5i]: can't break line
an-old.tmac: <./sys-utils/mount.8>:201 (.RE): warning: extra .RE or .RS is missing before it; "an-RS-open" is 0.
<./sys-utils/mount.8>:453 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:500 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:1050 (macro BR): only 1 argument, but more are expected

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

<./sys-utils/setpriv.1>:17 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:154 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:166 (macro BR): only 1 argument, but more are expected

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

<./sys-utils/umount.8>:145 (macro IR): only 1 argument, but more are expected

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

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

[kzak@redhat.com: - add .RS to fix extra .RE in mount.8]

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoManual page: fdisk.8: fix typo
Shigeki Morishima [Wed, 3 Jun 2020 19:23:30 +0000 (04:23 +0900)] 
Manual page: fdisk.8: fix typo

It seems that "--wipe-partitions" is correct, not "--wipe-partition".

Signed-off-by: Shigeki Morishima <s.morishima@jp.fujitsu.com>
5 years agobuild-sys: release++ (v2.36-rc1) v2.36-rc1
Karel Zak [Tue, 9 Jun 2020 12:55:55 +0000 (14:55 +0200)] 
build-sys: release++ (v2.36-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: fix release notes file name
Karel Zak [Tue, 9 Jun 2020 13:11:58 +0000 (15:11 +0200)] 
docs: fix release notes file name

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: add v2.36-ReleaseNotes
Karel Zak [Tue, 9 Jun 2020 12:28:23 +0000 (14:28 +0200)] 
docs: add v2.36-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Tue, 9 Jun 2020 09:51:51 +0000 (11:51 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Tue, 9 Jun 2020 09:49:28 +0000 (11:49 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/strutils: use directly err()
Karel Zak [Tue, 9 Jun 2020 09:45:55 +0000 (11:45 +0200)] 
lib/strutils: use directly err()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: update hr.po (from translationproject.org)
Božidar Putanec [Tue, 9 Jun 2020 09:35:01 +0000 (11:35 +0200)] 
po: update hr.po (from translationproject.org)

5 years agologindefs: use xalloc.h, code cleanup
Karel Zak [Tue, 9 Jun 2020 09:31:42 +0000 (11:31 +0200)] 
logindefs: use xalloc.h, code cleanup

- remove else-after-return
- use else-if
- use xalloc stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/strutils: remove unnecessary include
Karel Zak [Tue, 9 Jun 2020 08:56:28 +0000 (10:56 +0200)] 
lib/strutils: remove unnecessary include

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: add STATIC binaries to build-sys tests
Karel Zak [Tue, 9 Jun 2020 08:55:20 +0000 (10:55 +0200)] 
tests: add STATIC binaries to build-sys tests

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: remove redundard includes
Karel Zak [Tue, 9 Jun 2020 08:53:14 +0000 (10:53 +0200)] 
build-sys: remove redundard includes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibblkid: (docs) document new function
Karel Zak [Tue, 9 Jun 2020 08:51:37 +0000 (10:51 +0200)] 
libblkid: (docs) document new function

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibfdisk: (docs) document new functions
Karel Zak [Tue, 9 Jun 2020 08:50:42 +0000 (10:50 +0200)] 
libfdisk: (docs) document new functions

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomount: Update man page Synopsis
Marcel Waldvogel [Mon, 8 Jun 2020 12:30:03 +0000 (14:30 +0200)] 
mount: Update man page Synopsis

Document
- `-t` when listing mounts
- `--bind`, `--rbind`, and `--move`
- `--make-*`
- Mountpoints need not only be directories

[kzak@redhat.com: - cleanup syntax,
  - use all complete --make-* list]

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: update build-sys tests
Karel Zak [Mon, 8 Jun 2020 11:29:33 +0000 (13:29 +0200)] 
tests: update build-sys tests

- remove libasan from results
- link libcryptsetup (due to verity support in libmount)
- add lsiqr
- add irqtop

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: fix irqtop compilation with -lslang
Karel Zak [Mon, 8 Jun 2020 11:18:20 +0000 (13:18 +0200)] 
build-sys: fix irqtop compilation with -lslang

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: don't use ASAN in build tests
Karel Zak [Mon, 8 Jun 2020 09:45:09 +0000 (11:45 +0200)] 
tests: don't use ASAN in build tests

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: make lsirq and irqtop optional
Karel Zak [Mon, 8 Jun 2020 09:33:00 +0000 (11:33 +0200)] 
build-sys: make lsirq and irqtop optional

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolscpu: cleanup caches code
Karel Zak [Mon, 8 Jun 2020 08:05:14 +0000 (10:05 +0200)] 
lscpu: cleanup caches code

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolscpu: Add shared cached info for s390 lscpu -C
Sumanth Korikkar [Fri, 5 Jun 2020 16:15:10 +0000 (18:15 +0200)] 
lscpu: Add shared cached info for s390 lscpu -C

The shared cache info for s390 can be found in /proc/cpuinfo.
lscpu without any options already processes this info. Fix this
in lscpu -C and provide detailed stat.

Test for s390:
./lscpu -C
NAME ONE-SIZE ALL-SIZE WAYS TYPE        LEVEL  SETS PHY-LINE COHERENCY-SIZE
L1d      128K     256K    8 Data            1    64                     256
L1i      128K     256K    8 Instruction     1    64                     256
L2d        4M       8M    8 Data            2  2048                     256
L2i        2M       4M    8 Instruction     2  1024                     256
L3       128M            32 Unified         3 16384                     256
L4       672M            42 Unified         4 65536                     256

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
5 years agoblockdev: Don't fail on missing start sector
Stanislav Brabec [Fri, 5 Jun 2020 08:04:21 +0000 (10:04 +0200)] 
blockdev: Don't fail on missing start sector

It causes
 # blockdev --report" error:
 blockdev: /dev/dm-9: failed to read partition start from sysfs: No such file or directory

There is no reliable way to detect a geometry in this case. Report N/A
instead.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Martin Wilck <martin.wilck@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoblkzone: remove unnecessary initializations
Karel Zak [Fri, 5 Jun 2020 07:18:08 +0000 (09:18 +0200)] 
blkzone: remove unnecessary initializations

C compiler is smart enough to follow C standards

 C11: 6.7.8 Initialization

 All subobjects that are not initialized explicitly shall be
 initialized implicitly the same as objects that have static storage
 duration.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoblkzone: Add --force option
Shin'ichiro Kawasaki [Fri, 5 Jun 2020 05:06:18 +0000 (14:06 +0900)] 
blkzone: Add --force option

Commit 7a2602f629fe ("blkzone: deny destructive ioctls on busy blockdev")
introduced exclusive mode to open block devices to submit zone management
ioctls. This avoids unintended status change of block devices used by the
system. However, it makes blkzone less usable for testing. For example,
the test case zbd/007 of blktests utilizes blkzone to reset zones of
block devices mapped to dm-linear devices. After the commit, the test
case fails with EBUSY error at blkzone reset, since the system uses the
reset target block device to map to the dm-linear device.

To allow blkzone to change status of zoned block devices used by the
system with intention, introduce --force option. With this option, block
devices are opened without exclusive mode.

Also fix too many periods in man page of --verbose option.

[kzak@redhat.com: - tiny cosmetic changes]

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodmesg: adjust timestamps according to suspended time
Konstantin Khlebnikov [Mon, 1 Jun 2020 19:21:34 +0000 (22:21 +0300)] 
dmesg: adjust timestamps according to suspended time

Timestamps in kernel log comes from monotonic clocksource which does not
tick when system suspended. Suspended time easily sums into hours and days
rendering human readable timestamps in dmesg useless.

Adjusting timestamps accouring to current delta between boottime and
monotonic clocksources produces accurate timestamps for messages printed
since last resume. Which are supposed to be most interesting.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
5 years agoManual pages: unshare.1: clarify that --pid=<file> requires --fork
Michael Kerrisk (man-pages) [Wed, 3 Jun 2020 07:40:57 +0000 (09:40 +0200)] 
Manual pages: unshare.1: clarify that --pid=<file> requires --fork

Attempting to create a persistent PID namespace with --pid=<file>
will result in an error if --fork is not also specified. Let's
warn people about that, so they don't get puzzled.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoManual pages: unshare.1: clarify description and example for --mount=<path>
Michael Kerrisk (man-pages) [Wed, 3 Jun 2020 07:40:56 +0000 (09:40 +0200)] 
Manual pages: unshare.1: clarify description and example for --mount=<path>

The existing text is not quite accurate, and I recently injected an
error into the EXAMPLES. This patch fixes both issues.

The text in DESCRIPTION incorrectly states that the propagation type of
the parent mount must be "private". This is not accurate.  Rather, the
propagation type must be something *other than "shared"* (i.e.,
"private", "slave", or "unbindable").

In the EXAMPLES section, I added text that implies that if the
propagation type of the parent mount is "shared", then the child mount
created by --mount=<path> might propagate to another namespace.
Rather, in this situation, an error would result. Clarify that.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
5 years agolibmount: add support for ID=
Karel Zak [Wed, 3 Jun 2020 14:53:00 +0000 (16:53 +0200)] 
libmount: add support for ID=

This patch add support for a new tag. The tag is based on udev block
device ID (see /dev/disk/by-id). The usual use-case is to use
WWN for this purpose, for example

  # mount ID=wwn-0x50026b724b09a1ff /mnt

Note that ID is not strictly defined and udevd generates various IDs
also for HW where WWN is undefined. This is reason why introduce ID=
seems better and more generic than more restrictive WWN=.

Addresses: https://github.com/karelzak/util-linux/issues/1008
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomount: (man) cleanup devices identifiers section
Karel Zak [Mon, 1 Jun 2020 12:53:47 +0000 (14:53 +0200)] 
mount: (man) cleanup devices identifiers section

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