]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 years agoMerge branch 'mount-omode' of https://github.com/yontalcar/util-linux
Karel Zak [Mon, 9 Apr 2018 10:19:55 +0000 (12:19 +0200)] 
Merge branch 'mount-omode' of https://github.com/yontalcar/util-linux

* 'mount-omode' of https://github.com/yontalcar/util-linux:
  mount: use string_to_bitmask()
  mount(8): clarify behavior of --options-mode
  mount: document --options-* in man/help
  mount: added options exposing libmount's optsmode

6 years agobuild: Add missing -lintl linkage to lib{smartcols,uuid}
Karel Zak [Mon, 9 Apr 2018 10:11:36 +0000 (12:11 +0200)] 
build: Add missing -lintl linkage to lib{smartcols,uuid}

Addresses: https://github.com/karelzak/util-linux/pull/615
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'rename-fix-noact-without-nooverwrite' of https://github.com/g-raud...
Karel Zak [Mon, 9 Apr 2018 09:46:22 +0000 (11:46 +0200)] 
Merge branch 'rename-fix-noact-without-nooverwrite' of https://github.com/g-raud/util-linux

* 'rename-fix-noact-without-nooverwrite' of https://github.com/g-raud/util-linux:
  rename: prevent --no-act from setting --no-overwrite
  rename: when --no-overwrite skip verbosily only when --verbose
  rename: consolidate printing the symlink in addition to its target
  rename: fix/reverse the semantics of --no-overwrite in --symlink mode

6 years agotests: update sfdisk JSON output
Karel Zak [Fri, 6 Apr 2018 11:39:35 +0000 (13:39 +0200)] 
tests: update sfdisk JSON output

References: d881b773318dbd3f5ceb58a1e9a560fe0d1ac90a
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agomisc-utils/getopt.1: minor corrections to the manual
Bjarni Ingi Gislason [Thu, 29 Mar 2018 21:15:06 +0000 (21:15 +0000)] 
misc-utils/getopt.1: minor corrections to the manual

Input file is getopt.1

Test nr. 2:

Enable and fix warnings from 'test-groff'.

Input file is /tmp/getopt.1

<getopt.1>:5 (macro BI): only 1 argument, but more are expected
<getopt.1>:419 (macro IR): only 1 argument, but more are expected
<getopt.1>:421 (macro IR): only 1 argument, but more are expected

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

  and

Test nr. 15:

Change the name of a macro for two fonts (e.g., BR and IR) to one letter,
if there is only one argument.
Add the second argument if needed.  It is sometimes part of the first one.

5:.BI getopt
419:.IR /usr/share/getopt/
421:.IR /usr/share/doc/

#####

Test nr. 8:

Protect a full stop (.) with "\&", if it has a blank (white-space) in front
of or (ignoring transparent characters to the full stop) after it, and it does
not mean an end of a sentence.

204:the next parameter (i.e. separated by whitespace on the command
219:or as the next argument (i.e. separated by whitespace on the command
352:(i.e. a parameter that does not start with a
379:will be parsed.  It will still do parameter shuffling (i.e. all

#####

Test nr. 20:

Use a macro to change to the italic font, instead of \fI [1], if
possible.
The macros have the italic corrections, but "\c" removes them.
[1] man-pages(7)

57:is set, or if the first \fIparameter\fR is not an option (does not start
144:Set quoting conventions to those of \fIshell\fR.

#####

Test nr. 21:

Use the word (in)valid instead of (il)legal if not related to legal matters.
See "www.gnu.org/prep/standards".

25:check for legal options.  It uses the

#####

Test nr. 28:

Wrong distance between sentences or protect the indicator.

1) Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) and "info groff".

Or

2) Adjust space between sentences (two spaces),

3) or protect the indicator by adding "\&" after it.

The "indicator" is an "end-of-sentence character" (.!?).

204:the next parameter (i.e. separated by whitespace on the command
219:or as the next argument (i.e. separated by whitespace on the command
352:(i.e. a parameter that does not start with a
379:will be parsed.  It will still do parameter shuffling (i.e. all
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
#####

6 years agosys-utils/fallocate.1: Some tidying of the manual
Bjarni Ingi Gislason [Sat, 31 Mar 2018 22:50:49 +0000 (22:50 +0000)] 
sys-utils/fallocate.1: Some tidying of the manual

Test nr. 2:

Enable and fix warnings from 'test-groff'.

Input file is /tmp/fallocate.1

<fallocate.1>:10 (macro IR): only 1 argument, but more are expected
<fallocate.1>:24 (macro RB): only 1 argument, but more are expected
<fallocate.1>:25 (macro IR): only 1 argument, but more are expected

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

  and

Test nr. 15:

Change the name of a macro for two fonts (e.g., BR and IR) to one letter,
if there is only one argument.
Add the second argument if needed.  It is sometimes part of the first one.

10:.IR length
24:.RB \-l
25:.IR length

#####

Test nr. 12:

Change -- in x--y to \(em (em-dash), or, if an
option, to \-\-

65:You can think of this option as doing a "\fBcp --sparse\fP" and then renaming

#####

Test nr. 20:

Use a macro to change to the italic font, instead of \fI [1], if
possible.
The macros have the italic corrections, but "\c" removes them.
[1] man-pages(7)

39:The \fIlength\fR and \fIoffset\fR
50:to be collapsed starts at \fIoffset\fP and continues
51:for \fIlength\fR bytes.  At the completion of the operation, the contents of
52:the file starting at the location \fIoffset\fR+\fIlength\fR will be appended at the
53:location \fIoffset\fR, and the file will be \fIlength\fR bytes smaller.  The option
71:Insert a hole of \fIlength\fR bytes from \fIoffset\fR, shifting existing data.
85:\fIoffset\fP and continuing for \fIlength\fR bytes.  Within the
103:Zeroes space in the byte range starting at \fIoffset\fP and
104:continuing for \fIlength\fR bytes.  Within the specified range, blocks are

#####

Test nr. 27:

Split lines longer than 80 characters into two or more lines.
Apropriate break points are the end of a sentence and a subordinate
clause.

fallocate.1: line 45 length 86
fallocate.1: line 52 length 83
fallocate.1: line 53 length 83
fallocate.1: line 100 length 95

#####

Test nr. 28:

Wrong distance between sentences or protect the indicator.

1) Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) and "info groff".

Or

2) Adjust space between sentences (two spaces),

3) or protect the indicator by adding "\&" after it.

The "indicator" is an "end-of-sentence character" (.!?).

99:Enable POSIX operation mode. In that mode allocation operation always completes,

#####

Test nr. 37:

Have a space after a comma in an argument to an alternating fonts macro.
The space belongs to the comma, so ', '.

48:.BR \-c , " \-\-collapse\-range"
58:.BR \-d , " \-\-dig\-holes"
70:.BR \-i , " \-\-insert\-range"
73:.BR \-l , " \-\-length " \fIlength
76:.BR \-n , " \-\-keep\-size"
80:.BR \-o , " \-\-offset " \fIoffset
83:.BR \-p , " \-\-punch\-hole"
95:.BR \-v , " \-\-verbose"
98:.BR \-x , " \-\-posix"
102:.BR \-z , " \-\-zero\-range"
119:.BR \-V , " \-\-version"
122:.BR \-h , " \-\-help"

#####

Test nr. 38:

Email addresses use the macro ".MT" and end with ".ME".

125:.UR sandeen@redhat.com
129:.UR kzak@redhat.com

#####

Test nr. 40:

Add a comma before "and", "or", or "nor" if a series contains three or
more words

41:MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is
43:KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
45:The options \fB\-\-collapse\-range\fP, \fB\-\-dig\-holes\fP, \fB\-\-punch\-hole\fP and

#####

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
6 years agobash-completion: fix typo in blockdev file
Sami Kerola [Thu, 5 Apr 2018 19:56:56 +0000 (20:56 +0100)] 
bash-completion: fix typo in blockdev file

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agobash-completion: setpriv --securebits argument can be comma separated list
Sami Kerola [Thu, 5 Apr 2018 19:56:55 +0000 (20:56 +0100)] 
bash-completion: setpriv --securebits argument can be comma separated list

Make the option argument suggestion to match with what is allowed.  In same
go tidy shell code a little bit.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agobash-completion: do not print eject --cdspeed error messages
Sami Kerola [Thu, 5 Apr 2018 19:56:54 +0000 (20:56 +0100)] 
bash-completion: do not print eject --cdspeed error messages

Bash completion is proposing --cdspeed option argument from 'eject
--listspeed /dev/cdrom' output.  Nowadays it is common not to have such
device, and this results to an unwanted error message to stderr merely
messing up command line.  Lets stop that.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agobash-completion: fix few bash set -u issues
Sami Kerola [Thu, 5 Apr 2018 19:56:53 +0000 (20:56 +0100)] 
bash-completion: fix few bash set -u issues

This is the same fix as in reference commit, and the same reason.  Just
correct few files missed earlier.

Reference: abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agofstrim: Return EXIT_FAILURE when FTRIM ioctl fails
Karel Zak [Fri, 6 Apr 2018 10:53:18 +0000 (12:53 +0200)] 
fstrim: Return EXIT_FAILURE when FTRIM ioctl fails

commit 36c370cbf1481aa8724dff8b7b7fec4a8ba9930b adds fstrim_filesystem()
that return -1 or 1 depending on the FTRIM ioctl failures.

The fstrim_filesystem() return codes should not be used as exit codes.

Reported-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodmesg: fix raw output
Karel Zak [Thu, 5 Apr 2018 13:59:59 +0000 (15:59 +0200)] 
dmesg: fix raw output

The commit 5f538ac40c0d215b6c9a881effe4c3b214366715 has introduced
regression ("goto" to the wrong place, so timestamps in raw mode is
not printed at all).

Addresses: https://github.com/karelzak/util-linux/issues/614
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: improve JSON output
Karel Zak [Thu, 5 Apr 2018 10:38:22 +0000 (12:38 +0200)] 
libfdisk: improve JSON output

* use fputs_quoted_json() for all data
* fix use of variables separator

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsmem: improve JSON output
Karel Zak [Thu, 5 Apr 2018 09:54:57 +0000 (11:54 +0200)] 
lsmem: improve JSON output

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: make sure boolean is true/false only
Karel Zak [Thu, 5 Apr 2018 10:12:25 +0000 (12:12 +0200)] 
libsmartcols: make sure boolean is true/false only

.. and never "null".

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsmem: make output more compatible with another utils
Karel Zak [Thu, 5 Apr 2018 10:02:33 +0000 (12:02 +0200)] 
lsmem: make output more compatible with another utils

We do not use placeholders (e.g. "-") for missing data in libsmartcols
utils, just use empty space in output.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsmem: remove unused variable
Karel Zak [Thu, 5 Apr 2018 09:44:27 +0000 (11:44 +0200)] 
lsmem: remove unused variable

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: update JSON outputs
Karel Zak [Wed, 4 Apr 2018 12:22:04 +0000 (14:22 +0200)] 
tests: update JSON outputs

It does not contains extra space after ":" separator anymore.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsblk: consolidate column types for JSON and qsort()
Karel Zak [Tue, 3 Apr 2018 13:10:21 +0000 (15:10 +0200)] 
lsblk: consolidate column types for JSON and qsort()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: improve JSON support (add types)
Karel Zak [Tue, 3 Apr 2018 13:08:40 +0000 (15:08 +0200)] 
libsmartcols: improve JSON support (add types)

This commit add SCOLS_JSON_{NUMBER,STRING,BOOLEAN} to specify column
type for JSON output formatting.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorename: prevent --no-act from setting --no-overwrite
G.raud Meyer [Thu, 29 Mar 2018 10:58:44 +0000 (12:58 +0200)] 
rename: prevent --no-act from setting --no-overwrite

This fixes a bug introduced by commit fabb90676 ("Added --no-override
option to rename.", 2017-05-27) where the fallthrough meant to let
--no-act set --verbose was changed to set --no-override (the previous
code was too smart).

Do not let --no-act set --verbose anymore but update the manual to
recommend adding option --verbose.  This is to be able to make --no-act
detect only non existing file arguments (in a future commit).

6 years agomount: use string_to_bitmask()
Vaclav Dolezal [Wed, 14 Feb 2018 13:03:41 +0000 (14:03 +0100)] 
mount: use string_to_bitmask()

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
6 years agodocs: add choom to TODO
Karel Zak [Tue, 27 Mar 2018 17:05:13 +0000 (19:05 +0200)] 
docs: add choom to TODO

Addresses: https://github.com/karelzak/util-linux/issues/609
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorename: when --no-overwrite skip verbosily only when --verbose
G.raud Meyer [Tue, 27 Mar 2018 13:22:58 +0000 (15:22 +0200)] 
rename: when --no-overwrite skip verbosily only when --verbose

6 years agorename: consolidate printing the symlink in addition to its target
G.raud Meyer [Sat, 24 Mar 2018 22:55:58 +0000 (23:55 +0100)] 
rename: consolidate printing the symlink in addition to its target

6 years agorename: fix/reverse the semantics of --no-overwrite in --symlink mode
G.raud Meyer [Sat, 24 Mar 2018 22:53:21 +0000 (23:53 +0100)] 
rename: fix/reverse the semantics of --no-overwrite in --symlink mode

The previous behaviour was to overwrite a symlink only when the new
destination did not exist, i.e. to avoid creating a symlink to an
existing file!  It had not been documented and it seems
counter-intuitive to me.  So the new behavior protects symlinks pointing
to existing targets from being changed.

Also update manpage to document this mode.

6 years agotests: remove namei(1) failed lstat test
Karel Zak [Tue, 27 Mar 2018 12:21:46 +0000 (14:21 +0200)] 
tests: remove namei(1) failed lstat test

The strerror() output is is nothing stable and may be different on
another systems. It would be possible to use sed(1) to unify the
output, but it seems overkill in this case.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoclosestream: remove dummy function __fpending()
Sami Kerola [Sat, 10 Mar 2018 21:20:24 +0000 (21:20 +0000)] 
closestream: remove dummy function __fpending()

Exclude __fpending() from build when function is not available.  This is
more obvious than adding a dummy function and expecting compiler to
eliminate it as dead code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agodocs: add cal(1) TODO items
Karel Zak [Tue, 27 Mar 2018 11:44:04 +0000 (13:44 +0200)] 
docs: add cal(1) TODO items

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agonamei: provide more usable error message on lstat() error
Karel Zak [Tue, 27 Mar 2018 11:30:16 +0000 (13:30 +0200)] 
namei: provide more usable error message on lstat() error

Addresses: https://github.com/karelzak/util-linux/issues/608
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'master' of https://github.com/pali/util-linux
Karel Zak [Tue, 27 Mar 2018 10:54:53 +0000 (12:54 +0200)] 
Merge branch 'master' of https://github.com/pali/util-linux

* 'master' of https://github.com/pali/util-linux:
  tests: Add tests for FAT32 labels
  blkid: Encode any field which starts with LABEL in same way as LABEL field
  libblkid: vfat: Change parsing label in special cases

6 years agotests: update column(1) space-separator test
Karel Zak [Tue, 27 Mar 2018 09:52:54 +0000 (11:52 +0200)] 
tests: update column(1) space-separator test

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agocolumn: fix leading space characters bug
Karel Zak [Tue, 27 Mar 2018 08:40:13 +0000 (10:40 +0200)] 
column: fix leading space characters bug

The bug has been introduced during column(1) rewrite. The function
read_input() need to skip leading space only temporary to detect empty
lines, but the rest of the code has to use the original buffer (line).
I've tried to fix one of the symptoms by 5c7b67fbbf41c973ca8d49b1e8bdba22dbb917aa
(alter), but this solution is unnecessary and too complex.

Changes:

* don't ignore leading space
* remove unnecessary stuff introduced by 5c7b67fbbf41c973ca8d49b1e8bdba22dbb917aa
* fix regression test with incorrect separator

Addresses: https://github.com/karelzak/util-linux/issues/575
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1560283
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: add to column(1) TODO
Karel Zak [Mon, 26 Mar 2018 12:23:53 +0000 (14:23 +0200)] 
docs: add to column(1) TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: include sys/mount.h only if necessary
Karel Zak [Thu, 22 Mar 2018 13:05:17 +0000 (14:05 +0100)] 
libmount: include sys/mount.h only if necessary

Addresses: https://github.com/systemd/systemd/issues/8507
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofstrim: cleanup includes
Karel Zak [Thu, 22 Mar 2018 12:17:10 +0000 (13:17 +0100)] 
fstrim: cleanup includes

* HAVE_SYS_FS_H is incorrect (should be HAVE_LINUX_FS_H)

* linux/fs.h cannot be included together with sys/mount.h as the both
  files define MS_* constants. The libmount.h includes sys/mount.h now.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: (docs) fix section name
Karel Zak [Wed, 21 Mar 2018 14:49:32 +0000 (15:49 +0100)] 
libfdisk: (docs) fix section name

The string "DOS (MBR)" generates filename with "(...)" which is
unacceptable by kernel.org stuff.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: release++ (v2.32) v2.32
Karel Zak [Wed, 21 Mar 2018 14:01:28 +0000 (15:01 +0100)] 
build-sys: release++ (v2.32)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update v2.32-ReleaseNotes
Karel Zak [Wed, 21 Mar 2018 13:59:34 +0000 (14:59 +0100)] 
docs: update v2.32-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update AUTHORS file
Karel Zak [Wed, 21 Mar 2018 13:48:21 +0000 (14:48 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: merge changes
Karel Zak [Wed, 21 Mar 2018 13:45:47 +0000 (14:45 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update uk.po (from translationproject.org)

6 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update pt_BR.po (from translationproject.org)

6 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update pl.po (from translationproject.org)

6 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update ja.po (from translationproject.org)

6 years agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update fr.po (from translationproject.org)

6 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update fi.po (from translationproject.org)

6 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update es.po (from translationproject.org)

6 years agopo: update cs.po (from translationproject.org)
Petr PísaÅ™ [Wed, 21 Mar 2018 12:12:16 +0000 (13:12 +0100)] 
po: update cs.po (from translationproject.org)

6 years agotests: use libtool to execute with valgrind
Karel Zak [Wed, 21 Mar 2018 11:23:22 +0000 (12:23 +0100)] 
tests: use libtool to execute with valgrind

The libtool based build system uses scripts rather than real binaries
in $top_builddir. It's necessary to use libtool --mode=execute to call
valgrind for the real binary (from .libs/).

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: update lsmem
Karel Zak [Tue, 20 Mar 2018 18:06:22 +0000 (19:06 +0100)] 
tests: update lsmem

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsmem: fix total online/offline memory calculation
Gerald Schaefer [Tue, 20 Mar 2018 16:17:38 +0000 (17:17 +0100)] 
lsmem: fix total online/offline memory calculation

lsmem currently calculates the total online/offline memory by iterating
over all lsmem->blocks. Depending on the lsmem options, there may be
only one lsmem->block, because all sysfs memory blocks could be merged
into one. In this case, the calculation is wrong, because the individual
online/offline state of the sysfs memory blocks is not preserved, but
rather lsmem->blocks[0].state is set to the state of the first sysfs
memory block, typically MEMORY_STATE_ONLINE (at least on s390).

This means that "Total offline memory" will always be calculated as 0
in such cases, e.g. when using "lsmem --summary", or any options that
would merge the table output to one line, like "lsmem -o RANGE":

~# lsmem --summary
Memory block size:         1G
Total online memory:      20G
Total offline memory:      0B

Adding the "-a" option shows the real summary, since there is no block
merging going on, and the calculation is therefore correct:

~# lsmem -a --summary
Memory block size:         1G
Total online memory:      16G
Total offline memory:      4G

Fix this by moving the online/offline calculation into the loop that
is iterating over all sysfs memory blocks, instead of iterating over
potentially merged lsmem->blocks.

Reported-by: Alexander Klein <alkl@linux.vnet.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
6 years agolibmount: (docs) update year
Karel Zak [Tue, 20 Mar 2018 17:56:06 +0000 (18:56 +0100)] 
libmount: (docs) update year

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: (docs) update year
Karel Zak [Tue, 20 Mar 2018 17:55:49 +0000 (18:55 +0100)] 
libfdisk: (docs) update year

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: (docs) update year
Karel Zak [Tue, 20 Mar 2018 17:55:36 +0000 (18:55 +0100)] 
libsmartcols: (docs) update year

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/randutils: don't break on EAGAIN, use usleep()
Karel Zak [Tue, 20 Mar 2018 13:17:24 +0000 (14:17 +0100)] 
lib/randutils: don't break on EAGAIN, use usleep()

The current code uses lose_counter to make more attempts to read
random numbers. It seems better to wait a moment between attempts to
avoid busy loop (we do the same in all-io.h).

The worst case is 1 second delay for all random_get_bytes() on systems
with uninitialized entropy pool -- for example you call sfdisk (MBR Id
or GPT UUIDs) on very first boot, etc. In this case it will use libc
rand() as a fallback solution.

Note that we do not use random numbers for security sensitive things
like keys or so. It's used for random based UUIDs etc.

Addresses: https://github.com/karelzak/util-linux/pull/603
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: add /proc/swaps libmount parser test
Karel Zak [Tue, 20 Mar 2018 12:34:31 +0000 (13:34 +0100)] 
tests: add /proc/swaps libmount parser test

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: fix example in docs
Karel Zak [Tue, 20 Mar 2018 12:31:19 +0000 (13:31 +0100)] 
libmount: fix example in docs

Addresses: https://github.com/karelzak/util-linux/issues/599
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: deallocate on /proc/swaps parse error
Karel Zak [Tue, 20 Mar 2018 11:52:16 +0000 (12:52 +0100)] 
libmount: deallocate on /proc/swaps parse error

Addresses: https://github.com/karelzak/util-linux/issues/596
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: make sure we deallocate on parse error
Karel Zak [Tue, 20 Mar 2018 11:20:05 +0000 (12:20 +0100)] 
libmount: make sure we deallocate on parse error

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofstrim: fix fs.h and mount.h collision
Karel Zak [Tue, 20 Mar 2018 10:42:34 +0000 (11:42 +0100)] 
fstrim: fix fs.h and mount.h collision

Unfortunately, old version of the file linux/fs.h defines MS_*
macros, so the file cannot be included together with sys/mount.h.

We include sys/mount.h from libmount.h now.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: make libmount.h more robust
Karel Zak [Tue, 20 Mar 2018 09:54:22 +0000 (10:54 +0100)] 
libmount: make libmount.h more robust

Let's include sys/mount.h to be sure that our local libmount fallbacks
are not used by default to avoid possible conflicts with later included
sys/mount.h.

Addresses: https://github.com/systemd/systemd/pull/8452
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/randutils: Do not block on getrandom()
Carlo Caione [Mon, 19 Mar 2018 10:31:07 +0000 (10:31 +0000)] 
lib/randutils: Do not block on getrandom()

In Endless we have hit a problem when using 'sfdisk' on the really first
boot to automatically expand the rootfs partition. On this platform
'sfdisk' is blocking on getrandom() because not enough random bytes are
available. This is an ARM platform without a hwrng.

We fix this passing GRND_NONBLOCK to getrandom(). 'sfdisk' will use the
best entropy it has available and fallback only as necessary.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
6 years agomcookie: (man) add note about getrandom()
Karel Zak [Mon, 19 Mar 2018 13:03:33 +0000 (14:03 +0100)] 
mcookie: (man) add note about getrandom()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'master' of https://github.com/dirkmueller/util-linux
Karel Zak [Mon, 19 Mar 2018 11:53:22 +0000 (12:53 +0100)] 
Merge branch 'master' of https://github.com/dirkmueller/util-linux

* 'master' of https://github.com/dirkmueller/util-linux:
  Avoid crash in min/max caculation when cpu#0 being offline

6 years agomount: (man) be explicit about bind operation
Karel Zak [Mon, 19 Mar 2018 10:29:25 +0000 (11:29 +0100)] 
mount: (man) be explicit about bind operation

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: consolidate ts_device_has UUID or LABEL
Ruediger Meier [Sat, 10 Mar 2018 18:44:32 +0000 (19:44 +0100)] 
tests: consolidate ts_device_has UUID or LABEL

Regarding parallel root checks ...

 - fix: add a few missing "udevadm settle" where we are using LABELs or UUIDs

 - introduce ts_udevadm_settle():
    * Still trivial implementation. The idea is to use it in future for all
      tests instead of directly calling "udevadm settle". So we could add debug
      messages, wait for specific events, add code for non-udev systems or even
      use "udevadm --{start,stop}-exec-queue" to be really sure what we are
      doing and why using udevadm at all.
    * The currently unused args may be used in future and show the code reader
      already now why we are calling "udevadm settle" at all.
    * So far this patch only affects swapon/, mount/, libmount/ tests, and is
      only about UUIDs and LABELs, but may be continued later for "partitions",
      "md devices", whatever.
    * We are calling ts_udevadm_settle() right *before* we need a LABEL or
      UUID, not just *after* we created one. This may be a bit better for
      speed and shows the code reader which command would fail without settle.

 - function ts_device_has_uuid() is unused now, we trust blkid(1). Renamed to
   ts_is_uuid() in case we would need it again.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: fix grep expressions for devices
Ruediger Meier [Fri, 9 Mar 2018 17:27:44 +0000 (18:27 +0100)] 
tests: fix grep expressions for devices

ts_is_mounted "/dev/loop1" returned true if /dev/loop17 was
mounted. A very annoying source of sporadic failures since
many years. This issue became more visible since running the
checks in parallel, which increases the probability to get
bigger loop device numbers.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: handle xargs errors and invalid args
Ruediger Meier [Fri, 9 Mar 2018 12:04:41 +0000 (13:04 +0100)] 
tests: handle xargs errors and invalid args

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agocolumn: update column.1
ahmogit [Thu, 15 Mar 2018 00:00:42 +0000 (18:00 -0600)] 
column: update column.1

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoAvoid crash in min/max caculation when cpu#0 being offline
Dirk Mueller [Sat, 17 Mar 2018 12:18:38 +0000 (13:18 +0100)] 
Avoid crash in min/max caculation when cpu#0 being offline

When cpu#0 is offline, atof(NULL) is called which causes
a segfault or endless loop depending on implementation
circumstances. So instead of implicitely assumping that the
first cpu is always available, do the presence checks for
all including the first one.

6 years agolibblkid: ignore private Stratis devices
Tony Asleson [Thu, 8 Mar 2018 21:41:26 +0000 (15:41 -0600)] 
libblkid: ignore private Stratis devices

[kzak@redhat.com: - tiny coding style changes]

References: 20e1c3dc03399d6988ef35dedc1364cfc12e9263
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: add new idea to TODO list
Karel Zak [Fri, 9 Mar 2018 09:56:14 +0000 (10:56 +0100)] 
docs: add new idea to TODO list

Addresses: https://github.com/karelzak/util-linux/issues/593
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibuuid: make "CONFORMING TO" man sections more explicit
Karel Zak [Fri, 9 Mar 2018 09:49:46 +0000 (10:49 +0100)] 
libuuid: make "CONFORMING TO" man sections more explicit

Addresses: https://github.com/karelzak/util-linux/issues/592
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'setpriv-example' of https://github.com/yrro/util-linux
Karel Zak [Fri, 9 Mar 2018 09:30:53 +0000 (10:30 +0100)] 
Merge branch 'setpriv-example' of https://github.com/yrro/util-linux

* 'setpriv-example' of https://github.com/yrro/util-linux:
  setpriv: add example section
  setpriv: include --init-groups in the list of options that can be specified with --[re]gid
  setpriv: improve description in man page

6 years agotests: add ipcslimits lock
Ruediger Meier [Fri, 9 Mar 2018 08:31:07 +0000 (09:31 +0100)] 
tests: add ipcslimits lock

These two tests conflict. Interestingly, this is our first lock for
a non-root check.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: fix losetup race
Ruediger Meier [Fri, 9 Mar 2018 02:04:15 +0000 (03:04 +0100)] 
tests: fix losetup race

Also avoid some "no-reentrant" tests.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotravis: homebrew/dupes was deprecated
Ruediger Meier [Fri, 9 Mar 2018 00:15:00 +0000 (01:15 +0100)] 
travis: homebrew/dupes was deprecated

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agosetpriv: add example section
Sam Morris [Thu, 8 Mar 2018 15:47:40 +0000 (15:47 +0000)] 
setpriv: add example section

6 years agosetpriv: include --init-groups in the list of options that can be specified with...
Sam Morris [Thu, 8 Mar 2018 15:46:19 +0000 (15:46 +0000)] 
setpriv: include --init-groups in the list of options that can be specified with --[re]gid

6 years agosetpriv: improve description in man page
Sam Morris [Thu, 8 Mar 2018 15:43:54 +0000 (15:43 +0000)] 
setpriv: improve description in man page

6 years agotests: re-introduce bash 3 compatibility (OSX)
Ruediger Meier [Thu, 8 Mar 2018 10:45:30 +0000 (11:45 +0100)] 
tests: re-introduce bash 3 compatibility (OSX)

Bash 4 is now almost 10 years old and it seemed to be fine in 613a337e
to use associative arrays. Unfortunately OSX will probably never update
to 4 because of GPLv3. We don't want to lose our travis OSX build and
use plain arrays again.

BTW remove that "informative warnings" about unlocked resources. They
were only silent so far because of a bug. Any system where scsi_debug
is broken would print a lot of these warnings. This also tells us that
we could even stop calling ts_unlock() explicitly. Just exiting the
tests would be good enough.

Note that currently flock(1) is not available on our OSX build anyways.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agodocs: add remount-all idea to TODO
Karel Zak [Thu, 8 Mar 2018 10:30:29 +0000 (11:30 +0100)] 
docs: add remount-all idea to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotravis: use parallel root checks
Ruediger Meier [Wed, 7 Mar 2018 19:12:02 +0000 (20:12 +0100)] 
travis: use parallel root checks

Also improve CPU count detection for tests.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: dont't timeout flock
Ruediger Meier [Wed, 7 Mar 2018 16:58:23 +0000 (17:58 +0100)] 
tests: dont't timeout flock

The only situation where we would block endless is if another parallel test
has the lock and hangs for another reason. This means that the other test
would still keep hanging even if we timeout here. The user would have to
interrupt the other test or the whole test-suite anyways.

Note that we would certainly run into any timeout when using --parallel=200,
so that all scsi tests start the same time.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: don't use unlocked resources
Ruediger Meier [Wed, 7 Mar 2018 16:51:35 +0000 (17:51 +0100)] 
tests: don't use unlocked resources

The test-suite did not survive when flock timeouts after 30s because
then ts_cleanup_on_exit() may use resources (e.g. rmmod scsi_debug)
while not having the lock.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: don't lock fd 1 (stdout), don't use /proc/$$/fd
Ruediger Meier [Tue, 6 Mar 2018 23:29:59 +0000 (00:29 +0100)] 
tests: don't lock fd 1 (stdout), don't use /proc/$$/fd

On debian-kfreebsd we've locked stdout which messed up our test logs. Using
/proc/*/fd/ is not portable. Even ts_init's test for "/proc/self/fd"
does not help because /proc/*/fd behaves strange here:

  $ ls -l  /proc/$$/fd
  lr--r--r-- 1 rudi user 0 Mar  6 23:11 /proc/2194/fd -> unknown
  $ file /proc/$$/fd
  /proc/2194/fd: broken symbolic link to `unknown'
  ## wtf?
  $ test -d /proc/$$/fd; echo $?
  0
  $ ls -l  /proc/$$/fd/
  ls: cannot access /proc/2194/fd/: No such file or directory
  ## but
  $ ls -l  /proc/self/fd/
  total 0
  cr-xr-xr-x 1 root root 0, 3 Mar  6 19:39 0
  cr-xr-xr-x 1 root root 0, 4 Mar  6 19:39 1
  cr-xr-xr-x 1 root root 0, 5 Mar  6 19:39 2
  cr-xr-xr-x 1 root root 0, 6 Mar  6 19:39 3

This is how this patch changes the test output:

[...]
         blkid: partitions probing: [06] sgi                  ... OK
         blkid: partitions probing: [07] sun                  ... OK
         blkid: partitions probing                            ... OK (all 7 sub-tests PASSED)
-ls: cannot access /proc/66215/fd/: No such file or directory
+        blkid: mbr-wholedisk                                 ... SKIPPED (missing scsi_debug module (dry-run))
         blkid: MD raid0 (whole-disks)                        ... SKIPPED (losetup not found)
         blkid: MD raid1 (last partition)                     ... SKIPPED (missing in PATH: mdadm)
         blkid: MD raid1 (whole-disks)                        ... SKIPPED (losetup not found)
@@ -343,11 +343,11 @@
         dmesg: facilities                                    ... SKIPPED (test_dmesg not found)
         dmesg: indentation                                   ... SKIPPED (test_dmesg not found)
         eject: umount                                        ... SKIPPED (eject not found)
-ls: cannot access /proc/69561/fd/: No such file or directory
-ls: cannot access /proc/69609/fd/: No such file or directory
+        fdisk: align 512/4K                                  ... SKIPPED (missing scsi_debug module (dry-run))
+        fdisk: align 512/4K +alignment_offset                ... SKIPPED (missing scsi_debug module (dry-run))
         fdisk: align 512/4K +MD                              ... SKIPPED (missing in PATH: mdadm)
         fdisk: align 512/512                                 ... SKIPPED (losetup not found)
[...]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: add wierd sleep for libmount/context
Ruediger Meier [Tue, 23 Jan 2018 23:20:15 +0000 (00:20 +0100)] 
tests: add wierd sleep for libmount/context

I still don't understand why this helps to fix these tests on my system.
udevadm settle had no positive effect. Adding the sleeps before
"is_mounted" also didn't fixed that, that's amazing!?

Below the test log, very often seen on my system since a long time:

-------------------- util-linux regression tests --------------------

                    For development purpose only.
                 Don't execute on production system!

       kernel: 4.4.104-39-default

     libmount: context: [01] mount-by-devname                ... OK
     libmount: context: [02] umount-by-devname               ... OK
     libmount: context: [03] mount-by-label                  ... OK
     libmount: context: [04] umount-by-mountpoint            ... OK
     libmount: context: [05] mount-by-uuid                   ... FAILED (libmount/context-mount-by-uuid)
     libmount: context: [06] mount-flags                     ... FAILED (libmount/context-mount-flags)
     libmount: context: [07] mount-loopdev                   ... OK
     libmount: context: [08] x-mount.mkdir                   ... OK
     libmount: context: [09] X-mount.mkdir                   ... OK
     libmount: context                                       ... FAILED (2 from 9 sub-tests)

---------------------------------------------------------------------
  1 tests of 17 FAILED
---------------------------------------------------------------------

rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-by-uuid
--- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-by-uuid   2017-07-03 12:20:24.144845538 +0200
+++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-by-uuid       2018-01-24 00:42:18.549444408 +0100
@@ -1,2 +1,3 @@
 successfully mounted
-successfully umounted
+failed to umount
+FAILED [rc=16]/dev/sdb1 still mounted

rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-flags
--- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-flags     2017-07-03 12:20:24.148845497 +0200
+++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-flags 2018-01-24 00:42:18.725442931 +0100
@@ -1,5 +1,5 @@
+test_mount_context: failed to mount: Device or resource busy
+FAILED [rc=16]rw,relatime
 successfully mounted
-ro,nosuid,noexec
-successfully mounted
-rw,nosuid,noexec
+rw,relatime
 successfully umounted

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotests: add some more udevadm settle
Ruediger Meier [Wed, 7 Mar 2018 16:16:28 +0000 (17:16 +0100)] 
tests: add some more udevadm settle

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agotravis: enable osx root checks
Ruediger Meier [Tue, 6 Mar 2018 22:58:41 +0000 (23:58 +0100)] 
travis: enable osx root checks

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agoMerge branch 'setpriv-caps' of https://github.com/yrro/util-linux
Karel Zak [Wed, 7 Mar 2018 11:41:13 +0000 (12:41 +0100)] 
Merge branch 'setpriv-caps' of https://github.com/yrro/util-linux

6 years agouuidd: cosmetic coding style change
Karel Zak [Wed, 7 Mar 2018 10:53:15 +0000 (11:53 +0100)] 
uuidd: cosmetic coding style change

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agouuidd: don't truncate long socket paths
Ruediger Meier [Wed, 7 Mar 2018 09:40:23 +0000 (10:40 +0100)] 
uuidd: don't truncate long socket paths

This was the error
  uuidd: couldn't bind unix socket /var/tmp/portage/sys-apps/util-linux-2.31.1/work/util-linux-2.31.1-abi_x86_64.amd64/tests/output/uuid/uuiddkOcTUuoZ7kaP3: Address already in use

because the socket path was truncated to 108 chars which was luckily
an existing directory.

Now we abort early with "uuidd: socket name too long: ... "

Reported-by: Thomas Deutschmann <whissi@gentoo.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
6 years agosetpriv: fix manpage typo
Sam Morris [Tue, 6 Mar 2018 17:05:38 +0000 (17:05 +0000)] 
setpriv: fix manpage typo

The example given in the man page didn't work. Judging by commit
db663995bd93e170a43b1a7050c7a738782dabfb, --inh-caps= used to be called
--caps= but the man page was not updated after the change was made.

6 years agolibmount: fix fs pattern usage in mount --all
Karel Zak [Tue, 6 Mar 2018 13:44:23 +0000 (14:44 +0100)] 
libmount: fix fs pattern usage in mount --all

The command "mount -a -t <pattern>" uses the -t as pattern to filter
fstab entries. And "mount -t <type>" is used to specify FS type.

Unfortunately libmount does not care about this difference when it
calls standard mount functionality. The original pattern is still in
the library control struct and mnt_do_mount() tries to use it as FS
type.

This patch is just bugfix. Maybe the long term solution would be to
differentiate between the pattern and type in the library API. Now the
library follows mount(8) command line and it's little bit messy.

Reported-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: add script(1) events idea to TODO
Karel Zak [Mon, 5 Mar 2018 12:40:55 +0000 (13:40 +0100)] 
docs: add script(1) events idea to TODO

Addresses: https://github.com/karelzak/util-linux/issues/583
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: add note about JSON
Karel Zak [Mon, 5 Mar 2018 11:23:55 +0000 (12:23 +0100)] 
docs: add note about JSON

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'master' of https://github.com/yurchor/util-linux
Karel Zak [Fri, 2 Mar 2018 13:04:20 +0000 (14:04 +0100)] 
Merge branch 'master' of https://github.com/yurchor/util-linux

* 'master' of https://github.com/yurchor/util-linux:
  Fix minor typos on man pages

6 years agobash-completion: update zramctl algorithms list
Sami Kerola [Sun, 18 Feb 2018 20:22:01 +0000 (20:22 +0000)] 
bash-completion: update zramctl algorithms list

Reference: a3612b81fe0c172bc4fe7e2cf468f195bd785222.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agoFix minor typos on man pages
Yuri Chornoivan [Thu, 1 Mar 2018 14:42:34 +0000 (16:42 +0200)] 
Fix minor typos on man pages