diff-{{{
--- /home/mfo/git/util-linux/tests/expected/rename/symlink.err 2020-07-14 15:37:42.466207786 -0300
+++ /home/mfo/git/util-linux/tests/output/rename/symlink.err 2020-07-14 15:45:10.984927251 -0300
@@ -1 +1,2 @@
+rename: rename_slink.2: not accessible: No such file or directory
rename: rename_slink.3: No such file or directory
}}}-diff
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Manual pages: runuser.1, su.1: miscellaneous wording and formatting fixes
Various wording and formatting fixes. Nothing too contentnious, I think,
so I rolled these changes into one patch.
Since there is much common text in su.1 and runuser.1, I've combined
the changes to both pages into one patch, and, as far as possible,
ensured that changes to the common pieces of text match across the
two pages.
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Remove a second paragraph macro (.TP, .PP) as it does not change the
output (.SS/.PP) or it adds an extra empty line (.TP/.TP)
Warning from "mandoc -Tlint":
mandoc: ./sys-utils/hwclock.8.in:299:2: WARNING: line scope broken: TP breaks TP
mandoc: ./sys-utils/hwclock.8.in:459:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:543:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:574:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:673:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:721:2: WARNING: skipping paragraph macro: PP after SS
Karel Zak [Tue, 14 Jul 2020 08:26:44 +0000 (10:26 +0200)]
Merge branch 'coverity' of https://github.com/evverx/util-linux
* 'coverity' of https://github.com/evverx/util-linux:
docs: mention Coverity Scan and the Fossies codespell report
travis: integrate util-linux with Coverity Scan
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
$ ./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>
Luca Boccassi [Mon, 29 Jun 2020 20:45:26 +0000 (21:45 +0100)]
cryptsetup: add option to use via dlopen in libmount
Enabling libcrypsetup in libmount had several unintended side
effects.
First of all, it increases the Debian minimal image size by
~2.5% (5.6MB worth of new libraries).
Then, due to libcryptsetup linkage to OpenSSL and libjson-c,
it causes incompatibilities with external programs linking
against both libmount and a private, static, old version of
OpenSSL, or external programs linking against libjansson or
json-glib, which have one symbol in common with libjson-c.
If ./configure is ran with --with-crypsetup=dlopen,
instead of linking to libcrypsetup, use dlopen to resolve
the symbols at runtime only when the verity feature is
used, thus avoiding clashes and keeping images size down.
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
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
```
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
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
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
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>
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.
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.
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>
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.
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).