Changes between v2.34-rc1 and v2.34-rc2 -------------------------------------------- commit 4de60aecad837c857d8971b0b35088a42da9e59e Author: Karel Zak Date: Thu May 30 12:06:50 2019 +0200 build-sys: release++ (v2.34-rc2) Signed-off-by: Karel Zak NEWS | 8 ++++++-- configure.ac | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) commit f26ed90583e9b2b7f46ac87043d7845b4646560a Author: Karel Zak Date: Thu May 30 12:01:36 2019 +0200 docs: update v2.34-ReleaseNotes Signed-off-by: Karel Zak Documentation/releases/v2.34-ReleaseNotes | 133 ++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) commit 0731ab54981a3a6dc1068f5e20f89087d87fdb55 Author: Karel Zak Date: Thu May 30 11:58:26 2019 +0200 docs: update AUTHORS file Signed-off-by: Karel Zak AUTHORS | 3 +++ 1 file changed, 3 insertions(+) commit c7033bbb12c311b7cbf3242981ab291c067ca351 Author: Karel Zak Date: Thu May 30 11:54:20 2019 +0200 po: merge changes Signed-off-by: Karel Zak po/ca.po | 1852 +++++++++++------------ po/cs.po | 1848 +++++++++++------------ po/da.po | 1848 +++++++++++------------ po/de.po | 1848 +++++++++++------------ po/es.po | 1848 +++++++++++------------ po/et.po | 1853 +++++++++++------------ po/eu.po | 1853 +++++++++++------------ po/fi.po | 1848 +++++++++++------------ po/fr.po | 1848 +++++++++++------------ po/gl.po | 1851 +++++++++++------------ po/hr.po | 4269 +++++++++++++++++++++++++++++------------------------ po/hu.po | 1852 +++++++++++------------ po/id.po | 1852 +++++++++++------------ po/it.po | 1852 +++++++++++------------ po/ja.po | 1848 +++++++++++------------ po/nl.po | 1848 +++++++++++------------ po/pl.po | 1848 +++++++++++------------ po/pt_BR.po | 1848 +++++++++++------------ po/ru.po | 1848 +++++++++++------------ po/sl.po | 1852 +++++++++++------------ po/sv.po | 1848 +++++++++++------------ po/tr.po | 1848 +++++++++++------------ po/uk.po | 1848 +++++++++++------------ po/util-linux.pot | 1840 +++++++++++------------ po/vi.po | 1848 +++++++++++------------ po/zh_CN.po | 1848 +++++++++++------------ po/zh_TW.po | 1852 +++++++++++------------ 27 files changed, 26617 insertions(+), 25729 deletions(-) commit 18c630a27e53c55f1b8e77c974c8087e9c2832a9 Author: Božidar Putanec Date: Thu May 30 11:49:43 2019 +0200 po: update hr.po (from translationproject.org) po/hr.po | 5656 ++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 2715 insertions(+), 2941 deletions(-) commit 9db442e95482a8a2fe1006d49f6010bf8f7ac35b Author: Karel Zak Date: Wed May 29 18:01:04 2019 +0200 libmount: add selinuxfs between pseudo filesystems Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1714826 Signed-off-by: Karel Zak libmount/src/utils.c | 1 + 1 file changed, 1 insertion(+) commit 0e36d7c2711ed9f7a1f2479d798e83769d07cbb3 Author: Karel Zak Date: Wed May 29 18:01:04 2019 +0200 libmount: add bpf between pseudo filesystems Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1714826 Signed-off-by: Karel Zak libmount/src/utils.c | 1 + 1 file changed, 1 insertion(+) commit 21d93094d4c6c7fcecb54ccb612c84e1392239d9 Author: Karel Zak Date: Wed May 29 17:59:33 2019 +0200 findmnt: fix filters use on --list Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1714826 Signed-off-by: Karel Zak misc-utils/findmnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bb272bb85e0ad28fefa1407165d3f11f0946d510 Author: Karel Zak Date: Wed May 29 13:22:01 2019 +0200 tests: add asan build-sys test Signed-off-by: Karel Zak tests/expected/build-sys/config-devel-non-asan | 120 +++++++++++++++++++++++++ 1 file changed, 120 insertions(+) commit b0eca21a5c97437be6f3fdc3521397a7f88959b5 Author: Karel Zak Date: Tue May 28 15:12:31 2019 +0200 fdisk: add note about -S and -H It's seems people still follow old advices for SSD/4K devices. Let's make CHS deprecation more visible at the begin of the man page... Signed-off-by: Karel Zak disk-utils/fdisk.8 | 4 ++++ 1 file changed, 4 insertions(+) commit b8b7f4745cb971030700095262b05b278def9a20 Author: Karel Zak Date: Tue May 28 13:33:03 2019 +0200 ul: make sure buffers are zeroized [coverity scan] text-utils/ul.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit dd45b90eeff6fa782061beab9717517e00a6f828 Author: Karel Zak Date: Tue May 28 13:25:15 2019 +0200 column: make code more robust [coverity scan] Signed-off-by: Karel Zak text-utils/column.c | 3 +++ 1 file changed, 3 insertions(+) commit da14a74df9eeb64d6168e7d13412ac1519c39717 Author: Karel Zak Date: Tue May 28 13:11:14 2019 +0200 setpriv: fix memory leak in local scope [coverity scan] Signed-off-by: Karel Zak sys-utils/setpriv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit cf5debba0653688a788ed793361a4d2e4f935b2f Author: Karel Zak Date: Tue May 28 13:08:21 2019 +0200 setarch: avoid NULL dereference [coverity check] Signed-off-by: Karel Zak sys-utils/setarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d3149a855680d59f0703eb8d3af651c33aa19c37 Author: Karel Zak Date: Tue May 28 12:53:58 2019 +0200 rtcwake: terminate mode and excl[] * terminate string read from /proc * terminate array for exclusive options Signed-off-by: Karel Zak sys-utils/rtcwake.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 5348fa7d889a61e0d966043171bf7a489daaaae9 Author: Karel Zak Date: Tue May 28 12:37:14 2019 +0200 build-sys: add info about ASAN Signed-off-by: Karel Zak configure.ac | 1 + 1 file changed, 1 insertion(+) commit 9f74aa07d4d09ba45cce3fea36e9447a3e96ae8c Author: Karel Zak Date: Tue May 28 12:19:23 2019 +0200 renice: make code more readable for static analyzer [coverity scan] It seems coverity and clag have no clue about relation between argv[] and argc. Let's make code more readable for them... Signed-off-by: Karel Zak sys-utils/renice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 517debc389414cce263ab1dbbb5a9df02a76a464 Author: Karel Zak Date: Tue May 28 12:17:26 2019 +0200 readprofile: be more explicit with used types [cppcheck] Signed-off-by: Karel Zak sys-utils/readprofile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a0661407136ec393ebc9b0ae50bb161ee72fc2a7 Author: Karel Zak Date: Tue May 28 12:05:03 2019 +0200 lscpu: check scols_line_set_data() return value [coverity scan] Signed-off-by: Karel Zak sys-utils/lscpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit fe2e38f3b15f397aa1edc768237e9408c8a688f9 Author: Karel Zak Date: Tue May 28 11:58:51 2019 +0200 lscpu: make lookup() use more consistent [coverity scan] We usually check lookup() return value. Let's do it in this case too. It seems static analyzers will be happy with consistent code. Signed-off-by: Karel Zak sys-utils/lscpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 2c864ba8fcf50246920d09feaa2b02f3a3dfd52c Author: Karel Zak Date: Mon May 27 13:07:12 2019 +0200 mesg: avoid 'ttyname failed: Success' message The ttyname(3) can fail to access /dev/ path, and that will cause function to fail without setting errno value with result of rather confusing error message. Lets start setting stdin permission via /proc when this happens as a go-around, with hope kernel following symlink does not fail. Ok, noted, that hopes of symlink follow working are pretty slim. Based on patch from Sami Kerola . Reference: https://github.com/lxc/lxd/issues/1724 Signed-off-by: Karel Zak term-utils/Makemodule.am | 1 + term-utils/mesg.1 | 4 ++-- term-utils/mesg.c | 17 ++++++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) commit a6d9d23b5f9e3c1d421c1f32a3f1dffe8452cb74 Author: Karel Zak Date: Mon May 27 12:49:12 2019 +0200 lib/ttyutils: introduce get_terminal_stdfd() Let's use separate function to detect what is the current terminal. Signed-off-by: Karel Zak include/pathnames.h | 2 ++ include/ttyutils.h | 1 + lib/ttyutils.c | 27 ++++++++++++++++++--------- 3 files changed, 21 insertions(+), 9 deletions(-) commit ebd13d3fc53189ab620da51eae2dfc6b19db786c Author: Sami Kerola Date: Thu May 23 21:06:23 2019 +0100 libblkid: remove unneeded fields from struct bcache_super_block This started as fix to following warning. libblkid/src/superblocks/bcache.c:33:3: warning: ISO C99 doesn’t support unnamed structs/unions [-Wc99-c11-compat] But when sent to review Karel told out rather than getting rid of warnings lets get rid of everything unnecessary. [kzak@redhat.com: - use original struct member names rather than 'padN'] Reference: https://github.com/karelzak/util-linux/pull/802 Signed-off-by: Sami Kerola Signed-off-by: Karel Zak libblkid/src/superblocks/bcache.c | 53 ++++++--------------------------------- 1 file changed, 7 insertions(+), 46 deletions(-) commit 9c6167c394bf5a7c374a6bd626478e1079facebe Author: Karel Zak Date: Thu May 23 20:27:37 2019 +0100 login: retire use of __FUNCTION__ macro This fixes following warning about deprecatd __FUNCTION__ that is another name for __func__ since GCC (pre 2.95, released July 1999). login-utils/login.c:860:10: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic] Co-Author: Sami Kerola Reference: https://c0x.coding-guidelines.com/6.4.2.2.html Reference: https://github.com/karelzak/util-linux/pull/802 Signed-off-by: Sami Kerola Signed-off-by: Karel Zak login-utils/login.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit e4c6816cc34dd611ccbe0633aa222bd6dbae2572 Author: Karel Zak Date: Thu May 23 15:32:59 2019 +0200 ipcs: check return value when read from /proc [coverity scan] Signed-off-by: Karel Zak sys-utils/ipcutils.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 226fdcf06908660ad63682326c76ad419800a900 Author: Karel Zak Date: Thu May 23 15:28:07 2019 +0200 hwclock: don't use uninitialized value [coverity scan] Signed-off-by: Karel Zak sys-utils/hwclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit edf9c218c1d8e1c5068dfe82c3fc723a51099510 Author: Karel Zak Date: Thu May 23 15:17:16 2019 +0200 fallocate: make posix_fadvise() use more readable for analyzers Signed-off-by: Karel Zak sys-utils/fallocate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 2d278988442d3f4ac43cd0eb441fc92aa570dc05 Author: Karel Zak Date: Thu May 23 14:18:29 2019 +0200 dmesg: make strtok() use more robust Signed-off-by: Karel Zak sys-utils/dmesg.c | 3 +++ 1 file changed, 3 insertions(+) commit 106bd306a4b4948adef1ffe47898170bbb3ac38f Author: Karel Zak Date: Thu May 23 13:57:35 2019 +0200 blkzone: remove never read value Signed-off-by: Karel Zak sys-utils/blkzone.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit a2761af42be7a8a9e611e3188e58b6340c822282 Author: Karel Zak Date: Thu May 23 13:53:00 2019 +0200 whereis: make subdirs scan more robust * call strchr() only once * avoid things like strcat(buf, strchr(dir, '*') + 1) * make it more readable * improve debug messages Signed-off-by: Karel Zak misc-utils/whereis.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) commit 106e6960649b4b9ddc2b5dd156c19272169899d6 Author: Karel Zak Date: Thu May 23 12:36:53 2019 +0200 lsblk: make sure __process_one_device() has proper arguments [coverity scan] Signed-off-by: Karel Zak misc-utils/lsblk.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 74152bf944837cb095c46fb4d3757086a0b94f64 Author: Karel Zak Date: Thu May 23 12:31:49 2019 +0200 lsblk: check ul_path_scanf() return value [coverity scan] Signed-off-by: Karel Zak misc-utils/lsblk.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 404eef654af165df90fe4e82ae74021711ae8c1f Author: Karel Zak Date: Thu May 23 12:28:13 2019 +0200 lsblk: check stat() return code [coverity scan] Signed-off-by: Karel Zak misc-utils/lsblk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 7241dda191aa876c48ad5ee4ac58dd126c7b558d Author: Karel Zak Date: Thu May 23 12:14:10 2019 +0200 logger: make code more robust for static analyzer [clang scan] Signed-off-by: Karel Zak misc-utils/logger.c | 2 ++ 1 file changed, 2 insertions(+) commit ac255c2b14dbf71eb61258fb9cf1a6683e470b3f Author: Karel Zak Date: Thu May 23 12:12:07 2019 +0200 hardlink: avoid uninitialized variables [clang scan] Signed-off-by: Karel Zak misc-utils/hardlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 620851e0cc297c2caadf9d4480028e181d8963ee Author: Sami Kerola Date: Wed May 22 19:45:54 2019 +0100 libfdisk: assert if self_pte() returns NULL The self_pte() can return NULL if partitions array is not large enough, but that should also be impossible and definitely a bug. libfdisk/src/dos.c:984:8: warning: potential null pointer dereference [-Wnull-dereference] libfdisk/src/dos.c:1031:8: warning: potential null pointer dereference [-Wnull-dereference] Signed-off-by: Sami Kerola libfdisk/src/dos.c | 4 ++++ 1 file changed, 4 insertions(+) commit 04d0701ea8d031c1392aaa77b0faf03f99d1c7a0 Author: Karel Zak Date: Wed May 22 17:42:48 2019 +0200 libfdisk: (bsd) improve checksum calculation [-Waddress-of-packed-member] Let's keep compilers and static analyzers happy. The idea is to use memcpy() to copy from buffer to variable and use all label as unsigned char rather than vectorize by unsigned short. Signed-off-by: Karel Zak libfdisk/src/bsd.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) commit 16d7868fc1c6955fbcd5a825caad496c39ac3014 Author: Karel Zak Date: Wed May 22 17:42:48 2019 +0200 libblkid: (silicon raid) improve checksum calculation [-Waddress-of-packed-member] Let's keep compilers and static analyzers happy. The idea is to use memcpy() to copy from buffer to variable and use all label as unsigned char rather than vectorize by uint16_t. Signed-off-by: Karel Zak libblkid/src/superblocks/silicon_raid.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) commit 1a56f15b0fe047dfd85fa1a7aaddcc8504e403a6 Author: Karel Zak Date: Wed May 22 17:42:48 2019 +0200 libfdisk: (sgi) improve checksum calculation [-Waddress-of-packed-member] Let's keep compilers and static analyzers happy. The idea is to use memcpy() to copy from buffer to variable and use all label as unsigned char rather than vectorize by uint32_t. Signed-off-by: Karel Zak include/pt-sgi.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) commit 34b0a305f6a86b18ce7c4ca2f9fc71dc89d6e1d4 Author: Karel Zak Date: Tue May 21 16:27:17 2019 +0200 include/c: use __has_attribute The __has macros are more portable (supported by gcc as well as clang). The old __GNUC_PREREQ is deprecated and it should be removed in future. (Well, the __has macros are supported since gcc 5, so we should be patient as some old stable distros (e.g. RHEL 7) use gcc 4.x). This patch helps clang to correctly analyze our xalloc.h stuff. Signed-off-by: Karel Zak include/c.h | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) commit 2e56aa3c3b11bcf83fa36927da40eb6e901de1ff Author: Sami Kerola Date: Mon May 20 19:56:19 2019 +0100 bash-completion: add hardlink completion Signed-off-by: Sami Kerola bash-completion/hardlink | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) commit ba5e7b7e52831ea1846166b2d37333d3da2a1b99 Author: Sami Kerola Date: Mon May 20 19:34:10 2019 +0100 bash-completion: update options before release blkid: 5e91d5dd716ebc6144bcb0cabb0ec847a678be9e --no-part-details lsblk: dc4662f0e755929de9cbe98b1b343b492fd620f4 --dedup lsblk: 0bd05f5ee4876ffd13c98acd56c2bff9971f28f1 --merge lscpu: 0e86bc8406959d0d56194d4f404b780e6b70caa4 --caches lscpu: 2011528bce58dd31d5ee0287f2367da1f2d6cfa9 --bytes Signed-off-by: Sami Kerola bash-completion/blkid | 1 + bash-completion/lsblk | 4 +++- bash-completion/lscpu | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) commit 8ecc6ba8079dc7837560182b543cd542c0296cde Author: Karel Zak Date: Mon May 20 13:03:58 2019 +0200 lib/ismounted: use xstrncpy() Signed-off-by: Karel Zak lib/ismounted.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 380fe6ac46a7e05f62f90cf146e1c65aa2d0b80f Author: Karel Zak Date: Mon May 20 12:59:40 2019 +0200 zramctl: use xstrncpy() Signed-off-by: Karel Zak sys-utils/zramctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit aa75c5eb74694ba9ee7f84540943b287fb15a49f Author: Karel Zak Date: Mon May 20 12:59:02 2019 +0200 whereis: use xstrncpy() Signed-off-by: Karel Zak misc-utils/whereis.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 124a903002b5a42e822509e9f6a9f05696113192 Author: Karel Zak Date: Mon May 20 12:57:39 2019 +0200 vipw: use xstrncpy() It's already used by vipw, so use it everywhere. Signed-off-by: Karel Zak login-utils/vipw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit e2569bcf2684c6001de5349000bbaccd6f269f8f Author: Karel Zak Date: Mon May 20 12:57:16 2019 +0200 lib/path: use xstrncpy() Signed-off-by: Karel Zak lib/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 94d9fd9f6ad45b736c8325de30f511af9f46c2a7 Author: Karel Zak Date: Mon May 20 12:57:07 2019 +0200 lib/sysfs: use xstrncpy() Signed-off-by: Karel Zak lib/sysfs.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) commit 91072cd480244fbb531a6c000f7eff1fdf8b7cdf Author: Karel Zak Date: Mon May 20 12:46:39 2019 +0200 losetup: use xstrncpy() Signed-off-by: Karel Zak lib/loopdev.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 9f34182d5398e94c1d730d0bd6265966d1f0607e Author: Karel Zak Date: Mon May 20 12:42:43 2019 +0200 sfdisk: use xstrcpy() Signed-off-by: Karel Zak disk-utils/sfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9d6852d3a23f2c9f40ca74a07f19aef819ccf6fb Author: Karel Zak Date: Mon May 20 12:41:12 2019 +0200 lib/colors: remove unnecessary goto Signed-off-by: Karel Zak lib/colors.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 002931c485dd66c23b63750a7d9d09637e9bc1ef Merge: fbae15802 cc7ffe129 Author: Karel Zak Date: Mon May 20 12:35:38 2019 +0200 Merge branch '2019wk19' of https://github.com/kerolasa/util-linux * '2019wk19' of https://github.com/kerolasa/util-linux: lib/colors: remove redundant if statement wipefs: fix variable / function shadowing [cppcheck] sulogin: fix variable / function shadowing [cppcheck] lscpu: remove redundant condition check [cppcheck] libmount: avoid possible null pointer dereference [cppcheck] lib/mangle: fix possible null pointer dereference [cppcheck] sfdisk: remove unnecessary size check [cppcheck] commit fbae15802e621c6951107070967c8ec17ef5d4fd Merge: 353931a2c 8d124f0fc Author: Karel Zak Date: Mon May 20 12:35:09 2019 +0200 Merge branch 'lscpu_midr_updates' of https://github.com/jlinton/util-linux * 'lscpu_midr_updates' of https://github.com/jlinton/util-linux: lscpu: Add additional aarch64 models commit 353931a2c18737f1066266ca0b7f83cd04cae2a1 Merge: 778e2b2b7 23df05103 Author: Karel Zak Date: Mon May 20 12:34:45 2019 +0200 Merge branch 'lscpu-another' of https://github.com/kerolasa/util-linux * 'lscpu-another' of https://github.com/kerolasa/util-linux: lscpu: fix floating point exception include/strutils: fix potential null pointer dereference lscpu: remove extra space from field key name commit cc7ffe129d7c01eb3d4bf650e70b6befef6e1e19 Author: Sami Kerola Date: Sat May 18 22:56:15 2019 +0100 lib/colors: remove redundant if statement Signed-off-by: Sami Kerola lib/colors.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 9abc8a42aa28dac93dba2734a532d71a7bef3521 Author: Sami Kerola Date: Sat May 18 22:39:58 2019 +0100 wipefs: fix variable / function shadowing [cppcheck] [misc-utils/wipefs.c:636] -> [misc-utils/wipefs.c:310]: (style) Local variable usage shadows outer function Signed-off-by: Sami Kerola misc-utils/wipefs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit ff09a5129af18e9d26ffe6dae90f2380d9a0f771 Author: Sami Kerola Date: Sat May 18 22:36:44 2019 +0100 sulogin: fix variable / function shadowing [cppcheck] [login-utils/sulogin.c:398] -> [login-utils/sulogin.c:171]: (style) Local variable set shadows outer function [login-utils/sulogin.c:398] -> [login-utils/sulogin.c:830]: (style) Local variable set shadows outer function Signed-off-by: Sami Kerola login-utils/sulogin.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 6dd7b74b3ba1a9cea30f6406dce1f5108ec10f93 Author: Sami Kerola Date: Sat May 18 22:25:11 2019 +0100 lscpu: remove redundant condition check [cppcheck] [sys-utils/lscpu.c:1783] -> [sys-utils/lscpu.c:1785]: (warning) Either the condition 'desc' is redundant or there is possible null pointer dereference: desc. [sys-utils/lscpu.c:1840] -> [sys-utils/lscpu.c:1842]: (warning) Either the condition 'desc' is redundant or there is possible null pointer dereference: desc. Signed-off-by: Sami Kerola sys-utils/lscpu.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) commit cbcedf6ba83b0929ad21e227db62883886d2ccce Author: Sami Kerola Date: Sat May 18 22:14:20 2019 +0100 libmount: avoid possible null pointer dereference [cppcheck] [libmount/src/monitor.c:797]: (warning) Possible null pointer dereference: me Signed-off-by: Sami Kerola libmount/src/monitor.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 4f807791eee8ead3f38f1dce76f748fa0773f9a6 Author: Sami Kerola Date: Sat May 18 22:09:25 2019 +0100 lib/mangle: fix possible null pointer dereference [cppcheck] Fix effects code that is used when testing util-linux, so quite low impact. Signed-off-by: Sami Kerola lib/mangle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 84f46d1f6725980697e5a442b06ececd9ceb6576 Author: Sami Kerola Date: Sat May 18 21:46:08 2019 +0100 sfdisk: remove unnecessary size check [cppcheck] Following warning is false positive. Size of the buffer is defined using BUFSIZ, and so the strncpy() will never overwrite the last byte that is initialized to zero in get_user_reply(). [disk-utils/sfdisk.c:137] -> [disk-utils/sfdisk.c:136]: (warning) Either the condition 'bufsz!=0' is redundant or strncpy() argument nr 3 can have invalid value. The value is -1 but the valid values are '0:'. Signed-off-by: Sami Kerola disk-utils/sfdisk.c | 2 -- 1 file changed, 2 deletions(-) commit 23df051030add5f755633fc7a88ea66404f26adf Author: Sami Kerola Date: Sat May 18 18:43:08 2019 +0100 lscpu: fix floating point exception As the title tells this change indeed fixes floating point exception, but post processing as value overwrite feels a wrong. Possibly something in input is making cpu set count to go wrong, but I could not get my head around what could it be. Anyway avoiding division by zero seems better than crashing so lets do this atleast for now. Caused-by: e5f721132ec8b8c933a396d8dcb3efcb67854f13 Addresses: https://github.com/karelzak/util-linux/issues/788 Reported-by: Lars Wendler Signed-off-by: Sami Kerola sys-utils/lscpu.c | 2 + tests/expected/lscpu/lscpu-vmware_fpe | 76 +++++++++++++++++++++++++++++++++ tests/ts/lscpu/dumps/vmware_fpe.tar.gz | Bin 0 -> 59743 bytes 3 files changed, 78 insertions(+) commit d2a1ee4e56182ba746053c6d41b6f29a2ce5554b Author: Sami Kerola Date: Thu May 16 21:56:57 2019 +0100 include/strutils: fix potential null pointer dereference Recent lscpu fix caused gcc -Wnull-dereference to go off that this change addresses. Reference: b94acada9ed0e11a7e82f8f60280c5b6058e4250 Signed-off-by: Sami Kerola include/strutils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 30d5ceeda8266a9b9d8ab58a2f128352d6aa4fe0 Author: Sami Kerola Date: Thu May 16 21:51:47 2019 +0100 lscpu: remove extra space from field key name The extra space was more obvious in json output. But as the expected test output displays also the standard output can be effected by this change. $ lscpu --json | jq '.lscpu | .[].field' | grep ': ' "L1d cache: " "L1i cache: " "L2 cache: " "L3 cache: " "Vulnerability L1tf: " "Vulnerability Mds: " "Vulnerability Meltdown: " "Vulnerability Spec store bypass: " "Vulnerability Spectre v1: " "Vulnerability Spectre v2: " Signed-off-by: Sami Kerola sys-utils/lscpu.c | 6 +-- tests/expected/lscpu/lscpu-x86_64-epyc_7451 | 74 ++++++++++++++--------------- 2 files changed, 40 insertions(+), 40 deletions(-) commit 8d124f0fc7c7acfec717935994bb877606d916ba Author: Jeremy Linton Date: Thu May 16 12:10:17 2019 -0500 lscpu: Add additional aarch64 models ARM has released docs for Cortex-A76, Neoverse-N1 and Neoverse-E1. That means we know the midr partnums, so we can add them to the human readable model name table. Signed-off-by: Jeremy Linton sys-utils/lscpu-arm.c | 3 +++ 1 file changed, 3 insertions(+) commit 778e2b2b7faeb8569e33408c3b4703adc8acb1d8 Author: Karel Zak Date: Thu May 16 14:38:12 2019 +0200 findmnt: keep it easy for static analyzers misc-utils/findmnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 097c067f5c93e00b110a7ce345fbd5446b055fe8 Author: Karel Zak Date: Thu May 16 14:33:47 2019 +0200 findmnt: (verify) check mnt_table_next_fs() return code [coverity scan] Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 374cb543815da96fb38484894f851693fa4a3a24 Author: Karel Zak Date: Thu May 16 14:27:15 2019 +0200 fincore: remove unused variable [clang scan] Signed-off-by: Karel Zak misc-utils/fincore.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit f06d8b69a95ec84b5a50fd705a7588b1fe3c2527 Author: Karel Zak Date: Thu May 16 14:20:32 2019 +0200 cal: make sure months_in_row makes sense [coverity scan] * avoid divide by zero in mountly() dues to wrong months_in_row * make sure months_in_row is at least 1 Signed-off-by: Karel Zak misc-utils/cal.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) commit fa1b64da96d83e0da1000725f237127a18f01450 Author: Karel Zak Date: Thu May 16 13:56:34 2019 +0200 blkid: improve strcpy() usage [coverity scan] The old deprecated list output format ("-o list") copies gettex string into fixed buffer, that's really bad idea. Signed-off-by: Karel Zak misc-utils/blkid.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit e868cfb0a6c2b942029b95c85168f7da116d5c06 Author: Karel Zak Date: Thu May 16 13:46:03 2019 +0200 utmpdump: check ftello() return value Signed-off-by: Karel Zak login-utils/utmpdump.c | 3 +++ 1 file changed, 3 insertions(+) commit 4ac2ab97d18fc53b169d492168cc455d55887038 Merge: e2a0f2634 b94acada9 Author: Karel Zak Date: Thu May 16 13:31:30 2019 +0200 Merge branch 'lscpu-output-fix' of https://github.com/kerolasa/util-linux * 'lscpu-output-fix' of https://github.com/kerolasa/util-linux: lscpu: move trailing null after removing characters from a string commit b94acada9ed0e11a7e82f8f60280c5b6058e4250 Author: Sami Kerola Date: Thu May 16 11:44:38 2019 +0100 lscpu: move trailing null after removing characters from a string From the test input string ':' characters are removed: cat x86_64-epyc_7451/sys/devices/system/cpu/vulnerabilities/spectre_v2 Mitigation: Full AMD retpoline, IBPB: conditional, STIBP: disabled, RSB filling Signed-off-by: Sami Kerola include/strutils.h | 1 + tests/expected/lscpu/lscpu-x86_64-epyc_7451 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) commit e2a0f2634151c36e7dd229db31ee54933bcf28d1 Author: Karel Zak Date: Wed May 15 17:46:31 2019 +0200 libsmartcols: (groups) improve scols_table_group_lines() args check [coverity scan] Signed-off-by: Karel Zak libsmartcols/src/grouping.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit cb400752a4114c0c904c20253ed5ee68c11dc326 Author: Karel Zak Date: Wed May 15 17:25:04 2019 +0200 libmount: fix memory leak on error [coverity scan] Signed-off-by: Karel Zak libmount/src/context_umount.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit f11eedf527c42de3fe37ba02fe580aa9bde1e27d Author: Karel Zak Date: Wed May 15 17:12:38 2019 +0200 libfdisk: avoid memory leak [coverity scan] Signed-off-by: Karel Zak libfdisk/src/partition.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 845fd622ed0f7bff383700cf777cee7fef486de5 Author: Karel Zak Date: Wed May 15 17:10:38 2019 +0200 libfdisk: avoid division by zero [clang scan] Signed-off-by: Karel Zak libfdisk/src/gpt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 1d161441c28c29534a10d16a88008236ada91bec Author: Karel Zak Date: Wed May 15 16:59:52 2019 +0200 libfdisk: remove unused code [clang scan] Signed-off-by: Karel Zak libfdisk/src/dos.c | 1 - 1 file changed, 1 deletion(-) commit 7f3a98229bdaade954ed51e3c42ff41141b57f80 Author: Karel Zak Date: Wed May 15 16:49:26 2019 +0200 libfdisk: properly check return code of add_to_partitions_array() [coverity scan] Signed-off-by: Karel Zak libfdisk/src/context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 5b3b21128c5373c03d7712cb3b26b4f11717dc47 Author: Karel Zak Date: Wed May 15 16:28:31 2019 +0200 libblkid: make partitions reference counting more robust [coverity scan] Signed-off-by: Karel Zak libblkid/src/partitions/partitions.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 488b3a69dfcac3013cb0819d509236f45fd2069e Author: Karel Zak Date: Wed May 15 16:24:51 2019 +0200 libblkid: don't ignore blkid_probe_set_magic() errors [coverity scan] Signed-off-by: Karel Zak libblkid/src/partitions/atari.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 709beed937b227bb39999b3828fdfc1bacddfe4d Author: Karel Zak Date: Wed May 15 16:15:15 2019 +0200 libblkid: fix possible uninitialized value use [coverity scan] Signed-off-by: Karel Zak libblkid/src/devname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6d92f7d7bf3da6b3230a1a252df55f962b5f1361 Author: Karel Zak Date: Wed May 15 16:09:16 2019 +0200 lib/strutils: keep static analyzer happy [coverity scan] Signed-off-by: Karel Zak lib/strutils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 91bf5817426c34ea3a3f37b291b6b1ba7fe4eb52 Author: Karel Zak Date: Wed May 15 16:01:32 2019 +0200 lib/path: fix resource leak [coverity scan] Signed-off-by: Karel Zak lib/path.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 8083862536df0635a66e147031e2061ddf4ac098 Author: Karel Zak Date: Wed May 15 15:57:09 2019 +0200 lib/path: fix possible NULL dereferencing [coverity scan] Signed-off-by: Karel Zak lib/path.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 8e2815132911e20921db11767832c64ee5c5e3b1 Author: Karel Zak Date: Wed May 15 15:52:54 2019 +0200 lib/path: fix ul_path_get_dirfd() usage [coverity scan] ul_path_get_dirfd() returns negative number on error... Signed-off-by: Karel Zak lib/path.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 2c417af196f5e532c32e73de0ec98d0aa9d28b26 Author: Karel Zak Date: Wed May 15 15:47:29 2019 +0200 lib/path: consolidate ul_path_mkpath() usage * always use errno from ul_path_mkpath() * keep code simple and short as possible Signed-off-by: Karel Zak lib/path.c | 102 +++++++++++++++++-------------------------------------------- 1 file changed, 28 insertions(+), 74 deletions(-) commit b24650294d707b95379a2d368d62a6addbda25f4 Author: Karel Zak Date: Wed May 15 15:36:49 2019 +0200 lib/path: fix possible NULL pointer dereferencing [coverity scan] Signed-off-by: Karel Zak lib/path.c | 3 +++ 1 file changed, 3 insertions(+) commit 4b4a780539c8a98fcbc31992840834f3e2b90435 Author: Austin English Date: Mon May 13 13:53:19 2019 -0500 column: fix "maybe be" duplication Signed-off-by: Austin English text-utils/column.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4669934b18e8eb541f0c3df50ad70b84d6eee602 Author: Austin English Date: Mon May 13 13:53:18 2019 -0500 rtcwake: fix "maybe be" duplication Signed-off-by: Austin English sys-utils/rtcwake.8.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 381db76d01fa05ee8118ec71feeec566cb4c0547 Author: Austin English Date: Mon May 13 13:53:17 2019 -0500 mount: fix "maybe be" duplication Signed-off-by: Austin English sys-utils/mount.8 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit fd5f21ca45dcebdb24f246dba8e4e6684e3ba226 Author: Austin English Date: Mon May 13 13:53:16 2019 -0500 lsblk: fix "maybe be" duplication Signed-off-by: Austin English misc-utils/lsblk.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 9d714829414dba638c88849104f7f971e6037594 Author: Austin English Date: Mon May 13 13:53:15 2019 -0500 libmount: fix "maybe be" duplication Signed-off-by: Austin English libmount/src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5cee62edc496bab0dcbf76ac7aa94be08902f0d6 Author: Austin English Date: Mon May 13 13:53:14 2019 -0500 lib/colors: fix "maybe be" duplication Signed-off-by: Austin English lib/colors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3011b381e3feddfd1173fd293e024aeba58ded3b Author: Karel Zak Date: Tue May 14 16:43:40 2019 +0200 losetup: keep static analyzer happy [coverity scan] Signed-off-by: Karel Zak lib/loopdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit dcf6f5b3d9417274322ad79fc509c93754195f1a Author: Karel Zak Date: Tue May 14 16:37:35 2019 +0200 lib/colors: keep static analyzer happy [coverity scan] Signed-off-by: Karel Zak lib/colors.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 0ed52c662eea74f4c8a6d926f601a3c77fa3ff69 Author: Karel Zak Date: Tue May 14 15:47:02 2019 +0200 lib/canonicalize: verify DM paths [coverity scan] Now the code only checks that /sys/.../dm/name exists, but never verify the device node in /dev (because path prefix is never NULL). The prefix is used to redirect hardcoded paths to /sys dumps (e.g. lsblk regression tests, etc.) This bug has been introduced in v2.33. Fortunately, it's probably no big issue as /dev is always in sync with /sys (thanks to udevd). Signed-off-by: Karel Zak lib/canonicalize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fbd2d01e23c56d78b343745bc532434d5517ae5d Author: Karel Zak Date: Tue May 14 15:25:07 2019 +0200 build-sys: add PKG_INSTALLDIR fallback Signed-off-by: Karel Zak m4/pkg.m4 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit 89770db4ef94dd990e718fa8ce5b0a33f54c3237 Author: Karel Zak Date: Tue May 14 15:00:01 2019 +0200 fdisk: initialize buffers for get_user_reply() [coverity scan] It's probably unnecessary, but better be safe than sorry. Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 2 +- disk-utils/fdisk.c | 4 ++-- disk-utils/sfdisk.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) commit 99f95a1ea9c86b8f0d99355a97c289dc4756a44b Author: Karel Zak Date: Tue May 14 13:50:59 2019 +0200 build-sys: add --with-pkgconfigdir It seems we need a way how to override the default pkg-config install directory. default: $ ./configure $ grep 'pkgconfigdir =' Makefile pkgconfigdir = ${usrlib_execdir}/pkgconfig user-defined: $ ./configure --with-pkgconfigdir=/usr/share/pkgconfig $ grep 'pkgconfigdir =' Makefile $ pkgconfigdir = /usr/share/pkgconfig Addresses: https://github.com/karelzak/util-linux/issues/793 Signed-off-by: Karel Zak Makefile.am | 2 -- configure.ac | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) commit 99878f5dc49c7a8bf110a355ec9e84a1daa767f9 Author: Nikolay Borisov Date: Mon May 13 15:44:18 2019 +0300 libblkid: Set BLKID_BID_FL_VERIFIED in case revalidation is not needed If blkid_verify deems that device revalidation is not needed since BLKID_PROBE_MIN seconds haven't elapsed since the last revalidation of the device it returns a blkid_dev. However, if this device has been read from the cache file on disk then it wont' have BLKID_BID_FL_VERIFIED bit set. This in turn could lead to a later call to blkid_dev_get free this device in case its part of a multi device configuration. This is particularly relevant to btrfs raid configurations. Namely this was exhibited by btrfs-progs which use blkid for device enumeration. In case of a multi-device filesystem (i.e raid10) running xfstest btrfs/011 would fail sporadically since cached devices read from cache were not revalidated due to being recently validated (according to timestamp in the cache file) at the same time their in-memory blkid_dev structures didn't have BLKID_BID_FL_VERIFIED set. This lead to their untimely removal from the cache from blkid_get_dev. Fix this by setting the BLKID_BID_FL_VERIFIED when returning from blkid_verify with a valid device irrespective of whether full revalidation was performed or the device is deemed valid due to being recently validated. [kzak@redhat.com: - remove also check for BLKID_BID_FL_VERIFIED, the function needs to check for elapsed time only] Signed-off-by: Nikolay Borisov Signed-off-by: Karel Zak libblkid/src/verify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 5de879b0f28574a1395e36a2b15b8fc6fd88ce35 Author: Nikolay Borisov Date: Mon May 13 15:44:17 2019 +0300 libblkid: Don't check BLKID_PROBE_INTERVAL in blkid_verify That constant is set to 200 seconds and is already check in probe_all(). It essentially controls how often blkid_probe_all can do a full cache revalidation. Since blkid_verify is called from within probe_all() iff at least BLKID_PROBE_INTERVAL seconds have elapsed it makes no sense to check this value in blkid_verify. Signed-off-by: Nikolay Borisov libblkid/src/verify.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 8c368dc6d3771d4655c953c42ff009f20d51de1f Author: Karel Zak Date: Mon May 13 17:07:14 2019 +0200 lib/strutils: parse_size() fix frac digit calculation Old code: ./test_strutils --size 0.5MiB 0.5MiB : 512000 : 500K : 500 KiB ./test_strutils --size 0.50MiB 0.50MiB : 5120000 : 4.9M : 4.9 MiB New code: ./test_strutils --size 0.5MiB 0.5MiB : 524288 : 512K : 512 KiB ./test_strutils --size 0.50MiB 0.50MiB : 524288 : 512K : 512 KiB Note that the new implementation also does not use float points, because we need to support PiB and so on... it seems good enough for things like: ./test_strutils --size 7.13G 7.13G : 7656104581 : 7.1G : 7.1 GiB ./test_strutils --size 7.16G 7.16G : 7690675814 : 7.2G : 7.2 GiB to avoid situation where cfdisk creates partition with completely crazy numbers. Addresses: https://github.com/karelzak/util-linux/issues/782 Signed-off-by: Karel Zak lib/strutils.c | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) commit 482e0a07544501ece40314d045b4c70ba9546295 Author: Karel Zak Date: Mon May 13 16:15:58 2019 +0200 lib/strutils: parse_size() fix frac with zeros Fix 0.001G as well as accept 0.000G as valid number. Signed-off-by: Karel Zak lib/strutils.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) commit 5fcdf204b033297486e221a80a7f3c0a30734ceb Author: Karel Zak Date: Thu May 9 13:59:54 2019 +0200 fstrim: affect only warnings by --quiet We need the same return code from fstrim_filesystem() independently on --quiet command line option. Addresses: https://github.com/karelzak/util-linux/pull/791 Signed-off-by: Karel Zak Documentation/releases/v2.34-ReleaseNotes | 4 ++++ sys-utils/fstrim.c | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) commit 0d71a25998e382f845da6c40d53d35f26aad3d07 Author: Karel Zak Date: Thu May 9 13:16:03 2019 +0200 bash-completion: add fstrim --quiet Signed-off-by: Karel Zak bash-completion/fstrim | 1 + 1 file changed, 1 insertion(+) commit ddd9ffb152b555f057bf2f203583f0359b459d31 Merge: cb055909c 374baa6f6 Author: Karel Zak Date: Thu May 9 13:15:10 2019 +0200 Merge branch 'fstrim-bug-789' of https://github.com/kerolasa/util-linux * 'fstrim-bug-789' of https://github.com/kerolasa/util-linux: fstrim: add --quiet option to suppress error messages commit cb055909c3be414c44d550fdf7d6b81eca5d73f7 Author: Karel Zak Date: Thu May 9 10:09:34 2019 +0200 libmount: return errno on failed fstab stat() Signed-off-by: Karel Zak libmount/src/tab_parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 374baa6f64cafe7f1455d68da4fe7069ffbfe6c8 Author: Sami Kerola Date: Tue May 7 20:18:08 2019 +0100 fstrim: add --quiet option to suppress error messages When fstrim interacts with NTFS it result can be error reporting bad file descriptor. That seems to be a bug in NTFS. While waiting driver to get on top of the issue and be commonly available lets add to fstrim option to make it be more silent about errno 9 aka EBADF, Bad file descriptor. Reported-by: https://github.com/moviuro Proposed-by: Dave Reisner Reference: https://bugs.archlinux.org/task/62288 Addresses: https://github.com/karelzak/util-linux/issues/789 Signed-off-by: Sami Kerola sys-utils/fstrim.8 | 10 +++++++++- sys-utils/fstrim.c | 25 +++++++++++++++++++++---- sys-utils/fstrim.service.in | 2 +- 3 files changed, 31 insertions(+), 6 deletions(-) commit 084365f1a1ebed26f2a15e5fc57230a3d7bcdad7 Author: Karel Zak Date: Tue May 7 12:59:52 2019 +0200 build-sys: use __SANITIZE_ADDRESS__ rather than custom USE_CLOSE_ATEXIT Signed-off-by: Karel Zak configure.ac | 3 --- include/closestream.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) commit eab90ef8d4f66394285e0cff1dfc0a27242c05aa Author: Romain Izard Date: Fri May 3 15:42:22 2019 +0200 lib/loopdev.c: Retry LOOP_SET_STATUS64 on EAGAIN A recent bugfix in the Linux kernel made it possible for the LOOP_SET_STATUS64 ioctl to fail when called with a non-zero offset, with an EAGAIN errno: 5db470e229e2 loop: drop caches if offset or block_size are changed This fix changes a silent failure (where mount could sometimes access the backing loop image through the cache without the specified offset) to an explicit failure, and it has also been backported on stable branches. On a 5.0 kernel, other changes to the loop driver make it hard to get generate the EAGAIN error, but this bugfix has also been backported to stables branches, without these changes. At least with the 4.14 stable branch, the EAGAIN error can be quickly generated with the following loop: while mount -o loop,offset=239 disk point && umount point; do :; done Retry the ioctl when it fails with EAGAIN, which means that mount or losetup will eventually succeed when encountering this case. [kzak@redhat.com: - use our local portable xusleep()] Signed-off-by: Romain Izard Signed-off-by: Karel Zak lib/loopdev.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) commit 47b6eccc972a5433ac8b293eb2bf07d074f5bbf7 Author: Karel Zak Date: Tue May 7 11:46:11 2019 +0200 libsmartcols: use scols_walk_* for calculations and printing Signed-off-by: Karel Zak libsmartcols/src/calculate.c | 28 +++++++-- libsmartcols/src/print.c | 138 ++++++++++++++----------------------------- 2 files changed, 67 insertions(+), 99 deletions(-) commit 19c2e73116127244febdbd0535b70b6cc3e453cb Author: Karel Zak Date: Tue May 7 11:44:24 2019 +0200 libsmartcols: add generic function to walk on tree Now we implement the same thing on more places. Let's add one set of functions to walk the tree and use it everywhere. Signed-off-by: Karel Zak libsmartcols/src/Makemodule.am | 1 + libsmartcols/src/smartcolsP.h | 43 +++++++++++- libsmartcols/src/walk.c | 152 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 195 insertions(+), 1 deletion(-) commit f6f8a671a9a45125b6261c08b849833bce0f39a8 Author: Karel Zak Date: Mon May 6 12:39:07 2019 +0200 lsblk: fix heap-use-after-free Addresses: https://github.com/karelzak/util-linux/issues/787 Signed-off-by: Karel Zak misc-utils/lsblk.c | 1 + 1 file changed, 1 insertion(+) commit 281a2f321297390045cb4a62e0a45726742707b8 Author: Karel Zak Date: Fri May 3 17:27:17 2019 +0200 libsmartcols: cell width calulation cleanup Signed-off-by: Karel Zak libsmartcols/src/calculate.c | 82 ++++++++++++++++++++++++------------------- libsmartcols/src/smartcolsP.h | 3 ++ 2 files changed, 49 insertions(+), 36 deletions(-) commit ea7fb72eb25bdfee46d612f91f47c36ba78c4627 Author: Karel Zak Date: Fri May 3 17:12:18 2019 +0200 libsmartcols: (groups) use print functions tp calculate grpset Now we have extra code to calculate grpset. It seems better to use only one way how we wall the tree. Signed-off-by: Karel Zak libsmartcols/src/calculate.c | 22 ++++++++++---- libsmartcols/src/grouping.c | 70 ++----------------------------------------- libsmartcols/src/print.c | 4 ++- libsmartcols/src/smartcolsP.h | 2 +- 4 files changed, 23 insertions(+), 75 deletions(-) commit b94932c063f642abe06e8f3fb72e3abe4416371f Author: Karel Zak Date: Fri May 3 14:53:23 2019 +0200 libsmartcols: (groups) print group childrent after regualr tree Signed-off-by: Karel Zak libsmartcols/src/grouping.c | 28 ++++++++++++++++- libsmartcols/src/print.c | 70 ++++++++++++++++++++++++++----------------- libsmartcols/src/smartcolsP.h | 2 ++ 3 files changed, 72 insertions(+), 28 deletions(-) commit 46634fc90dde9086085b6a503844d098d4058b78 Author: Karel Zak Date: Fri May 3 13:25:09 2019 +0200 libsmartcols: (groups) improve debug messages Signed-off-by: Karel Zak libsmartcols/src/grouping.c | 9 ++++++++- libsmartcols/src/print.c | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) commit fe22543d6b28523db9c7d7e02b1c8cfbfa9b40a1 Author: Karel Zak Date: Thu May 2 15:51:48 2019 +0200 lsblk: add more debug messages Signed-off-by: Karel Zak misc-utils/lsblk.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) commit 883246a104ee3872fd7fb4b3baaa56209a20d6d2 Author: Karel Zak Date: Thu May 2 15:51:29 2019 +0200 libsmartcols: fix groups reset, add debugs Signed-off-by: Karel Zak libsmartcols/src/calculate.c | 2 +- libsmartcols/src/grouping.c | 37 ++++++++++++++++++++++++++----------- libsmartcols/src/print.c | 2 ++ 3 files changed, 29 insertions(+), 12 deletions(-) commit 4525b6cf1632b6912621761a7de5c97bde1b5da3 Author: Karel Zak Date: Thu May 2 13:44:12 2019 +0200 libsmartcols: (groups) remove hardcoded const numbers Signed-off-by: Karel Zak libsmartcols/src/grouping.c | 24 ++++++++++++------------ libsmartcols/src/print.c | 6 +++--- libsmartcols/src/smartcolsP.h | 5 +++++ 3 files changed, 20 insertions(+), 15 deletions(-) commit 74a4d22078a588097f78deaa18b3909393d15e08 Author: Karel Zak Date: Thu May 2 12:48:05 2019 +0200 hardlink: fix compiler warnings [-Wsign-compare -Wmaybe-uninitialized]] misc-utils/hardlink.c: In function ‘process_path’: misc-utils/hardlink.c:287:30: warning: operand of ?: changes signedness from ‘off_t’ {aka ‘long int’} to ‘long unsigned int’ due to unsignedness of other operand [-Wsign-compare] misc-utils/hardlink.c: In function ‘main’: misc-utils/hardlink.c:455:5: warning: ‘exclude_pattern’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Karel Zak misc-utils/hardlink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit e2aa5d82b91b7649dc8494e2cd9a4694a8a97efb Author: Sami Kerola Date: Wed May 1 20:04:24 2019 +0100 hardlink: retire NIOBUF in favour of more common BUFSIZ Reason to retire NIOBUF is that it is obscure local definition, while BUFSIZ is well understood and commonly used constant. Besized sizes of these are not far off, the NIOBUF was 4096 bytes and BUFSIZ tends to be 8192 bytes. Proposed-by: Karel Zak Reference: https://github.com/karelzak/util-linux/pull/783 Signed-off-by: Sami Kerola misc-utils/hardlink.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 007b9874d8074f6687ce9fe0c8a4ae9ae9aad72a Author: Sami Kerola Date: Sat Apr 27 09:54:11 2019 +0100 hardlink: move global variables to a control structure Well, sort of. Due to use of ctl values in atexit() print_summary() there is need for global control structure. Secondly couple variables can be moved to more restricted scope, namely the PCRE variables are now in main(). Signed-off-by: Sami Kerola misc-utils/hardlink.c | 146 +++++++++++++++++++++++++++----------------------- 1 file changed, 78 insertions(+), 68 deletions(-) commit e87263aa13d7e0b2a267fd7aa305c038063c3c0c Author: Sami Kerola Date: Sat Apr 27 09:54:05 2019 +0100 hardlink: use flexible array member rather than zero-size array This fixes two standards compliancy warnings. hardlink.c:65:7: warning: ISO C forbids zero-size array ‘name’ [-Wpedantic] Reference: https://en.wikipedia.org/wiki/Flexible_array_member Signed-off-by: Sami Kerola misc-utils/hardlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)