]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
5 years agobuild-sys: release++ (v2.32.1) stable/v2.32 v2.32.1
Karel Zak [Mon, 16 Jul 2018 10:33:13 +0000 (12:33 +0200)] 
build-sys: release++ (v2.32.1)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update v2.32.1-ReleaseNotes
Karel Zak [Mon, 16 Jul 2018 10:31:08 +0000 (12:31 +0200)] 
docs: update v2.32.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Mon, 16 Jul 2018 10:29:21 +0000 (12:29 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Mon, 16 Jul 2018 10:29:08 +0000 (12:29 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Mon, 16 Jul 2018 10:22:36 +0000 (12:22 +0200)] 
po: update pt_BR.po (from translationproject.org)

5 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Mon, 16 Jul 2018 10:22:36 +0000 (12:22 +0200)] 
po: update ja.po (from translationproject.org)

5 years agologger: Define SD_JOURNAL_SUPPRESS_LOCATION.
YmrDtnJu [Sat, 7 Jul 2018 18:11:46 +0000 (20:11 +0200)] 
logger: Define SD_JOURNAL_SUPPRESS_LOCATION.

The normal journald functions add the location in the C source code files to
the log messages. This is nice for a big C based project, but logger is used in
scripts so it would be more useful to let users specify the location in the
script by adding the CODE_FUNC, CODE_FILE and CODE_FILE fields to the log
message.

It is already possible to do this, but it will result in two versions of these
fields: one for the location in logger.c and one for the location in the
script.

5 years agolibfdisk: use \x<hex> to read/write partition name
Karel Zak [Wed, 4 Jul 2018 12:06:38 +0000 (14:06 +0200)] 
libfdisk: use \x<hex> to read/write partition name

Addresses: https://github.com/karelzak/util-linux/issues/656
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoORIG_HEAD
Karel Zak [Wed, 11 Jul 2018 14:14:53 +0000 (16:14 +0200)] 
ORIG_HEAD

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoexec_shell: prevent ".: applet not found" error when SHELL env is not set.
osexp2000 [Mon, 25 Jun 2018 01:34:31 +0000 (10:34 +0900)] 
exec_shell: prevent ".: applet not found" error when SHELL env is not set.

When SHELL env is not set, it cause xstrdup(NULL) be executed, and result in weird error message ".: applet not found" instead of /bin/sh being used.

5 years agopartx: exit with error code when partition read failed
Andreas Henriksson [Sun, 17 Jun 2018 12:49:15 +0000 (14:49 +0200)] 
partx: exit with error code when partition read failed

Make sure partx exits with a non-0 return code when
it runs into either code-path where getting the partition
table failed (or wasn't even attempted because of previous
error condition).

Change was tested using:
touch /tmp/foobar
partx -s - /tmp/foobar

Previously that was only printing an error/warning message
and then exiting with 0, but after this change it exits
with 1.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Reported-by: Juan Céspedes <cespedes@debian.org>
Addresses: https://bugs.debian.org/898426

5 years agosetarch: add another PER_LINUX32 aliases for ppcle
Karel Zak [Thu, 14 Jun 2018 11:02:49 +0000 (13:02 +0200)] 
setarch: add another PER_LINUX32 aliases for ppcle

The big-endian version maps generic "ppc" and "ppc32" aliases to
PER_LINUX32.  It seems that we can do the same for little-endian.

Note that SYS_personality does not care about LE/BE, it's 32 or 64 bit.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agozramctl: (man) explain that --find is necessary
Karel Zak [Mon, 11 Jun 2018 09:14:56 +0000 (11:14 +0200)] 
zramctl: (man) explain that --find is necessary

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1589148
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoblkzone: fix whole device detection
Karel Zak [Fri, 8 Jun 2018 09:37:55 +0000 (11:37 +0200)] 
blkzone: fix whole device detection

Matias Bjørling wrote:
  The current detection code for chunk size assumes that the
  underlying device is a device that uses the minor device id
  as the partition id, and that the whole device has minor id 0.
  This is not true for example null_blk and nvme device drivers.

Let's use sysfs_devno_to_wholedisk() to get whole-disk devno.

Addresses: https://github.com/karelzak/util-linux/pull/646
Reported-by: Matias Bjørling matias.bjorling@wdc.com
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: keep c_iflags unmodified on --autologin
Karel Zak [Wed, 6 Jun 2018 13:57:24 +0000 (15:57 +0200)] 
agetty: keep c_iflags unmodified on --autologin

agetty sets c_iflags according to interaction with serial line in
get_logname(). For --autologin it does not read from the line, so we
have no clue how to set the flags.

The current behavior is to zeroize the flags.  Unfortunately, it seems
like bad idea, because the line may be already properly initialized by
kernel (or systemd, etc.).

The new behavior is not touch the flags on --autologin.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1252764
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibsmartcols: don't print empty column
Karel Zak [Mon, 4 Jun 2018 13:20:28 +0000 (15:20 +0200)] 
libsmartcols: don't print empty column

The commit 0f9f927b6f62cb7f488fadfad76c4a5defdefe36 forces
libsmartcols to use one byte as a minimal column width. This seems
like a bug if the column is empty and without header.

$ printf ':a:b\n' | column -t -s ':' -o ':'
 :a:b

Fixed version:
$ printf ':a:b\n' | column -t -s ':' -o ':'
:a:b

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 years agolibmount: include sys/mount.h on Linux only
Karel Zak [Tue, 29 May 2018 08:06:00 +0000 (10:06 +0200)] 
libmount: include sys/mount.h on Linux only

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=891812
Signed-off-by: Karel Zak <kzak@redhat.com>
5 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>
5 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>
5 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>
5 years agopo: fix lsblk translation
Karel Zak [Tue, 29 May 2018 07:49:59 +0000 (09:49 +0200)] 
po: fix lsblk translation

Reported-by: Rosberg Nascimento Freitas Rodrigues <rosberg.berg@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/strutils: fix strnlen() fallback
Karel Zak [Mon, 28 May 2018 10:30:34 +0000 (12:30 +0200)] 
lib/strutils: fix strnlen() fallback

Addresses: https://github.com/karelzak/util-linux/issues/643
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibblkid: (ntfs) fix cluster size check
Karel Zak [Fri, 25 May 2018 19:02:23 +0000 (21:02 +0200)] 
libblkid: (ntfs) fix cluster size check

Addresses: https://github.com/karelzak/util-linux/issues/641
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibblkid: udf: Fix reporting UDF 2.60 revision
Pali Rohár [Fri, 25 May 2018 15:52:31 +0000 (17:52 +0200)] 
libblkid: udf: Fix reporting UDF 2.60 revision

According to the UDF 2.60 specification, the Minimum UDF Read Revision
value shall be at most #0250 for all media with a UDF 2.60 file system.

So in this case use Minimum UDF Write Revision as ID_FS_VERSION to
distinguish between UDF 2.50 and UDF 2.60 discs.

This commit also adds a testing Blu-Ray Recordable image with UDF revision
2.60 created by Nero which really sets Minimum UDF Read Revision to 2.50.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
5 years agolibblkid: (ntfs) enlarge cluster limit to 2MB
Karel Zak [Fri, 25 May 2018 11:53:03 +0000 (13:53 +0200)] 
libblkid: (ntfs) enlarge cluster limit to 2MB

Windows 10 Creators edition has extended the ntfs cluster limit to
2MB. As a consequence blkid does not identify recent partitions with
clusters beyond 65K as ntfs ones.

Addresses: https://github.com/karelzak/util-linux/issues/641
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Jean-Pierre André <jean-pierre.andre@wanadoo.fr>

5 years agocfdisk: fix compiler warnings, follow-up 7085f1e4 (#636)
Ruediger Meier [Thu, 24 May 2018 13:52:01 +0000 (15:52 +0200)] 
cfdisk: fix compiler warnings, follow-up 7085f1e4 (#636)

Seen on OSX 10.13, xcode 9.3.

 disk-utils/cfdisk.c:1860:45: error: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
         DBG(UI, ul_debug("get_size (default=%ju)", *res));
                                             ~~~    ^~~~
                                             %llu
 disk-utils/cfdisk.c:267:60: note: expanded from macro 'DBG'
 #define DBG(m, x)       __UL_DBG(cfdisk, CFDISK_DEBUG_, m, x)
                                                           ^
 ./include/debug.h:67:4: note: expanded from macro '__UL_DBG'
                         x; \
                         ^
 disk-utils/cfdisk.c:1889:25: error: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long long *') to parameter of type 'uintmax_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
                         rc = parse_size(buf, &user, &pwr);      /* parse */
                                              ^~~~~
 ./include/strutils.h:15:51: note: passing argument to parameter 'res' here
 extern int parse_size(const char *str, uintmax_t *res, int *power);
                                                   ^
 2 errors generated.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
5 years agocfdisk: use uint64_t to avoid compiler warnings
Karel Zak [Thu, 24 May 2018 07:19:28 +0000 (09:19 +0200)] 
cfdisk: use uint64_t to avoid compiler warnings

Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolslogins: fix password verification
Karel Zak [Wed, 23 May 2018 10:43:26 +0000 (12:43 +0200)] 
lslogins: fix password verification

Let's follow the standard $id$salt$encrypted password format in
verification code.

The current code is useless and for example PWD-LOCK column is always
FALSE.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1581611
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: fix notes about RAM disks
Karel Zak [Tue, 15 May 2018 08:51:15 +0000 (10:51 +0200)] 
lsblk: fix notes about RAM disks

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: don't exclude RAM disks on --all
Karel Zak [Tue, 15 May 2018 08:29:22 +0000 (10:29 +0200)] 
lsblk: don't exclude RAM disks on --all

Reported-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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 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 agoMerge branch 'rename-fix-nooverwrite-when-symlink_2.32' of https://github.com/g-raud...
Karel Zak [Mon, 9 Apr 2018 08:39:34 +0000 (10:39 +0200)] 
Merge branch 'rename-fix-nooverwrite-when-symlink_2.32' of https://github.com/g-raud/util-linux into stable/v2.32

* 'rename-fix-nooverwrite-when-symlink_2.32' of https://github.com/g-raud/util-linux:
  rename: consolidate printing the symlink in addition to its target
  rename: fix/reverse the semantics of --no-overwrite in --symlink mode

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