]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 years agoMerge branch 'fixes' of https://github.com/yontalcar/util-linux
Karel Zak [Thu, 10 May 2018 09:59:41 +0000 (11:59 +0200)] 
Merge branch 'fixes' of https://github.com/yontalcar/util-linux

* 'fixes' of https://github.com/yontalcar/util-linux:
  libfdisk: fix list_del after partition reset
  choom: set oom_score_adj before exec
  fdisk: fix typo in debug string

6 years agochcpu: Fix maximal number of CPUs
Stanislav Brabec [Wed, 9 May 2018 20:13:07 +0000 (22:13 +0200)] 
chcpu: Fix maximal number of CPUs

chcpu.c mixed maxcpus (number of cpus) and setsize (size of CPU bit
mask). It effectively limits number of CPUs to 1/8 of the supported
amount.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Michael Matz <matz@suse.de>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
6 years agolscpu, chcpu: Avoid use of the old CPU macros
Stanislav Brabec [Wed, 9 May 2018 16:08:32 +0000 (18:08 +0200)] 
lscpu, chcpu: Avoid use of the old CPU macros

The old CPU macros are limited to 1024 cores. As a result, lscpu cannot
count sockets on large systems. Use new scalable macros.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Michael Matz <matz@suse.de>
6 years agolast: fix false positive compiler warning
Sami Kerola [Thu, 3 May 2018 21:57:59 +0000 (22:57 +0100)] 
last: fix false positive compiler warning

login-utils/last.c: In function ‘list’:
login-utils/last.c:398:36: warning: argument to ‘sizeof’ in ‘strncat’ call
is the same expression as the source; did you mean to use the size of the
destination?  [-Wsizeof-pointer-memaccess]
  strncat(utline, p->ut_line, sizeof(p->ut_line));

The sizeof(utline) is defined as sizeof(p->ut_line) + 1, so the compiler got
that wrong.  Lets truncate strncat() otherway around to keep gcc 8.1 happy.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agozramctl: fix truncation warning
Sami Kerola [Thu, 3 May 2018 21:57:58 +0000 (22:57 +0100)] 
zramctl: fix truncation warning

sys-utils/zramctl.c: In function ‘zram_get_sysfs’:
sys-utils/zramctl.c:220:52: warning: ‘%s’ directive output may be truncated
writing up to 4095 bytes into a region of size 27 [-Wformat-truncation=]
     snprintf(z->devname, sizeof(z->devname), "/dev/%s", name);

As an additional good thing zramctl will no longer allocate 4096 bytes from
stack when just 23 bytes is enough.

[kzak@redhat.com: - use macro rather than hardcoded string for the path]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/canonicalize: fix truncation warning
Sami Kerola [Thu, 3 May 2018 21:57:57 +0000 (22:57 +0100)] 
lib/canonicalize: fix truncation warning

lib/canonicalize.c: In function ‘canonicalize_dm_name’:
lib/canonicalize.c:42:45: warning: ‘%s’ directive output may be truncated
writing up to 255 bytes into a region of size 244 [-Wformat-truncation=]
   snprintf(path, sizeof(path), "/dev/mapper/%s", name);

Notice that this warnign fix does not improve code enormously.  The earlier
snprintf() truncation will not happen a bit earlier when fgets() is called.
In that sense this change merely makes one easy to silence warning to
disappear, and therefore improve change of noticing useful messaging as such
crops up.

[kzak@redhat.com: - use macro rather than hardcoded string for mapper path]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: fix list_del after partition reset
Vaclav Dolezal [Wed, 9 May 2018 14:35:38 +0000 (16:35 +0200)] 
libfdisk: fix list_del after partition reset

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
6 years agochoom: set oom_score_adj before exec
Vaclav Dolezal [Tue, 17 Apr 2018 17:03:17 +0000 (19:03 +0200)] 
choom: set oom_score_adj before exec

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
6 years agofdisk: fix typo in debug string
Vaclav Dolezal [Tue, 29 Aug 2017 13:29:27 +0000 (15:29 +0200)] 
fdisk: fix typo in debug string

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
6 years agodmesg: link together with syslog(2) manual page
Sami Kerola [Thu, 26 Apr 2018 20:44:08 +0000 (21:44 +0100)] 
dmesg: link together with syslog(2) manual page

The dmesg may require capabilities(7) when /proc/sys/kernel/dmesg_restrict
has none zero value.  This is explained in detail in syslog(2) manual page.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agolibfdisk: fix compiler warning [-Wunused-parameter]
Karel Zak [Thu, 3 May 2018 08:30:51 +0000 (10:30 +0200)] 
libfdisk: fix compiler warning [-Wunused-parameter]

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: fix compiler warning [-Wunused-parameter]
Karel Zak [Thu, 3 May 2018 08:30:51 +0000 (10:30 +0200)] 
libmount: fix compiler warning [-Wunused-parameter]

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibblkid: (zfs) fix compiler warning [-Wmaybe-uninitialized]
Karel Zak [Thu, 3 May 2018 08:30:51 +0000 (10:30 +0200)] 
libblkid: (zfs) fix compiler warning [-Wmaybe-uninitialized]

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofdisk: fix compiler warning [-Wmaybe-uninitialized]
Karel Zak [Thu, 3 May 2018 08:30:51 +0000 (10:30 +0200)] 
fdisk: fix compiler warning [-Wmaybe-uninitialized]

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: cleanup --with/--without help strings
Karel Zak [Thu, 3 May 2018 08:16:11 +0000 (10:16 +0200)] 
build-sys: cleanup --with/--without help strings

--with-     means disabled by default or modify any default path
--without-  means enabled by default

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: --without-systemd disables --with-systemdsystemunitdir
Karel Zak [Thu, 3 May 2018 07:56:35 +0000 (09:56 +0200)] 
build-sys: --without-systemd disables --with-systemdsystemunitdir

Make sure --without-systemd disables also --with-systemdsystemunitdir.

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'fix-pt_BR-trans' of https://github.com/luizluca/util-linux
Karel Zak [Mon, 30 Apr 2018 09:26:16 +0000 (11:26 +0200)] 
Merge branch 'fix-pt_BR-trans' of https://github.com/luizluca/util-linux

6 years agoblkid: (man) add note about udev encoding
Karel Zak [Mon, 30 Apr 2018 08:52:53 +0000 (10:52 +0200)] 
blkid: (man) add note about udev encoding

Addresses: https://github.com/karelzak/util-linux/issues/632
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: extend "Could not locate the pkg-config" error message
Karel Zak [Mon, 30 Apr 2018 07:41:26 +0000 (09:41 +0200)] 
build-sys: extend "Could not locate the pkg-config" error message

Addresses: https://github.com/karelzak/util-linux/issues/631
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: improve bison version detection
Karel Zak [Mon, 30 Apr 2018 07:37:14 +0000 (09:37 +0200)] 
build-sys: improve bison version detection

Addresses: https://github.com/karelzak/util-linux/issues/630
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: improve docs about mnt_context_mount() return codes
Karel Zak [Thu, 26 Apr 2018 09:04:07 +0000 (11:04 +0200)] 
libmount: improve docs about mnt_context_mount() return codes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: pt_BR: fix fallocate '-l' help msg
Luiz Angelo Daros de Luca [Tue, 24 Apr 2018 17:40:02 +0000 (14:40 -0300)] 
po: pt_BR: fix fallocate '-l' help msg

Translation was using '-n' instead of '-l'

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
6 years agolibblkid: add BitLocker detection
Karel Zak [Tue, 24 Apr 2018 08:57:48 +0000 (10:57 +0200)] 
libblkid: add BitLocker detection

Supported:
* WinVista version
* Win7 and later versions (based on NTFS)
* BitLockerToGo (for removable media; based on FAT32)

Unfortunately, it's without LABEL and UUID. It seems BitLocker does
not use volume_label and volume_serial stuff from NTFS header.

Addresses: https://github.com/karelzak/util-linux/issues/617
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'master' of https://github.com/pali/util-linux
Karel Zak [Fri, 20 Apr 2018 08:06:41 +0000 (10:06 +0200)] 
Merge branch 'master' of https://github.com/pali/util-linux

* 'master' of https://github.com/pali/util-linux:
  Update information about udf in mount manpage

6 years agoumount: add note about --lazy
Karel Zak [Fri, 20 Apr 2018 07:50:04 +0000 (09:50 +0200)] 
umount: add note about --lazy

Unfortunately, it's pretty common that users on production systems use
lazy umount to fix some FS issues. The usual result is unwanted system
reboot, because -l is not the right way how to fix unreachable NFS or
mess with local FS with submounts.

Note that after lazy umount /proc/self/mountinfo does not contain the
FS entry, but kernel still references the FS. It makes it very
difficult to debug.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1566674
Suggested-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoUpdate information about udf in mount manpage
Pali Rohár [Thu, 19 Apr 2018 15:22:49 +0000 (17:22 +0200)] 
Update information about udf in mount manpage

6 years agorfkill: use scols_column_set_json_type()
Karel Zak [Wed, 18 Apr 2018 14:08:15 +0000 (16:08 +0200)] 
rfkill: use scols_column_set_json_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsns: use scols_column_set_json_type()
Karel Zak [Wed, 18 Apr 2018 14:03:52 +0000 (16:03 +0200)] 
lsns: use scols_column_set_json_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsipc: cleanup columns[] usage
Karel Zak [Wed, 18 Apr 2018 13:51:17 +0000 (15:51 +0200)] 
lsipc: cleanup columns[] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolosetup: use scols_column_set_json_type()
Karel Zak [Wed, 18 Apr 2018 13:25:20 +0000 (15:25 +0200)] 
losetup: use scols_column_set_json_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agowipefs: use scols_column_set_json_type()
Karel Zak [Wed, 18 Apr 2018 13:12:46 +0000 (15:12 +0200)] 
wipefs: use scols_column_set_json_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolslocks: use scols_column_set_json_type()
Karel Zak [Wed, 18 Apr 2018 13:07:31 +0000 (15:07 +0200)] 
lslocks: use scols_column_set_json_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolslocks: add --bytes cleanup SIZE usage
Karel Zak [Wed, 18 Apr 2018 12:54:49 +0000 (14:54 +0200)] 
lslocks: add --bytes cleanup SIZE usage

The new command line option --bytes disables human readable output for
the SIZE and keep size in bytes. We use the same concept for all our
utils.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofindmnt: use scols_column_set_json_type()
Karel Zak [Wed, 18 Apr 2018 12:45:21 +0000 (14:45 +0200)] 
findmnt: use scols_column_set_json_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofincore: use scols_column_set_json_type()
Karel Zak [Wed, 18 Apr 2018 12:32:39 +0000 (14:32 +0200)] 
fincore: use scols_column_set_json_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: fix mnt_table_is_fs_mounted() for NFS bind mounts.
NeilBrown [Wed, 18 Apr 2018 03:31:38 +0000 (13:31 +1000)] 
libmount: fix mnt_table_is_fs_mounted() for NFS bind mounts.

When you bind-mount a subdirectory of a local filesystem, the
path to that subdirectory appears as the fourth field in mountinfo.

For nfs mounts, the fourth field is always "/", and the subdirectory
part is appended to the "special" (aka "device") field.  This is
consistent with historical NFS usage which always includes a path in
the fs_spec field.

libmount needs to know about this when "mount -a" checks to see if
a filesystem is already mounted.

Without this fix, fstab lines like:

 server::/path /dir nfs defaults 0 0
 /dir/subdir /mnt/test none bind 0 0

result in a new mount at /mnt/test every time "mount -a" is run.

[kzak@redhat.com: - use strappend() rather than asprintf()]

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobugfix: fix possible segfault during umount -a
Richard Fuchs [Tue, 17 Apr 2018 13:40:20 +0000 (09:40 -0400)] 
bugfix: fix possible segfault during umount -a

mnt_context_get_mtab() doesn't set its return **tb argument on error,
and so in mnt_context_next_umount() mtab will remain uninitialized on
error, later resulting in cxt->mtab containing garbage, possibly
resulting in segfault on exit.

6 years agochoom: fix build, remove unnecessary include
Karel Zak [Mon, 16 Apr 2018 11:48:11 +0000 (13:48 +0200)] 
choom: fix build, remove unnecessary include

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'choom'
Karel Zak [Mon, 16 Apr 2018 11:03:25 +0000 (13:03 +0200)] 
Merge branch 'choom'

6 years agochoom: new command to adjust OOM-killer score value
Karel Zak [Mon, 16 Apr 2018 10:53:39 +0000 (12:53 +0200)] 
choom: new command to adjust OOM-killer score value

Let's provide command line tool, man page with OOM description and
bash-completion. It seems better than force end-users to use "echo"
to /proc.

Addresses: https://github.com/karelzak/util-linux/issues/609
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'rename-interactive' of https://github.com/g-raud/util-linux
Karel Zak [Mon, 16 Apr 2018 08:37:31 +0000 (10:37 +0200)] 
Merge branch 'rename-interactive' of https://github.com/g-raud/util-linux

* 'rename-interactive' of https://github.com/g-raud/util-linux:
  rename: fixup & style (no functional changes)
  rename: test availability of __fpurge() and fpurge()
  rename: ask(): call __fpurge() to cater for multi-byte characters
  rename.1: describe interactive mode
  rename: ask(): print n when EOF on input
  rename: detect tty in cbreak mode to make ask() read a single byte
  rename.1: fix warning section
  rename: add option --interactive to ask before overwriting
  rename: skip faccessat() failure if AT_SYMLINK_NOFOLLOW is not a valid flag
  rename: check source file access early

6 years agolslocks: fix memory leak
Karel Zak [Mon, 16 Apr 2018 08:27:29 +0000 (10:27 +0200)] 
lslocks: fix memory leak

Addresses: https://github.com/karelzak/util-linux/pull/618
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolslocks: add info about OFD
Karel Zak [Fri, 13 Apr 2018 09:22:21 +0000 (11:22 +0200)] 
lslocks: add info about OFD

It seems users are confused by PID -1 and missing path. This patch add
more information about OFD locks to the man page and "undefined" to
the COMMAND column.

References: http://austingroupbugs.net/view.php?id=768
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1527102
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibblkid: (hfs) check allocation size
Karel Zak [Thu, 12 Apr 2018 12:21:47 +0000 (14:21 +0200)] 
libblkid: (hfs) check allocation size

The current prober is based on signature only (two bytes!). It seems
pretty fragile. Linux kernel also checks for allocation size in the
superblock, let's use it too... it's better than nothing.

Reported-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolscpu: Cortex-A12 merged into Cortex-A17
Karel Zak [Thu, 12 Apr 2018 09:32:17 +0000 (11:32 +0200)] 
lscpu: Cortex-A12 merged into Cortex-A17

References: https://community.arm.com/processors/b/blog/posts/arm-cortex-a17-cortex-a12-processor-update
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorfkill: include <poll.h> instead of <sys/poll.h>
Patrick Steinhardt [Tue, 10 Apr 2018 12:36:32 +0000 (13:36 +0100)] 
rfkill: include <poll.h> instead of <sys/poll.h>

The POSIX standard states that poll(3P) is being made available by
<poll.h>, not <sys/poll.h>. Most commands already include the correct
header, with the exception of rfkill. Fix that to avoid a warning on
musl-based systems.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
6 years agocfdisk: fix missing prototype for `get_wch`
Patrick Steinhardt [Tue, 10 Apr 2018 12:36:31 +0000 (13:36 +0100)] 
cfdisk: fix missing prototype for `get_wch`

The header <ncursesw/ncurses.h> defines the get_wch(3) function only
when `NCURSES_WIDECHAR` is defined. This define is actually getting set
in the same header file, but only in case `_XOPEN_SOURCE` is defined and
has a value of 500 or higher. As we already have the precedence of
defining `_XOPEN_SOURCE` to a value of 600 in some other files, simply
define it to the minimum required value of 500 in "cfdisk.c". This
silences a warning for `get_wch` being unknown.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
6 years agosetpriv: implement option to set parent death signal
Patrick Steinhardt [Tue, 10 Apr 2018 11:08:21 +0000 (12:08 +0100)] 
setpriv: implement option to set parent death signal

When a process uses the syscall `prctl(PR_SET_PDEATHSIG, ...)`, it will
get notified with a process-defined signal as soon as its parent process
dies. This is for example being used by unshare(1)'s recently added
"--kill-child" option, causing the forked child to be killed as soon as
unshare itself dies.

Unfortunately, some LSMs will cause the parent death signal to be reset
when a process changes credentials, with the most important ones being
SELinux and AppArmor. The following command will thus not work as
expected:

    unshare --fork --kill-child setpriv --reuid user <executable>

As soon as setpriv changes UID, the parent death signal is cleared and
the child will never get signalled when unshare gets killed.

Add a new option "--pdeathsig keep|clear|<signal>". Setting this flag
will cause us to either

- restore the previously active parent death signal as soon as the
  setpriv has applied all credential changes
- clear the parent death signal
- set the parent death signal to "<signal>"

Furthermore, print out the currently set signal when dumping process
state.

[kzak@redhat.com: - small changes in codding style]

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorename: fixup & style (no functional changes)
G.raud Meyer [Mon, 9 Apr 2018 12:44:52 +0000 (14:44 +0200)] 
rename: fixup & style (no functional changes)

6 years agorename: test availability of __fpurge() and fpurge()
G.raud Meyer [Thu, 5 Apr 2018 09:50:07 +0000 (11:50 +0200)] 
rename: test availability of __fpurge() and fpurge()

6 years agorename: ask(): call __fpurge() to cater for multi-byte characters
G.raud Meyer [Tue, 5 Apr 2011 09:31:03 +0000 (11:31 +0200)] 
rename: ask(): call __fpurge() to cater for multi-byte characters

Making a purge in cbreak mode also makes the code compatible with
canonical mode.  This can be useful in the case a shell, like bash, does
not restore the tty state of stopped jobs before restarting them.  An
alternative fix to this minor shortcoming would be to retest the tty
state each time inside ask().

6 years agorename.1: describe interactive mode
G.raud Meyer [Mon, 2 Apr 2018 13:32:44 +0000 (15:32 +0200)] 
rename.1: describe interactive mode

6 years agorename: ask(): print n when EOF on input
G.raud Meyer [Sat, 31 Mar 2018 13:01:27 +0000 (15:01 +0200)] 
rename: ask(): print n when EOF on input

6 years agorename: detect tty in cbreak mode to make ask() read a single byte
G.raud Meyer [Thu, 29 Mar 2018 10:08:46 +0000 (12:08 +0200)] 
rename: detect tty in cbreak mode to make ask() read a single byte

Set tty_cbreak only when tty has a VMIN of 1 to avoid having to purge at
all in cbreak mode.

The prompt is still compatible with a non interactive input from a pipe.

6 years agorename.1: fix warning section
G.raud Meyer [Sat, 24 Mar 2018 11:20:58 +0000 (12:20 +0100)] 
rename.1: fix warning section

6 years agorename: add option --interactive to ask before overwriting
G.raud Meyer [Sat, 24 Mar 2018 11:15:55 +0000 (12:15 +0100)] 
rename: add option --interactive to ask before overwriting

The option name -i/--interactive is picked from mv(1) and cp(1) from GNU
and BSD.

Also update the manpage.

6 years agorename: skip faccessat() failure if AT_SYMLINK_NOFOLLOW is not a valid flag
G.raud Meyer [Mon, 9 Apr 2018 13:35:40 +0000 (15:35 +0200)] 
rename: skip faccessat() failure if AT_SYMLINK_NOFOLLOW is not a valid flag

AT_SYMLINK_NOFOLLOW is not required by POSIX and it is not a valid flag
on Mac OSX.

6 years agorename: check source file access early
G.raud Meyer [Thu, 29 Mar 2018 11:28:10 +0000 (13:28 +0200)] 
rename: check source file access early

This change makes rename detect inexisting files given on the command
line and consider them faliures.  This is particularly useful with
--no-act (to detect extraneous arguments).

It also prevents skipping non existing files (when the modified name
happens to exist).  This makes --verbose not print skipping messages of
false positives (the access error is printed instead).

6 years agodocs: update TODO (libblkid)
Karel Zak [Mon, 9 Apr 2018 12:08:23 +0000 (14:08 +0200)] 
docs: update TODO (libblkid)

Addresses: https://github.com/karelzak/util-linux/issues/617
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update TODO (lsblk)
Karel Zak [Mon, 9 Apr 2018 11:14:25 +0000 (13:14 +0200)] 
docs: update TODO (lsblk)

* remove NVMe-multipath lsblk issue (already fixed by kernel)
* add lsblk rewrite

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agomount: more notes about --options-* to man page
Karel Zak [Mon, 9 Apr 2018 10:39:10 +0000 (12:39 +0200)] 
mount: more notes about --options-* to man page

Signed-off-by: Karel Zak <kzak@redhat.com>
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>