]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
3 years agolibsmartcols: (docs) add missing references
Karel Zak [Wed, 22 Jul 2020 08:34:14 +0000 (10:34 +0200)] 
libsmartcols: (docs) add missing references

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibmount: (docs) add missing references
Karel Zak [Wed, 22 Jul 2020 08:34:03 +0000 (10:34 +0200)] 
libmount: (docs) add missing references

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibfdisk: (docs) add missing references
Karel Zak [Wed, 22 Jul 2020 08:33:53 +0000 (10:33 +0200)] 
libfdisk: (docs) add missing references

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibblkid: (docs) add missing references
Karel Zak [Wed, 22 Jul 2020 08:33:44 +0000 (10:33 +0200)] 
libblkid: (docs) add missing references

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'documentation_typo' of https://github.com/8vasu/util-linux
Karel Zak [Mon, 20 Jul 2020 08:32:44 +0000 (10:32 +0200)] 
Merge branch 'documentation_typo' of https://github.com/8vasu/util-linux

* 'documentation_typo' of https://github.com/8vasu/util-linux:
  fix typo: yourbranch -> yourgit

3 years agoManual pages: scriptreplay.1: Miscellaneous wording, grammar, and formatting fixes
Michael Kerrisk (man-pages) [Wed, 15 Jul 2020 08:15:46 +0000 (10:15 +0200)] 
Manual pages: scriptreplay.1: Miscellaneous wording, grammar, and formatting fixes

Nothing too contentious here, I think, so I'm rolling all
of the edits into one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: scriptlive.1: Miscellaneous wording, grammar, and formatting fixes
Michael Kerrisk (man-pages) [Wed, 15 Jul 2020 08:15:45 +0000 (10:15 +0200)] 
Manual pages: scriptlive.1: Miscellaneous wording, grammar, and formatting fixes

Nothing too contentious here, I think, so I'm rolling all
of the edits into one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: script.1: Miscellaneous wording, grammar, and formatting fixes
Michael Kerrisk (man-pages) [Wed, 15 Jul 2020 08:15:44 +0000 (10:15 +0200)] 
Manual pages: script.1: Miscellaneous wording, grammar, and formatting fixes

Nothing too contentious here, I think, so I'm rolling all
of the edits into one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agolibmount: fix condition for mountinfo filter
Karel Zak [Fri, 17 Jul 2020 08:45:40 +0000 (10:45 +0200)] 
libmount: fix condition for mountinfo filter

The filter has to be used for valid entries.

References: fe0d12d4f82269096f8d0cffc51ca9590814c284
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agofix typo: yourbranch -> yourgit
Soumendra Ganguly [Fri, 17 Jul 2020 02:03:15 +0000 (21:03 -0500)] 
fix typo: yourbranch -> yourgit

3 years agorename: tests: add more symlink checks
Mauricio Faria de Oliveira [Tue, 14 Jul 2020 18:49:25 +0000 (15:49 -0300)] 
rename: tests: add more symlink checks

Add a few checks to the symlink test, including for the fix
in commit 477239ce0d60 ("rename: fix regression for symlink
with non-existing target").

Tested with './tests/run.sh rename/symlink' before/after that
commit with FAILED/OK results (and '--show-diff') as expected:

After:
       rename: symlink check                  ... OK

Before:
       rename: symlink check                  ... FAILED (rename/symlink)

With --show-diff:

    diff-{{{
    --- /home/mfo/git/util-linux/tests/expected/rename/symlink 2020-07-14 15:21:06.412792160 -0300
    +++ /home/mfo/git/util-linux/tests/output/rename/symlink 2020-07-14 15:45:10.980927233 -0300
    @@ -3,5 +3,3 @@
     rename_slink.3: `old' -> `new'
     `rename_slink.1' -> `rename_symlink.1'
     target
    -`rename_slink.2' -> `rename_symlink.2'
    -target
    }}}-diff

    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>
3 years agoManual pages: runuser.1, su.1: miscellaneous wording and formatting fixes
Michael Kerrisk (man-pages) [Tue, 14 Jul 2020 12:20:00 +0000 (14:20 +0200)] 
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>
3 years agoManual pages: reword su.1 description
Karel Zak [Tue, 14 Jul 2020 12:33:49 +0000 (14:33 +0200)] 
Manual pages: reword su.1 description

Reported-by: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agodocs: reword others "allow to"
Karel Zak [Tue, 14 Jul 2020 12:31:29 +0000 (14:31 +0200)] 
docs: reword others "allow to"

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoManual pages: various: reword "allow(s) to"
Michael Kerrisk (man-pages) [Tue, 14 Jul 2020 09:57:41 +0000 (11:57 +0200)] 
Manual pages: various: reword "allow(s) to"

The wording "allow(s) to" is not grammatical English. Reword various
pages to use a more correct form such "can be use to" or "allows
the [noun] of".

Aklong the way, fix a few nearby wording errors in some pages.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: login.1: various minor wording fixes
Michael Kerrisk (man-pages) [Tue, 14 Jul 2020 09:57:40 +0000 (11:57 +0200)] 
Manual pages: login.1: various minor wording fixes

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: login.1: formatting fixes
Michael Kerrisk (man-pages) [Tue, 14 Jul 2020 09:57:39 +0000 (11:57 +0200)] 
Manual pages: login.1: formatting fixes

Bold for command names; italic for pathnames, etc.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agoManual pages: login.1: SEE ALSO: add utmp(5), lastlog(8)
Michael Kerrisk (man-pages) [Tue, 14 Jul 2020 09:57:38 +0000 (11:57 +0200)] 
Manual pages: login.1: SEE ALSO: add utmp(5), lastlog(8)

utmp and lastlog are referred to in the manual page, and thus deserve a
cross references in SEE ALSO.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agomanual pages: adjtime_config.5: format pathname with .I
Michael Kerrisk (man-pages) [Tue, 14 Jul 2020 09:57:37 +0000 (11:57 +0200)] 
manual pages: adjtime_config.5: format pathname with .I

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
3 years agobuild-sys: add --enable-werror to devel build scenarios
Karel Zak [Tue, 14 Jul 2020 10:37:06 +0000 (12:37 +0200)] 
build-sys: add --enable-werror to devel build scenarios

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibsmartcols: (sample) remove unused variable
Karel Zak [Tue, 14 Jul 2020 10:32:56 +0000 (12:32 +0200)] 
libsmartcols: (sample) remove unused variable

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibsmartcols: (sample) remove unnecessary check [coverity scan]
Karel Zak [Tue, 14 Jul 2020 10:20:36 +0000 (12:20 +0200)] 
libsmartcols: (sample) remove unnecessary check [coverity scan]

@str cannot be NULL ...

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibsmartcols: (sample) check scols_line_refer_data() return code [coverity scan]
Karel Zak [Tue, 14 Jul 2020 10:18:01 +0000 (12:18 +0200)] 
libsmartcols: (sample) check scols_line_refer_data() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibuuid: (test) make sure UUID is terminated [coverity scan]
Karel Zak [Tue, 14 Jul 2020 10:15:47 +0000 (12:15 +0200)] 
libuuid: (test) make sure UUID is terminated [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibsmartcols: (smaple) check scols_line_set_data() return code [coverity scan]
Karel Zak [Tue, 14 Jul 2020 10:03:11 +0000 (12:03 +0200)] 
libsmartcols: (smaple) check scols_line_set_data() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibuuid: (test) cleanup unused memory [coverity scan]
Karel Zak [Tue, 14 Jul 2020 09:56:15 +0000 (11:56 +0200)] 
libuuid: (test) cleanup unused memory [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibuuid: (test) close fd [coverity scan]
Karel Zak [Tue, 14 Jul 2020 09:47:38 +0000 (11:47 +0200)] 
libuuid: (test) close fd [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agotest_tiocsti: check ioctl() return code [coverity scan]
Karel Zak [Tue, 14 Jul 2020 09:43:38 +0000 (11:43 +0200)] 
test_tiocsti: check ioctl() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibsmartcols: (sample) check scols_line_set_data() return code [coverity scan]
Karel Zak [Tue, 14 Jul 2020 09:36:23 +0000 (11:36 +0200)] 
libsmartcols: (sample) check scols_line_set_data() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolsblk: Add SERIAL column to the SCSI output mode.
Milan Broz [Sun, 12 Jul 2020 10:40:48 +0000 (12:40 +0200)] 
lsblk: Add SERIAL column to the SCSI output mode.

If there are several identical disks, disk serial number can help
to distinguish exact drive.

This could be helpful in debugging RAID failures and similar problems.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
3 years agodocs: misc-utils: change "allows to <verb>" to "allows <verb>ing"
Bjarni Ingi Gislason [Fri, 10 Jul 2020 01:53:41 +0000 (01:53 +0000)] 
docs: misc-utils: change "allows to <verb>" to "allows <verb>ing"

  The web site "lintian.debian.org" shows some examples of "allows to",
which are changed to "allows one to".

  I chose here to use gerund.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agoSubject: docs: disk-utils: change "allows to <verb>" to "allows <verb>ing"
Bjarni Ingi Gislason [Fri, 10 Jul 2020 01:39:09 +0000 (01:39 +0000)] 
Subject: docs: disk-utils: change "allows to <verb>" to "allows <verb>ing"

  The web site "lintian.debian.org" shows some examples of "allows to",
which are changed to "allows one to".

  I chose here to use gerund.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agoSubject: docs: remove unnecessary paragraph macros
Bjarni Ingi Gislason [Fri, 10 Jul 2020 00:12:44 +0000 (00:12 +0000)] 
Subject: docs: remove unnecessary paragraph macros

  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

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agoSubject: docs: change from nofill to fill mode
Bjarni Ingi Gislason [Thu, 9 Jul 2020 23:50:26 +0000 (23:50 +0000)] 
Subject: docs: change from nofill to fill mode

  Change request nofill mode to fill mode.

  Warning from "mandoc -Tlint":

mandoc: ./misc-utils/uuidd.8.in:81:2: STYLE: fill mode already disabled, skipping: nf

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agodocs: remove trailing space in strings
Bjarni Ingi Gislason [Thu, 9 Jul 2020 23:24:27 +0000 (23:24 +0000)] 
docs: remove trailing space in strings

  Trim trailing space in strings.

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

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
3 years agoMerge branch 'coverity' of https://github.com/evverx/util-linux
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

3 years agoMerge branch 'osx' of https://github.com/evverx/util-linux
Karel Zak [Tue, 14 Jul 2020 08:25:27 +0000 (10:25 +0200)] 
Merge branch 'osx' of https://github.com/evverx/util-linux

3 years agodocs: mention Coverity Scan and the Fossies codespell report
Evgeny Vereshchagin [Mon, 13 Jul 2020 19:49:19 +0000 (19:49 +0000)] 
docs: mention Coverity Scan and the Fossies codespell report

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
3 years agotravis: integrate util-linux with Coverity Scan
Evgeny Vereshchagin [Mon, 13 Jul 2020 16:01:47 +0000 (16:01 +0000)] 
travis: integrate util-linux with Coverity Scan

For this to work, a daily cron job running on the master branch
should be added: https://docs.travis-ci.com/user/cron-jobs/

The report can found at https://scan.coverity.com/projects/karelzak-util-linux

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
3 years agoMore typo fixes by fossies
Yuri Chornoivan [Mon, 13 Jul 2020 12:33:42 +0000 (15:33 +0300)] 
More typo fixes by fossies

3 years agotravis: switch to a newer version of macOS
Evgeny Vereshchagin [Fri, 10 Jul 2020 15:21:42 +0000 (15:21 +0000)] 
travis: switch to a newer version of macOS

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
3 years agoFix minor typos
Yuri Chornoivan [Thu, 9 Jul 2020 17:14:32 +0000 (20:14 +0300)] 
Fix minor typos

3 years agobuild-sys: release++ (v2.36-rc2) v2.36-rc2
Karel Zak [Thu, 9 Jul 2020 10:20:57 +0000 (12:20 +0200)] 
build-sys: release++ (v2.36-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agodocs: update v2.36-ReleaseNotes
Karel Zak [Thu, 9 Jul 2020 10:18:44 +0000 (12:18 +0200)] 
docs: update v2.36-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agodocs: update AUTHORS file
Karel Zak [Thu, 9 Jul 2020 10:15:33 +0000 (12:15 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agopo: merge changes
Karel Zak [Thu, 9 Jul 2020 10:13:54 +0000 (12:13 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agodocs: update ReleaseNotes
Karel Zak [Thu, 9 Jul 2020 09:55:05 +0000 (11:55 +0200)] 
docs: update ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolast: fix use of non-terminated utmp->ut_line
Karel Zak [Thu, 9 Jul 2020 08:10:58 +0000 (10:10 +0200)] 
last: fix use of non-terminated utmp->ut_line

Addresses: https://github.com/karelzak/util-linux/pull/1097
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agodocs: add terminal hyperlinks to TODO
Karel Zak [Thu, 9 Jul 2020 07:34:30 +0000 (09:34 +0200)] 
docs: add terminal hyperlinks to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agotravis: don't ask for Ubuntu release on XOS
Karel Zak [Wed, 8 Jul 2020 13:11:17 +0000 (15:11 +0200)] 
travis: don't ask for Ubuntu release on XOS

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolibmount: (verity) remove unnecessary empty lines
Karel Zak [Wed, 8 Jul 2020 08:11:50 +0000 (10:11 +0200)] 
libmount: (verity) remove unnecessary empty lines

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agoMerge branch 'lp1886300' of https://github.com/mfoliveira/util-linux
Karel Zak [Wed, 8 Jul 2020 08:10:53 +0000 (10:10 +0200)] 
Merge branch 'lp1886300' of https://github.com/mfoliveira/util-linux

* 'lp1886300' of https://github.com/mfoliveira/util-linux:
  rename: fix regression for symlink with non-existing target

3 years agoMerge branch 'cryptsetup_dlopen' of https://github.com/bluca/util-linux
Karel Zak [Wed, 8 Jul 2020 07:55:12 +0000 (09:55 +0200)] 
Merge branch 'cryptsetup_dlopen' of https://github.com/bluca/util-linux

* 'cryptsetup_dlopen' of https://github.com/bluca/util-linux:
  cryptsetup: add option to use via dlopen in libmount

3 years agolsmem: report inaccessible /sys/devices/system/memory
Karel Zak [Wed, 8 Jul 2020 06:51:45 +0000 (08:51 +0200)] 
lsmem: report inaccessible /sys/devices/system/memory

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1794160
Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolib/path: add ul_path_is_accessible()
Karel Zak [Wed, 8 Jul 2020 06:50:07 +0000 (08:50 +0200)] 
lib/path: add ul_path_is_accessible()

This function allow to check that path_cxt is usable. Note that
ul_new_path() does not open the path.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 years agolsmem: make it without leaks for non-error output
Karel Zak [Wed, 8 Jul 2020 06:48:45 +0000 (08:48 +0200)] 
lsmem: make it without leaks for non-error output

Signed-off-by: Karel Zak <kzak@redhat.com>
3 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>
3 years agocryptsetup: add option to use via dlopen in libmount
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.

Fixes #1081

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
3 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

3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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

3 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

3 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>
3 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
```

3 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

3 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>
3 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>
3 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

3 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

3 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.

3 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.

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

3 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

3 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>
3 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>
3 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>
3 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>
3 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

3 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"
```

3 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

3 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

3 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

3 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)

3 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>
3 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

3 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.

3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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

3 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>
3 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>