]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 years agobuild-sys: release++ (v2.31.1) stable/v2.31 v2.31.1
Karel Zak [Tue, 19 Dec 2017 14:06:27 +0000 (15:06 +0100)] 
build-sys: release++ (v2.31.1)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update v2.31.1-ReleaseNotes
Karel Zak [Tue, 19 Dec 2017 14:04:56 +0000 (15:04 +0100)] 
docs: update v2.31.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update AUTHORS file
Karel Zak [Tue, 19 Dec 2017 14:02:40 +0000 (15:02 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: merge changes
Karel Zak [Tue, 19 Dec 2017 14:01:31 +0000 (15:01 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 19 Dec 2017 13:40:08 +0000 (14:40 +0100)] 
po: update pl.po (from translationproject.org)

6 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Tue, 19 Dec 2017 13:40:08 +0000 (14:40 +0100)] 
po: update ja.po (from translationproject.org)

6 years agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 19 Dec 2017 13:40:08 +0000 (14:40 +0100)] 
po: update cs.po (from translationproject.org)

6 years agotests: don't use mount.<type> helpers in mount-by-pattern tests
Karel Zak [Tue, 19 Dec 2017 12:46:35 +0000 (13:46 +0100)] 
tests: don't use mount.<type> helpers in mount-by-pattern tests

The test behavior is fragile if depends on external helpers. Let's
keep it based on mount(2) only. The test will be faster too.

Note that "mount -t <pattern>" does not behaviour as expected with
helpers. We need to try another helper if the current one ends with
status=1 (waitpid()). Now it returns status from the first helper.

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofincore: fix a typo in fincore.1
Masatake YAMATO [Tue, 12 Dec 2017 07:16:45 +0000 (16:16 +0900)] 
fincore: fix a typo in fincore.1

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
6 years agotests: update libsmartcols/title
Karel Zak [Wed, 13 Dec 2017 11:57:22 +0000 (12:57 +0100)] 
tests: update libsmartcols/title

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: don't add blank padding after left aligned title
Karel Zak [Tue, 12 Dec 2017 12:19:36 +0000 (13:19 +0100)] 
libsmartcols: don't add blank padding after left aligned title

Let's use the same semantic for the title as for the last column in
the table. If aligned on left, table is not "maxout" and title padding
symbol is undefined (or blank) then keep title as short as possible.

Addresses: https://github.com/karelzak/util-linux/issues/549
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agosample-scols-title: add left title without padding
Karel Zak [Tue, 12 Dec 2017 12:16:54 +0000 (13:16 +0100)] 
sample-scols-title: add left title without padding

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agomcookie: properly initialize hash
Karel Zak [Tue, 12 Dec 2017 11:09:13 +0000 (12:09 +0100)] 
mcookie: properly initialize hash

This stupid mistake has been introduced by commit 46ae163a8e5dc8457f8e2828eb53db8e610af275.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/md5: use ul_/UL_ prefix
Karel Zak [Tue, 12 Dec 2017 10:54:08 +0000 (11:54 +0100)] 
lib/md5: use ul_/UL_ prefix

The symbols names are too generic.

Addresses: https://github.com/karelzak/util-linux/issues/548
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotest_sha1: update helper
Karel Zak [Tue, 12 Dec 2017 10:38:17 +0000 (11:38 +0100)] 
test_sha1: update helper

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/sha1: use ul_/UL_prefix for symbols
Karel Zak [Tue, 12 Dec 2017 10:29:02 +0000 (11:29 +0100)] 
lib/sha1: use ul_/UL_prefix for symbols

Unfortunately, the symbols are visible in statically compiled libuuid
and the names are too generic.

Addresses: https://github.com/karelzak/util-linux/issues/548
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: improve setarch(8) manual page
Sami Kerola [Sun, 10 Dec 2017 10:50:32 +0000 (10:50 +0000)] 
docs: improve setarch(8) manual page

Add more information when and why one might want to use various options.

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agovipw: do not let editor to inherit open file descriptors
Sami Kerola [Sun, 3 Dec 2017 12:51:14 +0000 (12:51 +0000)] 
vipw: do not let editor to inherit open file descriptors

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agoman: use long options in text and add example to uuidgen
Sami Kerola [Sun, 26 Nov 2017 17:27:21 +0000 (17:27 +0000)] 
man: use long options in text and add example to uuidgen

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agomisc: fix typos
Sami Kerola [Sun, 26 Nov 2017 17:27:20 +0000 (17:27 +0000)] 
misc: fix typos

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agonsenter: fix compiler warning [-Wuninitialized]
Karel Zak [Tue, 28 Nov 2017 09:53:35 +0000 (10:53 +0100)] 
nsenter: fix compiler warning [-Wuninitialized]

sys-utils/nsenter.c: In function ‘is_same_namespace’:
sys-utils/nsenter.c:170:2: warning: ‘b_ino’ may be used uninitialized in this function [-Wuninitialized]
sys-utils/nsenter.c:170:2: warning: ‘a_ino’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agortcwake: fix sys vs. rtc time delta usage
Karel Zak [Mon, 27 Nov 2017 11:37:53 +0000 (12:37 +0100)] 
rtcwake: fix sys vs. rtc time delta usage

srett commented:

 After some head scratching why relative wakeup using -s always works
 while -t didn't seem to work at all I discovered that the adjustment
 for time difference between sys and rtc is actually inverted when
 writing the alarm (code for -m show reading is fine), so if the RTC
 lags 10 minutes behind, the alarm will be shifted into the future by
 10 minutes, resulting in a wakeup that is 20 minutes late.

Addresses: https://github.com/karelzak/util-linux/issues/544
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agohwclock: revert ioctl test
Karel Zak [Thu, 23 Nov 2017 09:30:27 +0000 (10:30 +0100)] 
hwclock: revert ioctl test

This commit reverts 1d5cffa16a0183175684809cf215294ec20b8fd9.

(I did this revert manually as there was another changes in the code
and git-revert does not work in this case.)

Addresses: https://github.com/karelzak/util-linux/issues/543
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agotests: update columns test due to dda229c7b2b16a31fae8e99079ab4f4ae5bc8eac
Karel Zak [Wed, 22 Nov 2017 16:16:21 +0000 (17:16 +0100)] 
tests: update columns test due to dda229c7b2b16a31fae8e99079ab4f4ae5bc8eac

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agocolumn: use \x<hex> for invalid multibyte seq.
Karel Zak [Wed, 22 Nov 2017 13:43:36 +0000 (14:43 +0100)] 
column: use \x<hex> for invalid multibyte seq.

Addresses: https://github.com/karelzak/util-linux/issues/542
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/mbsalign: add mbs_invalid_encode()
Karel Zak [Wed, 22 Nov 2017 13:41:10 +0000 (14:41 +0100)] 
lib/mbsalign: add mbs_invalid_encode()

Like mbs_safe_encode(), but it does not care about control chars.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agomount: add hint about -t and root perms to the man page
Karel Zak [Wed, 22 Nov 2017 11:45:33 +0000 (12:45 +0100)] 
mount: add hint about -t and root perms to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolsblk: add hint about perms to man page
Karel Zak [Wed, 22 Nov 2017 11:31:58 +0000 (12:31 +0100)] 
lsblk: add hint about perms to man page

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: add nsfs between pseudo filesystems
Karel Zak [Tue, 21 Nov 2017 11:11:56 +0000 (12:11 +0100)] 
libmount: add nsfs between pseudo filesystems

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agohwclock: fix debug regression
J William Piggott [Sat, 18 Nov 2017 01:25:40 +0000 (20:25 -0500)] 
hwclock: fix debug regression

commit f0a0ce7 makes debug mode implicit for the --test option.

Using the previous command syntax of --test and --debug
together invokes the undocumented Level 2 debugging when
setting the RTC. This can cause many thousands of lines of
output like:
1510967983.499968 < 1510967983.500000 (-0.000032)

Fix: bump Level 2 debugging to Level 9, just before the
other undocumented Level 10. This makes it improbable for
the development debug levels to be accessed unintentionally.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
6 years agolibfdisk: (sun) enhance searching of free space
Mikhail Vorobyov [Thu, 9 Nov 2017 03:47:16 +0000 (06:47 +0300)] 
libfdisk: (sun) enhance searching of free space

Potential partition start should be aligned to cylinders. So fdisk
wouldn't consider partition's last cylinder remains as eligible space
for new partition start.

6 years agolibfdisk: (sun) move aligning of the first sector before availability check
Mikhail Vorobyov [Thu, 9 Nov 2017 03:37:28 +0000 (06:37 +0300)] 
libfdisk: (sun) move aligning of the first sector before availability check

So it will check a sector which would be actualy used as the first sector
of the partition.

6 years agomount: add more details about UUIDs and LABELs to the man page
Karel Zak [Thu, 16 Nov 2017 10:39:17 +0000 (11:39 +0100)] 
mount: add more details about UUIDs and LABELs to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoblockdev: be more explicit for BLKSSZ in blockdev.8
Karel Zak [Mon, 13 Nov 2017 11:15:17 +0000 (12:15 +0100)] 
blockdev: be more explicit for BLKSSZ in blockdev.8

Addresses: https://github.com/karelzak/util-linux/issues/535
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/timeutils: ISO_8601_BUFSIZ too small
J William Piggott [Tue, 26 Sep 2017 00:56:06 +0000 (20:56 -0400)] 
lib/timeutils: ISO_8601_BUFSIZ too small

Although iso-8601 specifies years as 4 digits, it allows
them to be wider.

The current POSIX year width is limited by 'int tm_year'
at 10 digits plus a negative sign.

That, and the possibility of nanosecond time makes the
widest POSIX iso-8601 time 41 characters. Plus the \0
string terminator yields a buffer size of 42.

Before truncated output:
/sbin/hwclock --utc --noadjfile --predict --date '-2147483765 years'
-2147481748-09-25 20:29:45.0000

Patched:
./hwclock --utc --noadjfile --predict --date '-2147483765 years'
-2147481748-09-25 20:17:21.000000-0456

./hwclock --utc --noadjfile --predict --date '-2147483766 years'
hwclock: invalid date '-2147483766 years'

Comparable to coreutils 'date' command:
date -Ins --date '-2147483765 years'
-2147481748-09-25T19:49:31,578899297-0456

date -Ins --date '-2147483766 years'
date: invalid date '-2147483766 years'

The 'date' output illustrates the full 41 character POSIX iso-8601

Signed-off-by: J William Piggott <elseifthen@gmx.com>
6 years agohwclock: add iso-8601 overflow check
J William Piggott [Mon, 25 Sep 2017 23:30:24 +0000 (19:30 -0400)] 
hwclock: add iso-8601 overflow check

hwclock wasn't testing for strtimeval_iso() truncation:

/sbin/hwclock --utc --noadjfile --predict --date '7982 years'; echo $?
9999-09-25 19:33:01.000000-0400
0

/sbin/hwclock --utc --noadjfile --predict --date '7983 years'; echo $?
10000-09-25 19:33:10.000000-
0

Patched:
./hwclock --utc --noadjfile --predict --date '7982 years'; echo $?
9999-09-25 19:22:15.000000-0400
0

./hwclock --utc --noadjfile --predict --date '7983 years'; echo $?
hwclock: iso-8601 format truncated
1

Signed-off-by: J William Piggott <elseifthen@gmx.com>
6 years agolibblkid: vfat: Fix reading labels which starts with byte 0x05
Pali Rohár [Thu, 9 Nov 2017 18:03:34 +0000 (19:03 +0100)] 
libblkid: vfat: Fix reading labels which starts with byte 0x05

When FAT directory entry has leading byte 0x05 it is interpreted as byte
0xE5. This is how FAT stores file name which starts with byte 0xE5 as
leading byte in 0xE5 in FAT directory entry means that file slot is empty.

Fixes: #533
6 years agolibmount: Allow MNT_FORCE and MNT_DETACH at umount
Joshua Watt [Mon, 6 Nov 2017 22:25:36 +0000 (16:25 -0600)] 
libmount: Allow MNT_FORCE and MNT_DETACH at umount

MNT_FORCE and MNT_DETACH are orthogonal in the Linux kernel, so both may
be specified without any problems. Even if there were a problem with
this combination, it should be up to the kernel to take the correct
action or report an error.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
6 years agomd5: declare byteReverse as static
Luca Ceresoli [Tue, 7 Nov 2017 13:39:09 +0000 (14:39 +0100)] 
md5: declare byteReverse as static

byteReverse() is an internal function in md5.c, and is not exposed via
any header file, but it is not declared as static. This is a problem
with the md5.c file since it is copied more or less verbatim in other
programs (fontconfig and pjsip among others), causing a link error
when linking two of them together.

Fixes link failures such as:
  http://autobuild.buildroot.net/results/419ab2c0e034cc68991281c51caa8271b0fadbab/build-end.log

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
6 years agortcwake: add note about HW and sleep to the man page
Karel Zak [Tue, 7 Nov 2017 13:37:03 +0000 (14:37 +0100)] 
rtcwake: add note about HW and sleep to the man page

Addresses: https://github.com/karelzak/util-linux/issues/527
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolscpu: Treat read failure on Xen Hypervisor properties as non-fatal
Dirk Mueller [Sat, 4 Nov 2017 03:12:54 +0000 (04:12 +0100)] 
lscpu: Treat read failure on Xen Hypervisor properties as non-fatal

At least on the Sydney Amazon EC2 region this file doesn't show up,
and the fatal exit code causes the rest of the useful information
to not show up.

6 years agosfdisk: create empty label on 'write' command
Karel Zak [Fri, 3 Nov 2017 18:34:49 +0000 (19:34 +0100)] 
sfdisk: create empty label on 'write' command

Addresses: https://github.com/karelzak/util-linux/issues/528
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolslocks: add note about OFDLCK
Karel Zak [Fri, 3 Nov 2017 10:20:41 +0000 (11:20 +0100)] 
lslocks: add note about OFDLCK

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: Fix uninitialized structure
Roddy Shuler [Fri, 3 Nov 2017 04:22:51 +0000 (21:22 -0700)] 
libfdisk: Fix uninitialized structure

Without this, 'sfdisk -d' with certain filenames would lead to
reading an 's' from the 'type' field in fdisk_reset_labelitem
and cause a crash due to prematurely freeing the 'data.str' field.

Signed-off-by: Roddy Shuler <roddy@endlessm.com>
6 years agotests: add fsck.cramfs bad-header test
Karel Zak [Thu, 2 Nov 2017 13:25:05 +0000 (14:25 +0100)] 
tests: add fsck.cramfs bad-header test

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofsck.cramfs: Fix bus error on broken file system.
Tobias Stoeckmann [Mon, 30 Oct 2017 12:49:53 +0000 (13:49 +0100)] 
fsck.cramfs: Fix bus error on broken file system.

The utility fsck.cramfs is prone to a bus error on file systems for
big endian systems with non-standard header sizes. While calculating
the crc32 checksum, it does not properly handle a possible offset
for bootcodes, resulting in out of boundary access of mmap'ed area.

You can trigger the issue with the following commands:

$ mkdir -p cramfs-poc/root/subdir
$ cd cramfs-poc
$ mkfs.cramfs -p -N big root cramfs
$ echo -ne \\00\\x4c | dd of=cramfs bs=1 seek=518 count=2 conv=notrunc
$ fsck.cramfs cramfs

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 years agolibfdisk: (sun) fix creation of whole disk partition
Mikhail Vorobyov [Thu, 2 Nov 2017 01:04:42 +0000 (04:04 +0300)] 
libfdisk: (sun) fix creation of whole disk partition

sun_add_partition() allowed the 1st sector to be 0 for the 3rd partition
only if that sector was free or if other partitions covered the whole
disk. Now it's always allowed for the 1st sector to be set to 0 for
the 3rd partition.

[kzak@redhat.com: - print info about "wholedisk" before "First sector" dialog for 3rd partition
                  - default to 0 for 3rd partition start sector]

Signed-off-by: Mikhail Vorobyov <m.vorobyov@cs.msu.ru>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobash-completion: Exclude /dev/fd from fsck find
Kevin Locke [Mon, 30 Oct 2017 19:50:51 +0000 (13:50 -0600)] 
bash-completion: Exclude /dev/fd from fsck find

When the bash-completion for fsck runs `find -L /dev/ -type b` it
descends into /dev/fd after opening '.' as file descriptor 3.  This
causes find to search through /dev/fd/3/ which includes everything below
the current directory, which can take a very long time.

To avoid this, prune /dev/fd in the find expression.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
6 years agodmesg: add note about -F format to the man page
Karel Zak [Mon, 30 Oct 2017 14:45:02 +0000 (15:45 +0100)] 
dmesg: add note about -F format to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoRevert "dmesg: fragment concatenation"
Karel Zak [Mon, 30 Oct 2017 14:04:20 +0000 (15:04 +0100)] 
Revert "dmesg: fragment concatenation"

* introduces regressions
* stupid code; parse_kmsg_record() called more than once for each record

This reverts commit 22eb2f0190d8a9850da750641439ccd284ac0bfe.

6 years agotests: add LUKS test images
Milan Broz [Tue, 24 Oct 2017 08:21:29 +0000 (10:21 +0200)] 
tests: add LUKS test images

Testing image contains only the first 4k sector, so it is not valid,
but for blkid it should be enough.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
6 years agoblkid: Add support for LUKS2 and new LABEL attributes.
Milan Broz [Mon, 23 Oct 2017 14:26:51 +0000 (16:26 +0200)] 
blkid: Add support for LUKS2 and new LABEL attributes.

This patch adds support for detection of a LUKS2 superblock.

LUKS2 is new version of Linux Unified Key Setup for encrypted
block devices.

LUKS2 contains a binary header and then JSON area for metadata.
Blkid should only parse the binary part, including newly available
optional LABEL and SUBSYSTEM fields.

LABEL is similar to filesystem label. The SUBSYSTEM field is
in principle, just a second label and can be used for specific udev rules
(for example if you have some 3rd party system that activates
volumes automatically, you can mark devices using this attribute).
Both labels are optional.

The magic string and UUID location are intentionally on the same offset
as LUKS v1, so even unpatched blkid now recognizes LUKS2.

Anyway, the code should not parse other versions of the header, so we now
explicitly check for header version and support only version 1 and 2.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
6 years agobuild-sys: move rfkill to /usr/sbin
Karel Zak [Fri, 20 Oct 2017 12:59:16 +0000 (14:59 +0200)] 
build-sys: move rfkill to /usr/sbin

The original implementation uses sbin, let's do it too.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: release++ (v2.31) v2.31
Karel Zak [Thu, 19 Oct 2017 11:08:49 +0000 (13:08 +0200)] 
build-sys: release++ (v2.31)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update v2.31-ReleaseNotes
Karel Zak [Thu, 19 Oct 2017 11:06:00 +0000 (13:06 +0200)] 
docs: update v2.31-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update AUTHORS file
Karel Zak [Thu, 19 Oct 2017 11:00:06 +0000 (13:00 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: merge changes
Karel Zak [Thu, 19 Oct 2017 10:57:57 +0000 (12:57 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: update sv.po (from translationproject.org)
Sebastian Rasmussen [Thu, 19 Oct 2017 10:53:09 +0000 (12:53 +0200)] 
po: update sv.po (from translationproject.org)

6 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Thu, 19 Oct 2017 10:53:09 +0000 (12:53 +0200)] 
po: update pt_BR.po (from translationproject.org)

6 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Thu, 19 Oct 2017 10:53:09 +0000 (12:53 +0200)] 
po: update pl.po (from translationproject.org)

6 years agorfkill: fix description name typo
Sami Kerola [Mon, 16 Oct 2017 18:15:44 +0000 (19:15 +0100)] 
rfkill: fix description name typo

Commit 7d2a9960ad made gps to look like a GUID Partition Table.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
6 years agoblkid: improve man page wording
Karel Zak [Mon, 16 Oct 2017 21:26:45 +0000 (23:26 +0200)] 
blkid: improve man page wording

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoblkid: more info about ambivalent results to the man page
Karel Zak [Mon, 16 Oct 2017 10:01:41 +0000 (12:01 +0200)] 
blkid: more info about ambivalent results to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoblkid: cleanup man page info about lsblk
Karel Zak [Mon, 16 Oct 2017 09:45:41 +0000 (11:45 +0200)] 
blkid: cleanup man page info about lsblk

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agozramctl: fix show all non-zero zram devices
James Sanford [Sat, 14 Oct 2017 07:57:20 +0000 (00:57 -0700)] 
zramctl: fix show all non-zero zram devices

Addresses: https://github.com/karelzak/util-linux/issues/521
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agozramctl: remove unused ZRAM_EMPTY and blank line
James Sanford [Sat, 14 Oct 2017 07:57:05 +0000 (00:57 -0700)] 
zramctl: remove unused ZRAM_EMPTY and blank line

6 years agorfkill: fix typo [coverity scan]
Karel Zak [Thu, 12 Oct 2017 12:53:32 +0000 (14:53 +0200)] 
rfkill: fix typo [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolosetup: fix bitwise vs. logical typo [coverity scan]
Karel Zak [Thu, 12 Oct 2017 12:45:11 +0000 (14:45 +0200)] 
losetup: fix bitwise vs. logical typo [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoipcs: fix memory leak [coverity scan]
Karel Zak [Thu, 12 Oct 2017 12:39:54 +0000 (14:39 +0200)] 
ipcs: fix memory leak [coverity scan]

It's not important, but let's keep static analyzes happy.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agologger: keep header generators independent on connection
Karel Zak [Thu, 12 Oct 2017 12:21:27 +0000 (14:21 +0200)] 
logger: keep header generators independent on connection

* avoid memory leaks
* don't use incomplete or header after free()

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agofincore: make sure mmap(NULL, ...) [coverity scan]
Karel Zak [Thu, 12 Oct 2017 10:44:55 +0000 (12:44 +0200)] 
fincore: make sure mmap(NULL, ...) [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: (sample) cleanup line separator usage
Karel Zak [Thu, 12 Oct 2017 10:01:25 +0000 (12:01 +0200)] 
libsmartcols: (sample) cleanup line separator usage

* add comment to explain when nolinesep flag is necessary
* force to print \n before switch to the next line to support

  ./sample-scols-continuous > file

use case.

Addresses: https://github.com/ignatenkobrain/python-smartcols/issues/18
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: (docs) add note about line separators
Karel Zak [Thu, 12 Oct 2017 09:33:49 +0000 (11:33 +0200)] 
libsmartcols: (docs) add note about line separators

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolslogins: fix possible memory leak [coverity scan]
Karel Zak [Wed, 11 Oct 2017 13:13:44 +0000 (15:13 +0200)] 
lslogins: fix possible memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibsmartcols: don't call free_buffer() for uninitialized variable [coverity scan]
Karel Zak [Wed, 11 Oct 2017 13:06:41 +0000 (15:06 +0200)] 
libsmartcols: don't call free_buffer() for uninitialized variable [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: make sure we call stat() propely [coverity scan]
Karel Zak [Wed, 11 Oct 2017 12:59:16 +0000 (14:59 +0200)] 
libmount: make sure we call stat() propely [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibfdisk: (sun) make math more robust [coverity scan]
Karel Zak [Wed, 11 Oct 2017 12:50:43 +0000 (14:50 +0200)] 
libfdisk: (sun) make math more robust [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/pager: check open() return code [coverity scan]
Karel Zak [Wed, 11 Oct 2017 12:42:49 +0000 (14:42 +0200)] 
lib/pager: check open() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolib/mbsedit: check wctomb() return code [coverity scan]
Karel Zak [Wed, 11 Oct 2017 12:40:37 +0000 (14:40 +0200)] 
lib/mbsedit: check wctomb() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agologger: allow to reconnect on initial failed connect too
Karel Zak [Wed, 11 Oct 2017 10:35:24 +0000 (12:35 +0200)] 
logger: allow to reconnect on initial failed connect too

The current code sets noact flag if unix socked connection failed. This is ugly.
We want to reconnect always in all cases (well, except --socket-error=on).

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agologger: add dummy fallback for OSX
Karel Zak [Tue, 10 Oct 2017 12:45:55 +0000 (14:45 +0200)] 
logger: add dummy fallback for OSX

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agologger: reconnect on failed send()
Karel Zak [Tue, 10 Oct 2017 11:56:30 +0000 (13:56 +0200)] 
logger: reconnect on failed send()

The libc syslog() reconnects on failed send(). We need the same thing
as logger(1) is expected as long time running tool. For example
recommended Apache configuration is:

ErrorLog "| /usr/bin/logger -t apache_error -p local6.debug"

The issue is that connection endpoint (e.g. syslogd) maybe restarted.
The simple way how to test is:

for i in $(seq 0 3600); do echo "This is message number $i"; sleep 1; done | logger --tcp --server 127.0.0.1 --port 514

and restart your syslog. The current implementation gets SIGPIPE or
write warning message, but it never reconnect.

Addresses: https://github.com/karelzak/util-linux/issues/363
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'mount-typo' of https://github.com/Liam-Ryan/util-linux
Karel Zak [Tue, 10 Oct 2017 10:52:19 +0000 (12:52 +0200)] 
Merge branch 'mount-typo' of https://github.com/Liam-Ryan/util-linux

* 'mount-typo' of https://github.com/Liam-Ryan/util-linux:
  Fixed typo in mount.8

6 years agosetsid: document fork(2) usage
Karel Zak [Tue, 10 Oct 2017 10:06:09 +0000 (12:06 +0200)] 
setsid: document fork(2) usage

Addresses: https://github.com/karelzak/util-linux/issues/518
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoFixed typo in mount.8
Liam Ryan [Mon, 9 Oct 2017 16:41:42 +0000 (17:41 +0100)] 
Fixed typo in mount.8

Signed-off-by: Liam Ryan <liamryandev@gmail.com>
6 years agoagetty: fix /etc/os-release parsing
Karel Zak [Thu, 5 Oct 2017 09:07:41 +0000 (11:07 +0200)] 
agetty: fix /etc/os-release parsing

For example /etc/os-release:

VERSION="26 (Twenty Six)"
VERSION_ID=26

agetty for \S{VERSION} returns

_ID=26

because the parser does nor check for '=' after variable name.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1498462
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: (TODO) make PMBR boot flag more user-friendly
Karel Zak [Wed, 4 Oct 2017 09:45:21 +0000 (11:45 +0200)] 
docs: (TODO) make PMBR boot flag more user-friendly

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolosetup: fix conflicting types for ‘loopcxt_set_blocksize’
Karel Zak [Wed, 4 Oct 2017 08:08:08 +0000 (10:08 +0200)] 
losetup: fix conflicting types for ‘loopcxt_set_blocksize’

Reported-by: Lars Wendler <polynomial-c@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agobuild-sys: release++ (v2.31-rc2) v2.31-rc2
Karel Zak [Tue, 3 Oct 2017 15:53:33 +0000 (17:53 +0200)] 
build-sys: release++ (v2.31-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update v2.31-ReleaseNotes
Karel Zak [Tue, 3 Oct 2017 15:51:55 +0000 (17:51 +0200)] 
docs: update v2.31-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: update AUTHORS file
Karel Zak [Tue, 3 Oct 2017 15:49:32 +0000 (17:49 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agopo: merge changes
Karel Zak [Tue, 3 Oct 2017 15:48:43 +0000 (17:48 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorfkill: support old "list" output
Karel Zak [Tue, 3 Oct 2017 13:35:17 +0000 (15:35 +0200)] 
rfkill: support old "list" output

.. just because we want to be replacement for the original version.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorfkill: remove duplicate code
Karel Zak [Tue, 3 Oct 2017 12:31:57 +0000 (14:31 +0200)] 
rfkill: remove duplicate code

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorfkill: refactor actions
Karel Zak [Tue, 3 Oct 2017 11:44:19 +0000 (13:44 +0200)] 
rfkill: refactor actions

* convert action string to ID and use switch()
* add note about default output to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agorfkill: improve default output
Karel Zak [Tue, 3 Oct 2017 11:01:56 +0000 (13:01 +0200)] 
rfkill: improve default output

Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agodocs: add Atari PT to the TODO list
Karel Zak [Mon, 2 Oct 2017 13:45:41 +0000 (15:45 +0200)] 
docs: add Atari PT to the TODO list

Addresses: https://github.com/karelzak/util-linux/issues/517
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agolibmount: add human compatible message for EBADMSG errno
Karel Zak [Mon, 2 Oct 2017 11:44:29 +0000 (13:44 +0200)] 
libmount: add human compatible message for EBADMSG errno

 mount: /media/sdb5: mount(2) system call failed: Bad message.

is really ugly for end users. It seems XFS, extN (etc) use EBADMSG for
bad checksums. For network or pseudo filesystems continue to use "Bad
message" error...

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1496764
Signed-off-by: Karel Zak <kzak@redhat.com>
6 years agoMerge branch 'fix-python_libmount_get_propagation' of https://github.com/giuseppe...
Karel Zak [Mon, 2 Oct 2017 10:44:24 +0000 (12:44 +0200)] 
Merge branch 'fix-python_libmount_get_propagation' of https://github.com/giuseppe/util-linux

* 'fix-python_libmount_get_propagation' of https://github.com/giuseppe/util-linux:
  libmount: fix Python get_propagation

6 years agoMerge branch 'patch-1' of https://github.com/sgargel/util-linux
Karel Zak [Mon, 2 Oct 2017 10:20:36 +0000 (12:20 +0200)] 
Merge branch 'patch-1' of https://github.com/sgargel/util-linux

* 'patch-1' of https://github.com/sgargel/util-linux:
  Fix end translation