Changes between v2.34 and v2.35-rc1 -------------------------------------------- commit 6d67d843195fa8b3e07862d544d8e587b2c60260 Author: Karel Zak Date: Wed Dec 11 10:55:14 2019 +0100 build-sys: release++ (v2.35-rc1) Signed-off-by: Karel Zak NEWS | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) commit 8b8985dd1b9f72c9624b2686e8bb2287ece24b87 Author: Karel Zak Date: Wed Dec 11 10:52:51 2019 +0100 docs: add v2.35-ReleaseNotes Signed-off-by: Karel Zak Documentation/releases/v2.35-ReleaseNotes | 471 ++++++++++++++++++++++++++++++ 1 file changed, 471 insertions(+) commit 10dcb8d133e53d186ba73eccd2b386380aee289b Merge: 225c4ff92 9835a4b6a Author: Karel Zak Date: Tue Dec 10 14:46:13 2019 +0100 Merge branch 'dmverity_options' of https://github.com/bluca/util-linux * 'dmverity_options' of https://github.com/bluca/util-linux: verity: add support for Forward Error Correction options verity: ensure that hash_device and root_hash[_file] are passed together or not at all verity: add new verity.roothashfile option commit 225c4ff92aa07c4993201d7cf4665b4209a6bf9e Author: Karel Zak Date: Tue Dec 10 14:08:26 2019 +0100 docs: update AUTHORS file Signed-off-by: Karel Zak AUTHORS | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) commit d462a45d761cb67c14dd835fcb5ceb8cb0455bb2 Author: Karel Zak Date: Tue Dec 10 14:04:50 2019 +0100 po: merge changes Signed-off-by: Karel Zak po/ca.po | 6419 +++++++++++++++++++++++++---------------------- po/cs.po | 6353 ++++++++++++++++++++++++---------------------- po/da.po | 6302 +++++++++++++++++++++++++--------------------- po/de.po | 6529 ++++++++++++++++++++++++++---------------------- po/es.po | 6281 +++++++++++++++++++++++++--------------------- po/et.po | 6343 ++++++++++++++++++++++++---------------------- po/eu.po | 6290 ++++++++++++++++++++++++---------------------- po/fi.po | 6407 +++++++++++++++++++++++++---------------------- po/fr.po | 6283 +++++++++++++++++++++++++--------------------- po/gl.po | 5949 ++++++++++++++++++++++--------------------- po/hr.po | 6351 +++++++++++++++++++++++++--------------------- po/hu.po | 6403 +++++++++++++++++++++++++---------------------- po/id.po | 6429 +++++++++++++++++++++++++---------------------- po/it.po | 6344 ++++++++++++++++++++++++---------------------- po/ja.po | 7195 ++++++++++++++++++++++++++--------------------------- po/nl.po | 6397 +++++++++++++++++++++++++---------------------- po/pl.po | 6273 +++++++++++++++++++++++++--------------------- po/pt.po | 6503 +++++++++++++++++++++++++---------------------- po/pt_BR.po | 6328 +++++++++++++++++++++++++--------------------- po/ru.po | 6269 +++++++++++++++++++++++++--------------------- po/sl.po | 6391 +++++++++++++++++++++++++---------------------- po/sv.po | 6273 +++++++++++++++++++++++++--------------------- po/tr.po | 6333 +++++++++++++++++++++++++--------------------- po/uk.po | 6277 +++++++++++++++++++++++++--------------------- po/util-linux.pot | 5417 +++++++++++++++++++++------------------- po/vi.po | 6390 +++++++++++++++++++++++++---------------------- po/zh_CN.po | 7018 ++++++++++++++++++++++++++------------------------- po/zh_TW.po | 6472 +++++++++++++++++++++++++---------------------- 28 files changed, 95382 insertions(+), 82837 deletions(-) commit 7e148b5a31ab9ba58b61de24942d6943698c20bd Author: Pedro Albuquerque Date: Tue Dec 10 13:57:19 2019 +0100 po: add pt.po (from translationproject.org) po/pt.po | 20159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 20159 insertions(+) commit cc7948a9e37b2eb319f55be4febb66f0c601ddf6 Author: Boyuan Yang <073plan@gmail.com> Date: Tue Dec 10 13:57:19 2019 +0100 po: update zh_CN.po (from translationproject.org) po/zh_CN.po | 1272 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 815 insertions(+), 457 deletions(-) commit 444e4a0f7c385e105ba48714db8ec6fe9392b2bb Author: Takeshi Hamasaki Date: Tue Dec 10 13:57:19 2019 +0100 po: update ja.po (from translationproject.org) po/ja.po | 1460 +++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 1023 insertions(+), 437 deletions(-) commit 5f852d7b61a80b8ad36543bb3db90ab5d952d948 Author: Mario Blättermann Date: Tue Dec 10 13:57:19 2019 +0100 po: update de.po (from translationproject.org) po/de.po | 899 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 450 insertions(+), 449 deletions(-) commit 9835a4b6a110643dad14015bad5c6b391e011b92 Author: Luca Boccassi Date: Tue Dec 10 12:26:07 2019 +0000 verity: add support for Forward Error Correction options Requires kernel built with CONFIG_DM_VERITY_FEC. libmount/docs/libmount-sections.txt | 3 +++ libmount/python/pylibmount.c | 3 +++ libmount/src/context_veritydev.c | 45 ++++++++++++++++++++++++++++++++----- libmount/src/libmount.h.in | 3 +++ libmount/src/optmap.c | 3 +++ sys-utils/mount.8 | 12 ++++++++++ 6 files changed, 64 insertions(+), 5 deletions(-) commit fe8358bf052b8ac3ceae5381674c344ee607af8f Author: Luca Boccassi Date: Tue Dec 10 11:21:43 2019 +0000 verity: ensure that hash_device and root_hash[_file] are passed together or not at all If a hash device or a roothash are passed for verity usage, both have to be present or we cannot use them. Make it an error to pass only one of them. libmount/src/context_veritydev.c | 5 +++++ 1 file changed, 5 insertions(+) commit 141bb954e707326604bec7a9082f7272cece1504 Author: Luca Boccassi Date: Tue Dec 10 11:18:09 2019 +0000 verity: add new verity.roothashfile option Allow users to point mount to a file to read the roothash, in addition to passing it inline. Allows a volume managed by a systemd mount unit to be updated without changing the mount unit content itself, for easier and more user friendly servicing. libmount/docs/libmount-sections.txt | 1 + libmount/python/pylibmount.c | 1 + libmount/src/context_veritydev.c | 21 ++++++++++++++++++++- libmount/src/libmount.h.in | 1 + libmount/src/optmap.c | 1 + sys-utils/mount.8 | 8 ++++++++ 6 files changed, 32 insertions(+), 1 deletion(-) commit 4af92de9839113d81ea100c21a40b9cc4084a553 Author: Karel Zak Date: Tue Dec 10 13:50:18 2019 +0100 build-sys: remove duplicate includes Signed-off-by: Karel Zak libfdisk/src/partition.c | 1 - term-utils/scriptlive.c | 1 - tests/ts/build-sys/config | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) commit ac17a625ce916e169d2de6a54f809e247f5bd1e0 Author: Karel Zak Date: Tue Dec 10 12:31:59 2019 +0100 build-sys: add missing header Signed-off-by: Karel Zak include/Makemodule.am | 1 + 1 file changed, 1 insertion(+) commit bba1a601985fa0549d13b4cc671f0eacab03b91d Author: Karel Zak Date: Tue Dec 10 11:07:30 2019 +0100 kill: add another ifdef Signed-off-by: Karel Zak misc-utils/kill.c | 2 ++ 1 file changed, 2 insertions(+) commit 8aab38783a1d52552845c8cb77ae796d86ca3157 Author: Karel Zak Date: Mon Dec 9 16:20:06 2019 +0100 kill: add missing ifdefs Signed-off-by: Karel Zak misc-utils/kill.c | 2 ++ 1 file changed, 2 insertions(+) commit 8e0b90e012d8daa4ab39ef7505b5a47a7ce79786 Author: Karel Zak Date: Mon Dec 9 16:10:02 2019 +0100 script: document SIGUSR1 Based on pull request: https://github.com/karelzak/util-linux/pull/815 Signed-off-by: Karel Zak term-utils/script.1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 7727be1af11bec807018bc25b4e9da3417018375 Author: Karel Zak Date: Mon Dec 9 16:04:18 2019 +0100 script: listen to SIGUSR1, flush logs on the signal Based on pull request: https://github.com/karelzak/util-linux/pull/815 Signed-off-by: Karel Zak include/pty-session.h | 5 +++++ lib/pty-session.c | 8 ++++++++ term-utils/script.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) commit ded3735ef4d4e04efbef4fd78db22f2a5f129e10 Author: Karel Zak Date: Mon Dec 9 13:20:04 2019 +0100 kill: deallocate follow_ups [assan] Signed-off-by: Karel Zak misc-utils/kill.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 1395236acd84baaf31434998cf72a260cfb7f226 Author: Karel Zak Date: Mon Dec 9 13:11:16 2019 +0100 kill: make man page more informative about --timeout Signed-off-by: Karel Zak misc-utils/kill.1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 26c2ad6c38711b3bca269cf9e6be2d5479f0455c Author: Karel Zak Date: Mon Dec 9 12:40:53 2019 +0100 kill: report features on -V, add lish_header initialization Signed-off-by: Karel Zak misc-utils/kill.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) commit b6c3de881c7a136632766ab25f4b7b5d75608f04 Author: Karel Zak Date: Mon Dec 9 12:22:31 2019 +0100 include/pidfd-utils: small cleanup Signed-off-by: Karel Zak include/pidfd-utils.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit e601521259eadb135d638ac9a64246e19d614588 Merge: 885fe4e57 6e6b9a1d2 Author: Karel Zak Date: Mon Dec 9 12:20:22 2019 +0100 Merge branch 'kill-pidfd' of https://github.com/kerolasa/util-linux * 'kill-pidfd' of https://github.com/kerolasa/util-linux: kill: use pidfd system calls to implement --timeout option build-sys: add missing NR underscore to UL_CHECK_SYSCALL() commit 885fe4e57bb597703dac0cff37f1c7b334217e90 Merge: dde4b5936 ebaf1d55b Author: Karel Zak Date: Mon Dec 9 12:18:38 2019 +0100 Merge branch 'make-manpage-of-su-clearer' of https://github.com/your-diary/util-linux * 'make-manpage-of-su-clearer' of https://github.com/your-diary/util-linux: Slight change in terms Make the manpage of su clearer commit dde4b59369a18d6b49648277069a79a1d58a4690 Author: Karel Zak Date: Mon Dec 9 11:30:55 2019 +0100 lib/randutils: re-licensing back to BSD The file is originally from libuuid, this library is under BSD licence. Unfortunately, I have added LGPL header by accident to the file (commit 0f23ee0c855d686b0c315af2c96b8835134cd9e3). The file under LGPL was modified (in relevant way) by Sami, Christopher and me. We all agree with re-licensing back to BSD. Signed-off-by: Sami Kerola Signed-off-by: Christopher James Halse Rogers Signed-off-by: Karel Zak lib/randutils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit ebaf1d55b4a61627b7bc424181fa192f95ee2a89 Author: Manatsu Takahashi Date: Sun Dec 8 22:26:26 2019 +0900 Slight change in terms login-utils/su.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 1ffc4f7dcb1f78325d0b848fba8bebc0f31e46f4 Author: Manatsu Takahashi Date: Sun Dec 8 22:20:53 2019 +0900 Make the manpage of su clearer login-utils/su.1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 90084a26089ad2aba77d5bcff2b0dff44c6271d0 Author: Pierre Labastie Date: Fri Dec 6 12:50:46 2019 +0100 docs: Fix adjtime documentation The first line of the adjtime file is made of three numbers (see=20 hwclock.c): - a drift factor as a decimal float - the time of last adjust as a decimal integer - a zero (for compatibility) as a decimal float. but both man pages (hwclock.8 and adj_time.5) tell that the third number is a decimal integer. Of course this is harmless if somebody edits the adjtime file with "0"=20 as the third number: it will be correctly read by hwclock anyway. But if for some reason, a program reads the adjtime file and expects an integer, it will fail, because hwclock writes O.OOOO0O as the third=20 number. Signed-off-by:: Pierre Labastie Signed-off-by: Karel Zak sys-utils/adjtime_config.5 | 2 +- sys-utils/hwclock.8.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 1c788737d74d43e726842a76ed195191946929ca Author: Jouke Witteveen Date: Fri Dec 6 11:06:03 2019 +0100 su: silence a useless warning When the requested shell matches the restricted shell, there is no reason to issue a warning, since we will be doing precisely as requested. Signed-off-by: Jouke Witteveen login-utils/su-common.c | 1 + 1 file changed, 1 insertion(+) commit 62dc77f3a23a24362695f0bd2e10b0a82d97c5c6 Author: Karel Zak Date: Thu Dec 5 15:32:23 2019 +0100 mount: add verity example to man page Signed-off-by: Karel Zak sys-utils/mount.8 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit fadb5ebf9c080126ab195a2ec0d1c1a4a096658c Author: Karel Zak Date: Thu Dec 5 14:57:50 2019 +0100 build-sys: add --with-cryptsetup to config-gen.d/all.conf Signed-off-by: Karel Zak tools/config-gen.d/all.conf | 1 + 1 file changed, 1 insertion(+) commit cbc390da3a59cf239e27f07f81beb4a2a8d42dca Author: Karel Zak Date: Thu Dec 5 14:57:29 2019 +0100 libmount: add verity to mount -V output Signed-off-by: Karel Zak libmount/src/version.c | 3 +++ 1 file changed, 3 insertions(+) commit c9300c7d6ead5bf0d566248052f1fcc94822b161 Author: Karel Zak Date: Thu Dec 5 13:40:42 2019 +0100 mount: (dm-verity) update man page * move to separate section (like we use for LOOP DEVICE support) * explain what dm-verity + mount(8) does Signed-off-by: Karel Zak sys-utils/mount.8 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit 9309ca1b93889d30b400224ba2a2c6b57efccfca Merge: 107e95594 e6a498877 Author: Karel Zak Date: Thu Dec 5 13:23:46 2019 +0100 Merge branch 'dmverity' of https://github.com/bluca/util-linux * 'dmverity' of https://github.com/bluca/util-linux: libmount: add support for verity devices via libcryptsetup commit e6a498877cf83fddd837b8f22c936f4f9b61b2d7 Author: Luca Boccassi Date: Fri Nov 8 17:02:09 2019 +0000 libmount: add support for verity devices via libcryptsetup The following new options are added: verity.hashdevice verity.roothash verity.hashoffset The source path will be used as a dm-verity object, and will be opened using libcryptsetup APIs. A new --with-cryptsetup build-time option is added, which adds a dependency on libcryptsetup. To ease bootstrapping, given libcryptsetup build-depends on util-linux for libuuid, if --with-cryptsetup=yes but libcryptsetup is not installed only a warning will be printed at configure time rather than an error. This way stage0/first stage/ring0 builds can use the same configure options but avoid installing cryptsetup to get a working base set, and then rebuild util-linux in the next step of the boostrapping process. If verity options are selected but cannot be fullfilled due to lack of dependencies, mounting a volume will fail even if using a loop device would work as a fallback, to avoid silently skipping integrity checks. Makefile.am | 6 + configure.ac | 24 +++ libmount/docs/libmount-sections.txt | 3 + libmount/mount.pc.in | 2 +- libmount/python/pylibmount.c | 3 + libmount/src/Makemodule.am | 3 + libmount/src/context.c | 15 +- libmount/src/context_mount.c | 5 + libmount/src/context_veritydev.c | 289 ++++++++++++++++++++++++++++++++++++ libmount/src/init.c | 1 + libmount/src/libmount.h.in | 3 + libmount/src/mountP.h | 7 + libmount/src/optmap.c | 4 + sys-utils/mount.8 | 18 +++ 14 files changed, 380 insertions(+), 3 deletions(-) commit 107e95594642b96cde430229095edcacb81dfa2f Author: Karel Zak Date: Wed Dec 4 12:38:57 2019 +0100 lsblk: add PARTTYPENAME column Print also partition type in human-readable way. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1777261 Signed-off-by: Karel Zak misc-utils/lsblk-properties.c | 64 +++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsblk.c | 13 ++++++++- misc-utils/lsblk.h | 2 ++ 3 files changed, 78 insertions(+), 1 deletion(-) commit 96c2b09fcba374457c75412156e3fb86ed53de66 Author: Karel Zak Date: Wed Dec 4 12:37:22 2019 +0100 libfdisk: move GPT partition types to include/ We need the array use in another tools too. Let's follow the way we use for MBR and keep it in include/. Signed-off-by: Karel Zak include/Makemodule.am | 1 + include/pt-gpt-partnames.h | 149 +++++++++++++++++++++++++++++++++++++++++++++ libfdisk/src/gpt.c | 139 +----------------------------------------- 3 files changed, 151 insertions(+), 138 deletions(-) commit 3861c371f673625a1ca9c8e203d800ddbaa99a67 Merge: ac0391cc4 6497f2d99 Author: Karel Zak Date: Tue Dec 3 15:23:53 2019 +0100 Merge branch 'mount-eperm' * mount-eperm: mount: no exit on EPERM, continue without suid commit ac0391cc4f22e0892f2129f32285dcdfc542cfe0 Author: Karel Zak Date: Tue Dec 3 15:15:22 2019 +0100 unshare: cleanup capabilities code [lgtm scan] - remove C++isms - remove unnecessary { } - remove if-if - remove unnecessary condition Signed-off-by: Karel Zak sys-utils/unshare.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) commit b4251e515139cb6a1e0b595933420eb726b582de Author: Karel Zak Date: Tue Dec 3 15:07:58 2019 +0100 libfdisk: improve Sun partitions calculation [lgtm scan] Signed-off-by: Karel Zak libfdisk/src/sun.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) commit 5fbb920ed4f3ef545341a44d2f5b6ed5b0819a41 Author: Karel Zak Date: Tue Dec 3 14:51:31 2019 +0100 libblkid: improve MD I/O size calculation [lgtm scan] Signed-off-by: Karel Zak libblkid/src/topology/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2d1e803b08be2d423b722b6c2353bad54b78ab39 Author: Karel Zak Date: Tue Dec 3 14:49:16 2019 +0100 libblkid: improve vfat entries calculation [lgtm scan] Signed-off-by: Karel Zak libblkid/src/superblocks/vfat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 48f80ab3b0ad9e38f6f1b70a04179a6c6fa98dce Author: Karel Zak Date: Tue Dec 3 14:35:43 2019 +0100 lscpu: make code more readable [lgtm scan] Signed-off-by: Karel Zak sys-utils/lscpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 6f7c67a5ffd7d356b3c91e4bbc8e1653cfc89ec4 Author: Karel Zak Date: Tue Dec 3 14:31:55 2019 +0100 libmount: fix typo in mnt_context_prepare_helper() [lgtm scan] Signed-off-by: Karel Zak libmount/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 21c97651f4179148afc4a9896fa4c2cae27a34fe Author: Karel Zak Date: Tue Nov 26 09:56:24 2019 +0100 tests: mark scriptlive as KNOWN_FAILED Not sure why, but on travis-ci the shell output is little bit different, probably depends on shell version, etc. Signed-off-by: Karel Zak tests/ts/script/replay | 1 + 1 file changed, 1 insertion(+) commit 6e6b9a1d242196e8fce5a473ab113137f8819cb8 Author: Sami Kerola Date: Mon Nov 25 20:31:20 2019 +0000 kill: use pidfd system calls to implement --timeout option At times there is need in scripts to send multiple signals to a process. Often these cases require some amount of waiting before follow-up signal should be sent. One common case is process termination, where first script tries to kill process gracefully but if that does not work SIGKILL is sent. Functionality like that is commonly done by periodically checking if signalled pid exist or not, and if it does another signal is sent possibly to an unrelated process that reused pid number. That means polling a pid is prone to a data race. Also if the first signal immediately kills the process one polling interval is lost in sleep. Another example when multiple signal need to be sent is various daemon process control situations, such as Upgrading Executable on the Fly (see reference). This happens to be the case that inspired change author to make sequential signaling a little bit easier. Reference: http://nginx.org/en/docs/control.html#upgrade Pull-request: https://github.com/karelzak/util-linux/pull/902 Signed-off-by: Sami Kerola configure.ac | 5 +++ include/pidfd-utils.h | 23 ++++++++++++++ misc-utils/kill.1 | 24 ++++++++++++-- misc-utils/kill.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 2 deletions(-) commit ca27517aae3e53179d9ebaa03d8956f870c83725 Author: Sami Kerola Date: Mon Nov 25 20:33:05 2019 +0000 build-sys: add missing NR underscore to UL_CHECK_SYSCALL() The unistd.h defines system call numbers with two leading underscores. Signed-off-by: Sami Kerola m4/ul.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 52722cda11e1955e14486cb53f21e24e17d1d9b0 Author: Karel Zak Date: Mon Nov 25 14:09:38 2019 +0100 tests: another prompt fix Signed-off-by: Karel Zak tests/ts/script/replay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 897166a86d68bdc2ac613bd14d2ffcba34410fd6 Author: Karel Zak Date: Mon Nov 25 13:55:18 2019 +0100 build-sys: fix out-of-tree build for hwclock The file sys-utils/hwclock-parse-date.c is generated from .y and stored in the build directory and "#include hwclock.h" is interpreted relatively to the build tree rather than to source tree. We need explicit -I compiler option to point to $srcdir for hwclock. Signed-off-by: Karel Zak sys-utils/Makemodule.am | 1 + 1 file changed, 1 insertion(+) commit 0faa7eda0453464991169c394c01554dba8a948d Author: Karel Zak Date: Mon Nov 25 12:49:48 2019 +0100 bash-completion: update for new script tools Signed-off-by: Karel Zak bash-completion/Makemodule.am | 3 +++ bash-completion/script | 6 ++++++ bash-completion/scriptlive | 36 ++++++++++++++++++++++++++++++++++++ bash-completion/scriptreplay | 7 +++++++ 4 files changed, 52 insertions(+) commit eb7819221196a95c0dbd37f81267856b65c4c1a0 Author: Karel Zak Date: Mon Nov 25 12:49:41 2019 +0100 scriptreplay: fix typo Signed-off-by: Karel Zak term-utils/scriptreplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1eee1acb245a8b724e441778dfa9b858465bf7e5 Author: Karel Zak Date: Mon Nov 25 12:39:52 2019 +0100 script: add --echo It some cases it makes sense to disable ECHO flag also when script used in pipe. This new option allows to keep full control in user's hands. Signed-off-by: Karel Zak include/pty-session.h | 4 ++-- lib/pty-session.c | 30 +++++++++++++++++++----------- term-utils/script.1 | 7 +++++++ term-utils/script.c | 31 ++++++++++++++++++++++--------- term-utils/scriptlive.c | 2 +- 5 files changed, 51 insertions(+), 23 deletions(-) commit a06b278bd301e14fcead4e3109ede435b524d73b Author: Karel Zak Date: Mon Nov 25 10:45:38 2019 +0100 tests: remove option --posix Signed-off-by: Karel Zak tests/expected/script/replay-live | 2 +- tests/ts/script/replay | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 53ea212dca78138f9acd4c1c9ffd7a677f505971 Author: Karel Zak Date: Fri Nov 22 14:21:20 2019 +0100 tests: make scriptlive output more portable Signed-off-by: Karel Zak tests/expected/script/replay-live | 4 ++-- tests/ts/script/replay | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit 4a2d27a242bf284286883cdb63ac36b211b91a16 Author: Karel Zak Date: Fri Nov 22 14:04:21 2019 +0100 scriptlive: keep ECHO flag, improve welcome message Signed-off-by: Karel Zak term-utils/scriptlive.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 45b819c124ceeaa9cd6bba0d45cdb589003bde76 Author: Karel Zak Date: Fri Nov 22 14:04:11 2019 +0100 tests: upadet scriptlive output Signed-off-by: Karel Zak tests/expected/script/replay-live | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 85ecd3719b1e7b490dfedd8d145980b70177a6b2 Author: Karel Zak Date: Fri Nov 22 13:48:54 2019 +0100 tests: add script and scriptlive replay Signed-off-by: Karel Zak tests/commands.sh | 1 + tests/expected/script/replay | 9 ----- tests/expected/script/replay-basic | 9 +++++ tests/expected/script/replay-input | 4 ++ tests/expected/script/replay-live | 7 ++++ tests/expected/script/replay-output | 7 ++++ tests/ts/script/replay | 77 ++++++++++++++++++++++++++++++++----- 7 files changed, 96 insertions(+), 18 deletions(-) commit 1ec363cfff188579ef62d451324ede9a40481434 Author: Karel Zak Date: Fri Nov 22 13:48:29 2019 +0100 scriptlive: add --command, cleanup shell exec Signed-off-by: Karel Zak term-utils/scriptlive.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) commit 95d255a81997a298ec802566fe65c8951558907e Author: Karel Zak Date: Fri Nov 22 12:34:45 2019 +0100 scriptlive: terminate session at end of the log We need a proper way how to inform child (shell) that the game is over. It seems the best is to send EOF to child rather than immediately break PTY mainloop where we have poll(), because shell can still produce data etc. Signed-off-by: Karel Zak include/pty-session.h | 1 + lib/pty-session.c | 4 ++-- term-utils/scriptlive.c | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) commit f896aef36bb0d26c5a7a816ce163a481c41a6485 Author: Karel Zak Date: Fri Nov 22 11:56:04 2019 +0100 lib/pty: make sure we not use closed FD Signed-off-by: Karel Zak lib/pty-session.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) commit 4169bcb766dd6cdbcbb7c43fe91bb7bc450a0078 Author: Karel Zak Date: Thu Nov 21 12:28:51 2019 +0100 script: fix ECHO use, improve shell exec For tools like su(1) is ECHO flag unexpected for use-case like echo 'date' | su - user but script(1) need the echo to keep input recorded. The patch also return execlp() use to script(1) code. Signed-off-by: Karel Zak include/pty-session.h | 4 +++- lib/pty-session.c | 11 +++++++++-- term-utils/script.c | 23 +++++++++++++++++++---- 3 files changed, 31 insertions(+), 7 deletions(-) commit 241f3f014e4b93b8d97611c10ef861ff289047f8 Author: Karel Zak Date: Wed Nov 20 11:25:32 2019 +0100 lscpu: top-level DMI function refactoring Let's keep /dev/mem code together and do not mix it with /sys firmware stuff. Signed-off-by: Karel Zak sys-utils/lscpu-dmi.c | 81 ++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 37 deletions(-) commit 6497f2d99e9cabee3531e644ba4dcffd14532200 Author: Karel Zak Date: Tue Nov 19 14:58:20 2019 +0100 mount: no exit on EPERM, continue without suid The current libmount assumes that mount(8) and umount(8) are suid binaries. For this reason it implements internal rules which restrict what is allowed for non-root users. Unfortunately, it's out of reality for some use-cases where root permissions are no required. Nice example are fuse filesystems. So, the current situation is to call exit() always when mount, umount or libmount are unsure with non-root user rights. This patch removes the exit() call and replaces it with suid permissions drop, after that it continues as usually. It means after suid-drop all depend on kernel and no another security rule is used by libmount (simply because any rule is no more necessary). Example: old version: $ mount -t fuse.sshfs kzak@192.168.111.1:/home/kzak /home/kzak/mnt mount: only root can use "--types" option new version: $ mount -t fuse.sshfs kzak@192.168.111.1:/home/kzak /home/kzak/mnt kzak@192.168.111.1's password: $ findmnt /home/kzak/mnt TARGET SOURCE FSTYPE OPTIONS /home/kzak/mnt kzak@192.168.111.1:/home/kzak fuse.sshfs rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 $ umount /home/kzak/mnt $ echo $? 0 Note that fuse user umount is supported since v2.34 due to user_id= in kernel mount table. Signed-off-by: Karel Zak libmount/docs/libmount-sections.txt | 1 + libmount/src/context.c | 25 +++++++++++++++++++++ libmount/src/libmount.h.in | 1 + libmount/src/libmount.sym | 1 + sys-utils/mount.8 | 6 ++++++ sys-utils/mount.c | 43 ++++++++++++++++++++++--------------- sys-utils/umount.8 | 19 ++++++++++++++++ sys-utils/umount.c | 37 +++++++++++++++++++------------ 8 files changed, 102 insertions(+), 31 deletions(-) commit 916a3f8d298a05678016d81548029270b27ee5f3 Author: Karel Zak Date: Mon Nov 18 16:19:15 2019 +0100 libmount: don't access struct member, use API Signed-off-by: Karel Zak libmount/src/context_mount.c | 2 +- libmount/src/context_umount.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit beb61b07c20ab902fec883a4bd087c45d2742dea Author: Sami Kerola Date: Sun Nov 17 08:33:04 2019 +0000 nologin: silently ignore well known shell command-line options nologin is typically used in /etc/passwd as a shell replacement. Hence it is reasonable to ignore well known command-line options silently to avoid unwanted ugly error messages. Addresses: https://github.com/karelzak/util-linux/issues/895 Requested-by: Lennart Poettering Signed-off-by: Sami Kerola login-utils/nologin.8 | 32 ++++++++++++++++++++++++-------- login-utils/nologin.c | 33 ++++++++++++++++++++++++++++----- 2 files changed, 52 insertions(+), 13 deletions(-) commit 4631edaee2bce9030c4e6169db08e090fe56c7e7 Author: Karel Zak Date: Fri Nov 15 11:23:44 2019 +0100 lsblk: add FSVER to --fs Signed-off-by: Karel Zak misc-utils/lsblk.c | 1 + 1 file changed, 1 insertion(+) commit ae1e82e0b5ea3f379a00e9d4e2c7eac8a9d61be4 Author: Evan Green Date: Tue Nov 12 14:17:37 2019 -0800 libfdisk: Space before first partition may not be aligned libfdisk chooses a grain of 1MB fairly arbitrarily, and this granule may not be honored by other utilities. GPT disks formatted elsewhere may have space before the first partition, AND a partition that exists solely below 1MB. If this occurs, cfdisk ends up adding a free space region where end < start, resulting in a 16 Exabyte free region. That's too many exabytes. This happens because the start gets rounded up to the granule size in new_freespace() but the end is left alone. The logs show it best: 23274: libfdisk: CXT: [0x572d878]: initialized: last=34, grain=2048 23274: libfdisk: CXT: [0x572d878]: partno=10, start=64 23274: libfdisk: CXT: [0x572d878]: freespace analyze: partno=10, start=64, end=64 23274: libfdisk: CXT: [0x572d878]: LBA 34 aligned-up 2048 [grain=2048s] 23274: libfdisk: CXT: [0x572d878]: LBA 63 aligned-down 0 [grain=2048s] 23274: libfdisk: CXT: [0x572d878]: LBA 34 aligned-near 0 [grain=2048s] 23274: libfdisk: CXT: [0x572d878]: 0 in range <2048..0> aligned to 2048 23274: libfdisk: PART: [0x574bb98]: alloc 23274: libfdisk: TAB: [0x5749d58]: adding freespace 23274: libfdisk: TAB: [0x5749d58]: insert entry 0x574bb98 pre=0x574a820 [start=2048, end=63, size=18446744073709549632, freespace ] Avoid this by aligning the last value like new_freespace() does. Signed-off-by: Evan Green libfdisk/src/table.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 9cca1ef2d5283a461c3a6d9aa1a036bb4ada6e70 Author: Karel Zak Date: Tue Nov 12 13:55:55 2019 +0100 lsblk: add FSVER (filesystem version) column Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1764523 Signed-off-by: Karel Zak misc-utils/lsblk-properties.c | 6 ++++++ misc-utils/lsblk.c | 7 +++++++ misc-utils/lsblk.h | 1 + 3 files changed, 14 insertions(+) commit 4e666fcedaa6a4e5916af75a9e892dfb0cc757f7 Author: Karel Zak Date: Tue Nov 12 11:15:38 2019 +0100 agetty: add --show-issue to review issue output Let's make life easier for admins and allow to review issue file output on the current terminal without all full agetty execution. Use case is pretty simple: # $EDITOR /etc/issue # agetty --show-issue Addresses: https://github.com/karelzak/util-linux/issues/828 Signed-off-by: Karel Zak term-utils/agetty.8 | 11 ++++++++++- term-utils/agetty.c | 41 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 4 deletions(-) commit 456bcbca6b55fbed33d9f86e69a51abd0e1b8f0b Author: Karel Zak Date: Tue Nov 12 10:10:02 2019 +0100 agetty: add support for /run/issue and /usr/lib/issue Addresses: https://github.com/karelzak/util-linux/issues/828 Signed-off-by: Karel Zak include/pathnames.h | 7 +- term-utils/agetty.8 | 17 +++-- term-utils/agetty.c | 197 ++++++++++++++++++++++++++++++---------------------- 3 files changed, 133 insertions(+), 88 deletions(-) commit c2409b55a08806f4b746e5edf3a42665ef636665 Author: Karel Zak Date: Mon Nov 11 13:08:04 2019 +0100 build-sys: introduce $sysconfstaticdir The current situation is that distros differentiate between: * host specific configuration -- usually /etc, maintained by admin * distribution specific (static) configuration -- usually /usr/lib, maintained by ditro packages Unfortunately autotools have clue about $sysconfdir (/etc) only. This patch introduces $sysconfstaticdir (default $prefix/lib). Signed-off-by: Karel Zak Makefile.am | 4 +++- configure.ac | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) commit 390ba85c78cc9f78a00b3141e5f51a0603f57997 Author: Karel Zak Date: Fri Nov 8 11:32:18 2019 +0100 renice: fix arguments description in --help The --{pid,pgrp,user} options does not have arguments. Reported-by: Stephane Chazelas Signed-off-by: Karel Zak sys-utils/renice.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit cb99f4ea79c2abbe9b0b20ef0a225b6ee5405f97 Author: Karel Zak Date: Fri Nov 8 11:22:57 2019 +0100 renice: fix --help text The option [-n] in the code has no any meaning and the value is used as priority, not incrementally. Reported-by: Stephane Chazelas Signed-off-by: Karel Zak sys-utils/renice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 48bb8522fe3e9813ba2139a7807a9897c733fe8e Author: Andrew Price Date: Thu Oct 31 16:51:44 2019 +0000 fallocate.1: List gfs2 as supporting punch-hole Signed-off-by: Andrew Price sys-utils/fallocate.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 68a2ade7eddb892f875cc330732b1dd7685e6756 Author: Karel Zak Date: Fri Nov 8 11:12:13 2019 +0100 hwclock: add SPDX-License-Identifier(s) Signed-off-by: Karel Zak sys-utils/hwclock-cmos.c | 2 ++ sys-utils/hwclock-parse-date.y | 2 ++ sys-utils/hwclock-rtc.c | 2 ++ sys-utils/hwclock.c | 8 ++++++-- 4 files changed, 12 insertions(+), 2 deletions(-) commit e98d95131f292ca0cd2ab8f8de4438aa9b29f329 Author: Karel Zak Date: Fri Nov 8 11:10:54 2019 +0100 docs: add GPLv3 text Signed-off-by: Karel Zak Documentation/licenses/COPYING.GPL-3.0-or-later | 674 ++++++++++++++++++++++++ README.licensing | 2 + 2 files changed, 676 insertions(+) commit 7999563138e102e5b2e7f3f6a0a726e683ae5169 Author: Karel Zak Date: Fri Nov 8 10:42:03 2019 +0100 lib/timeutils: add %Y-%m-%dT%H:%M:%S to parse_timestamp() Signed-off-by: Karel Zak lib/timeutils.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) commit 8fb945185f5328a03f407d5b1b00097910d1e541 Author: Karel Zak Date: Fri Nov 8 10:40:42 2019 +0100 lib: add missing license headers Signed-off-by: Karel Zak lib/idcache.c | 7 ++++++- lib/langinfo.c | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) commit 4d1b9e02fc0ef15ce971a606e5a166d2c680a69c Author: Karel Zak Date: Thu Nov 7 10:43:46 2019 +0100 build-sys: .gitignore hwclock-parse-date.c Signed-off-by: Karel Zak lib/.gitignore | 1 - sys-utils/.gitignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) commit 4e36662e52f9b275c3441528c5ed85dbc9b6d97e Author: Karel Zak Date: Thu Nov 7 09:38:06 2019 +0100 lib: add missing license headers Signed-off-by: Karel Zak lib/color-names.c | 7 ++++++- lib/strutils.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) commit 8e1b131e0aa1063928a830300279f8fce706f407 Author: Karel Zak Date: Thu Nov 7 09:02:23 2019 +0100 build-sys: use parse-date() only for hwclock The parse-date.y is used only for hwclock, let's keep it together. Note that the file (originally from gnulib) has GPLv3 license, so it's better to make it obvious that we use it really only for hwclock (also GPL). Signed-off-by: Karel Zak include/timeutils.h | 2 -- lib/Makemodule.am | 1 - sys-utils/Makemodule.am | 3 ++- lib/parse-date.y => sys-utils/hwclock-parse-date.y | 1 + sys-utils/hwclock.h | 2 ++ 5 files changed, 5 insertions(+), 4 deletions(-) commit 39f5af25982d8b0244000e92a9d0e0e6557d0e17 Author: Michal Suchanek Date: Mon Nov 4 21:23:15 2019 +0100 libblkid: open device in nonblock mode. When autoclose is set (kernel default but many distributions reverse the setting) opening a CD-rom device causes the tray to close. The function of blkid is to report the current state of the device and not to change it. Hence it should use O_NONBLOCK when opening the device to avoid closing a CD-rom tray. blkid is used liberally in scripts so it can potentially interfere with the user operating the CD-rom hardware. [kzak@redhat.com: add O_NONBLOCK also to: - wipefs - blkid_new_probe_from_filename() - blkid_evaluate_tag()] Signed-off-by: Michal Suchanek Signed-off-by: Karel Zak libblkid/src/evaluate.c | 2 +- libblkid/src/probe.c | 2 +- libblkid/src/verify.c | 2 +- misc-utils/blkid.c | 2 +- misc-utils/wipefs.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) commit b4402de7a0918c68d2cef76802074ddde2d8711c Author: Karel Zak Date: Tue Nov 5 15:42:19 2019 +0100 tests: commit add missing file Signed-off-by: Karel Zak tests/expected/mount/fstab-all | 5 +++++ 1 file changed, 5 insertions(+) commit be906b20f20ed3335814686ea45961bbc0d64c62 Author: Karel Zak Date: Tue Nov 5 15:14:17 2019 +0100 tests: add mount --all tests Signed-off-by: Karel Zak tests/ts/mount/fstab-all | 138 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) commit 6a735c2c5bfd64b06fd210663c1ebfeac6eef061 Author: Karel Zak Date: Thu Oct 31 13:51:29 2019 +0100 libmount: make sure optsmode is initialized Since 34333e5244167a8f6385faa350938ed5cb6d5c0a we apply fstab options manually by mnt_context_apply_fs() on --all. The function does not work correctly when optsmode is zero. Signed-off-by: Karel Zak libmount/src/context.c | 29 ++++++++++++++++++++++------- libmount/src/context_mount.c | 6 ++++-- 2 files changed, 26 insertions(+), 9 deletions(-) commit f2cb9359c1b5e51a53ca89dbe38492c276d8ad92 Author: Karel Zak Date: Thu Oct 31 12:24:17 2019 +0100 mount: (man) document --target-prefix Signed-off-by: Karel Zak sys-utils/mount.8 | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 34333e5244167a8f6385faa350938ed5cb6d5c0a Author: Karel Zak Date: Thu Oct 31 12:10:03 2019 +0100 libmount: allow use -o together with --all For example: # mount --verbose --all -t xfs -o ro will mount all all XFS filesystems from fstab, but read-only. Signed-off-by: Karel Zak libmount/src/context_mount.c | 39 +++++++++++++++++++++++++++++++-------- sys-utils/mount.8 | 3 +++ 2 files changed, 34 insertions(+), 8 deletions(-) commit 7a56878d4b925a282a12917c30b46e4a464bcb07 Author: Karel Zak Date: Thu Oct 31 11:52:17 2019 +0100 libmount: move context fs merge to separate function Signed-off-by: Karel Zak libmount/src/context.c | 74 ++++++++++++++++++++++++++++---------------------- libmount/src/mountP.h | 2 ++ 2 files changed, 43 insertions(+), 33 deletions(-) commit e5d204440758d23b5432d86099334db626f3d172 Author: Karel Zak Date: Thu Oct 31 10:34:12 2019 +0100 libmount: fix mnt_context_next_remount() The current implementation works, but the remount operation is done in the cloned context and the original context (and calling application) has no information about the final status/errors. This is mistake. This new implementation works like mnt_context_next_mount(), it means the same context (as used by application) is reused for all remounts. The original setting is restored by mnt_context_apply_template(). Signed-off-by: Karel Zak libmount/src/context_mount.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) commit e83c09d49e52eadf1715e682c547b0ff9744983e Author: Karel Zak Date: Thu Oct 31 10:31:53 2019 +0100 libmount: save current FS setting as template This commit adds new functions to save and reuse the current FS setting (mount options from command line, etc) after context reset. It's usable for example in "mount --all" when we use the same context for more times for more mount operations. Signed-off-by: Karel Zak libmount/src/context.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ libmount/src/mountP.h | 5 ++++ 2 files changed, 74 insertions(+) commit 7cbde881854367173d8c493b1a4ac9c2d5cdb632 Author: Karel Zak Date: Wed Oct 23 13:00:40 2019 +0200 libfdisk: consolidate strdup() use Signed-off-by: Karel Zak libfdisk/src/context.c | 16 +++-------- libfdisk/src/partition.c | 71 +++++++++++++++++------------------------------- libfdisk/src/parttype.c | 25 ++--------------- libfdisk/src/script.c | 12 +++++--- 4 files changed, 40 insertions(+), 84 deletions(-) commit eee7ea558cde4dc9d00a9dfa3aca1ac55cef0798 Author: Karel Zak Date: Wed Oct 23 12:30:19 2019 +0200 libmount: use strdup_between_structs() Signed-off-by: Karel Zak libmount/src/context.c | 6 +++--- libmount/src/fs.c | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) commit 787226dc28a5c1ec136210f5e82060be4bde3907 Author: Karel Zak Date: Wed Oct 23 12:28:09 2019 +0200 include/strutils: add strdup_between_structs() * improve strdup_to_offset() readability * add strdup_between_offsets() and strdup_between_structs() to have better support for use-cases when we copy structs Signed-off-by: Karel Zak include/strutils.h | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) commit 779e3c97aa5ff1c1ebeb39d310757d6c24739a80 Author: Karel Zak Date: Wed Oct 23 12:02:33 2019 +0200 libmount: cleanup strdup() use in context, add reg.test * don't ignore strdup() result * cleanup mnt_context_prepare_helper() to have only one return point (due to mnt_context_switch_ns()) * add mnt_context_prepare_helper() test program Signed-off-by: Karel Zak libmount/src/context.c | 104 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 74 insertions(+), 30 deletions(-) commit b231e0f71c837680d4fdc49b5bb896bc222bf14d Author: Karel Zak Date: Tue Oct 22 13:37:12 2019 +0200 mount: add --target-prefix Signed-off-by: Karel Zak sys-utils/mount.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 71ed3b833787160e14744b304f658871a0c836a1 Author: Karel Zak Date: Tue Oct 22 13:35:05 2019 +0200 libmount: add target prefix support * add set/get functions to context * use prefix to detect already mounted filesystems * use prefix when prepare target path Signed-off-by: Karel Zak libmount/docs/libmount-sections.txt | 2 ++ libmount/src/context.c | 69 +++++++++++++++++++++++++++++++++++-- libmount/src/libmount.h.in | 2 ++ libmount/src/libmount.sym | 5 +++ libmount/src/mountP.h | 6 ++++ libmount/src/tab.c | 66 +++++++++++++++++++++++------------ 6 files changed, 125 insertions(+), 25 deletions(-) commit eea06b92dc384d4a3baf0090c484e98e5705bf62 Author: Karel Zak Date: Tue Oct 29 13:12:18 2019 +0100 lsblk: never fallback to udev/blkid on --sysroot Signed-off-by: Karel Zak misc-utils/lsblk-properties.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) commit 05842a92d891ddc883bf37280937fccde7eaac31 Author: Karel Zak Date: Tue Oct 29 12:59:08 2019 +0100 libmount: don't use /proc/mounts fallback if filename specified The current solution is to use /proc/mounts if previous attempt to open /proc/self/mountinfo failed. The fallback should not be used when mount table path is explicitly specified by application. The default is NULL, only in this case libmount should be try to be smart. Reported-by: Alasdair G Kergon Signed-off-by: Karel Zak libmount/src/tab_parse.c | 4 ++++ 1 file changed, 4 insertions(+) commit bdc3cc65abb9dde8c5df2462fbb17be86e6da0fa Author: Karel Zak Date: Tue Oct 29 10:04:29 2019 +0100 su: fix error message Reported-by: Pedro Albuquerque Signed-off-by: Karel Zak login-utils/su-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c07c41cd5fc0579fd9e11417b4ac97bffc2716fe Merge: 2bbc96228 a43665128 Author: Karel Zak Date: Wed Oct 23 13:14:45 2019 +0200 Merge branch 'blkid-sparc' of https://github.com/mator/util-linux * 'blkid-sparc' of https://github.com/mator/util-linux: tests: fixes blkid/md-raidX-whole on Sparc commit a43665128cf8942a61920524e14b3a0b5827ce6d Author: Anatoly Pugachev Date: Wed Oct 23 11:26:19 2019 +0300 tests: fixes blkid/md-raidX-whole on Sparc Since SPARC is using 'sun' partition table by default, make test not to assume that disk has 'dos' partition table, so write 'dos' partition table on disk, before proceeding any further. Signed-off-by: Anatoly Pugachev tests/expected/blkid/md-raid0-whole | 2 -- tests/expected/blkid/md-raid1-whole | 2 -- tests/ts/blkid/md-raid0-whole | 7 +++++++ tests/ts/blkid/md-raid1-whole | 7 +++++++ 4 files changed, 14 insertions(+), 4 deletions(-) commit 2bbc96228843320a825c4e0311b2dd8a77d7b533 Author: Vladimir Slavik Date: Thu Oct 17 13:45:48 2019 +0200 lsblk: update man description of -f / --fs for current columns see lsblk.c line 1930 misc-utils/lsblk.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b2a1a69155c04d602801f7ab346a2b00ab895f43 Author: Patrick Steinhardt Date: Thu Oct 17 08:00:31 2019 +0200 lib/path: fix missing header for `struct stat` In commit b1418ed14 (lib/path: add ul_path_stat(), fix absolute paths, 2019-10-15), a new function `ul_path_stat()` was added to "path.h". This new function prototype causes a compiler warning on musl libc based systems due to one of the parameters having the unknown type `struct stat` due to the header not being included. Fix the warning by including the header. Signed-off-by: Patrick Steinhardt include/path.h | 1 + 1 file changed, 1 insertion(+) commit c8a5422a7a1050a8647d1f320913ed17428485b0 Merge: b2de475c6 a76cd5f6a Author: Karel Zak Date: Thu Oct 17 11:03:16 2019 +0200 Merge branch 'master' of https://github.com/smvoss/util-linux * 'master' of https://github.com/smvoss/util-linux: wipefs: Allow explicitly enable/disablement commit b2de475c6729e2eb0f492b9d9d158c143b318cd0 Author: Merlin Büge Date: Thu Oct 17 06:45:22 2019 +0200 mount: (man) small typo fixes sys-utils/mount.8 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 43db339b9adc19c162ca70a25a221fe2e9316a9c Author: Karel Zak Date: Thu Oct 17 10:54:15 2019 +0200 docs: remove implemented TODO items Signed-off-by: Karel Zak Documentation/TODO | 19 ------------------- sys-utils/mount.c | 7 ------- 2 files changed, 26 deletions(-) commit 70ff760d416adcb182b191f9efbc92b8a3d8f095 Author: Karel Zak Date: Thu Oct 17 10:41:39 2019 +0200 login: reduce file-descriptors cleanup overhead Addresses: https://github.com/karelzak/util-linux/issues/883 Signed-off-by: Karel Zak login-utils/login.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 488f65fcb819e20d2e6c611597bde40b911a8212 Author: Karel Zak Date: Thu Oct 17 10:36:27 2019 +0200 lib/fileutils: add close_all_fds() The classic way which is based on file-descriptors table size is pretty expensive (due to table size) and forces code to do many unnecessary close() calls. It seems better to use /proc/self/fds and close used descriptors only. Addresses: https://github.com/karelzak/util-linux/issues/883 Signed-off-by: Karel Zak include/fileutils.h | 2 ++ lib/fileutils.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 70 insertions(+), 8 deletions(-) commit 93c2723772ed22b4950c35a5b918a12dc35bc1ae Author: Karel Zak Date: Tue Oct 15 13:29:13 2019 +0200 tests: (lsblk) gather also udev attributes for new dumps References: 7408a5d9c2e0bb20ac0660ead16b787825ef240e Signed-off-by: Karel Zak tests/ts/lsblk/mk-input.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 6f74ede50aaa6a7471e5a123cacbaaf147e0578c Author: Karel Zak Date: Tue Oct 15 13:08:09 2019 +0200 lsblk: read also GROUP,OWNER and MODE from dumps Signed-off-by: Karel Zak misc-utils/lsblk-properties.c | 11 ++++++++++ misc-utils/lsblk.8 | 3 ++- misc-utils/lsblk.c | 50 +++++++++++++++++++++++++++---------------- misc-utils/lsblk.h | 6 ++++++ 4 files changed, 50 insertions(+), 20 deletions(-) commit 7408a5d9c2e0bb20ac0660ead16b787825ef240e Author: Karel Zak Date: Tue Oct 15 12:36:16 2019 +0200 lsblk: on --sysroot read attributes from /dev/ text file The option --sysroot is used to read information from dumps rather than from the current system. This patch allows to read also udev attributes from text file in location /sysroot/dev/. The file is text file in format NAME=value\n. Suggested-by: Alasdair G Kergon Signed-off-by: Karel Zak misc-utils/lsblk-properties.c | 109 +++++++++++++++++++++++++++++++++++++++++- misc-utils/lsblk.h | 3 +- 2 files changed, 110 insertions(+), 2 deletions(-) commit b1418ed14691567b4b1d6fc8b465821e3b060d5d Author: Karel Zak Date: Tue Oct 15 11:59:16 2019 +0200 lib/path: add ul_path_stat(), fix absolute paths * add ul_path_stat() * make sure all paths for ul_path_..() functions are always interpreted relatively to the context directory and prefix. This is difference between ul_path_ API and standard libc "at" functions. We do not use any exception for absolute paths. The reason is that we need to read from prefixed paths although application assume absolute path (/dev/sda1 means /prefix/dev/sda1 if a /prefix is defined). Signed-off-by: Karel Zak include/path.h | 1 + lib/path.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 52 insertions(+), 11 deletions(-) commit a76cd5f6abace269b60ef6f1b95526a2d09fd331 Author: Sam Voss Date: Mon Oct 14 21:19:16 2019 -0500 wipefs: Allow explicitly enable/disablement Currently if `--disable-all-packages` is set, there is no configure option for re-enabling `wipefs`. As the current default for `wipefs` is "enabled", add `--disable-` flag to maintain backward compatibility. Signed-off-by: Sam Voss configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 9ae113ca7343ba7d0a9c0c2e8eb572f811b31262 Author: Masami Hiramatsu Date: Fri Oct 11 16:15:35 2019 +0900 libmount: Add libselinux dependency to pkgconfig file Add libselinux dependency to libmount if it is compiled with selinux support. Without this fix, 'pkg-config --libs --static mount' doesn't show libselinux related options. Signed-off-by: Masami Hiramatsu Makefile.am | 6 ++++++ libmount/mount.pc.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) commit 6f00af5b3c7aadd1322424a84661cfdac83146eb Author: John Garry Date: Tue Oct 8 21:12:21 2019 +0800 lscpu: Add HiSilicon aarch64 tsv110 cpupart Add an entry for the HiSilicon aarch64 part tsv110. Another known alias for this part is TaishanV110, and it can be found in the Kunpeng920/Hi1620 SoC. Signed-off-by: John Garry sys-utils/lscpu-arm.c | 6 ++++++ 1 file changed, 6 insertions(+) commit a174eefb41a2ce8b467bb7e1546953c8bd1223dd Author: Stanislav Brabec Date: Thu Oct 10 01:08:25 2019 +0200 nologin: Prevent error from su -c "su -c" can pass "-c" to nologin. It causes ugly error: su -c "echo OK" - man -nologin: invalid option -- 'c' Try '-nologin --help' for more information. Accept -c to prevent this error. Signed-off-by: Josef Cejka Signed-off-by: Stanislav Brabec login-utils/nologin.8 | 11 +++++++++-- login-utils/nologin.c | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) commit a72a19865d72481c2dd40110919863121cc644bd Author: Karel Zak Date: Thu Oct 10 09:07:10 2019 +0200 tests: add missing 'ts_check_prog xz' Signed-off-by: Karel Zak tests/ts/blkid/iso-partitions | 1 + tests/ts/hardlink/options | 2 ++ 2 files changed, 3 insertions(+) commit 52e9e94ea3c1d9df7b7ded7ad2f00b4c223493a6 Author: Karel Zak Date: Thu Oct 10 08:57:30 2019 +0200 lib/pty-session: fix compilation lib/test_pty-monotonic.o: In function `get_boot_time': /home/travis/build/karelzak/util-linux/lib/monotonic.c:29: undefined reference to `clock_gettime' lib/test_pty-monotonic.o: In function `gettime_monotonic': /home/travis/build/karelzak/util-linux/lib/monotonic.c:56: undefined reference to `clock_gettime' Signed-off-by: Karel Zak lib/Makemodule.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4abb659c185cd545dc9799815668f5fe179941ec Author: Karel Zak Date: Wed Oct 9 16:57:24 2019 +0200 tests: remove device name from blkdiscard output Signed-off-by: Karel Zak tests/expected/blkdiscard/offsets.err | 40 +++++++++++++++++------------------ tests/ts/blkdiscard/offsets | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) commit b1154c4ece2192345efe1a3fb835ae28c8f92154 Author: Karel Zak Date: Wed Oct 9 16:43:50 2019 +0200 script: fix signalfd use It's necessary to create signal-fd before fork() to get SIGCHLD, because child could be faster than our code. Signed-off-by: Karel Zak lib/pty-session.c | 74 ++++++++++++++++++++++++++---------------- term-utils/script.c | 8 ++--- tests/ts/script/buffering-race | 3 +- 3 files changed, 52 insertions(+), 33 deletions(-) commit 125314c04adcbee8281b95ef8018d9468313b9ff Author: Karel Zak Date: Wed Oct 9 15:07:49 2019 +0200 script: add debug messages around waitpid() Signed-off-by: Karel Zak lib/pty-session.c | 5 ++++- tests/ts/script/buffering-race | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) commit 406fb25387870d434f61f6970c165fc576b68a98 Author: Karel Zak Date: Wed Oct 9 12:57:10 2019 +0200 tests: add --parsable, remove TS_OPT_parsable * don't enable parsable for non-parallel executions in travis * add --parsable to run.sh * use --parsable rather than TS_OPT_ in travis Signed-off-by: Karel Zak .travis-functions.sh | 7 +++---- tests/Makemodule.am | 4 ++-- tests/run.sh | 10 ++++++---- 3 files changed, 11 insertions(+), 10 deletions(-) commit 060c4cee0f907cd90b5c0f45190b0b9576b1623e Author: Karel Zak Date: Wed Oct 9 12:31:28 2019 +0200 build-sys: cleanup prefixed used for tests It's ugly to use the same TS_ prefix in tests as well as in build-system (e.g. make check), because then some env. variable can be interpreted by our regression tests. For example TS_PARALLEL=. It's seems better to use TS_ exclusively for tests and TESTS_ for build-system. Signed-off-by: Karel Zak .travis-functions.sh | 22 ++++++++++++++++++---- tests/Makemodule.am | 14 ++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) commit 571f5f5ba1eadc9fec48936f90cd23399a0638f7 Author: Karel Zak Date: Wed Oct 9 12:01:57 2019 +0200 build-sys: support 'none' for parallel tests Signed-off-by: Karel Zak .travis-functions.sh | 2 +- tests/run.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) commit 1740d29cdd04432a894f22f9ceaa8882dce5e5a1 Author: Karel Zak Date: Wed Oct 9 11:36:52 2019 +0200 travis: force non-parallel for root Signed-off-by: Karel Zak .travis-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4c791d127f59a1a60dd08fad758dea8c15870f90 Author: Karel Zak Date: Wed Oct 9 10:02:10 2019 +0200 build-sys: fix typo Signed-off-by: Karel Zak term-utils/Makemodule.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ac543a15b6da4e00157f3a65582ccfbe81c7c49b Author: Karel Zak Date: Wed Oct 9 09:55:27 2019 +0200 travis: don't call tests in parallel for root Let's make it more readable in logs for root user. Signed-off-by: Karel Zak .travis-functions.sh | 11 +++++++++-- tests/Makemodule.am | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) commit 9e9b3d65dc4ad5065e522ba5ece32a68ae35092f Author: Karel Zak Date: Tue Oct 8 14:20:39 2019 +0200 script: cleanup logs freeing Signed-off-by: Karel Zak term-utils/script.c | 62 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 12 deletions(-) commit 1401181a19dfb00a210ba6cdb9a417c204aec02a Author: Karel Zak Date: Mon Oct 7 12:35:00 2019 +0200 scriptlive: remove unnecessary variables ul_pty code is able to do all necessary things for us, so don't waste effort and keep the child variable in main() only. Signed-off-by: Karel Zak term-utils/scriptlive.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) commit 8cf448e9b65c25f4d8b0c495725288ce7bb511a1 Author: Karel Zak Date: Mon Oct 7 12:30:16 2019 +0200 lib/pty-session: simplify example/test code Signed-off-by: Karel Zak lib/pty-session.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) commit bdd43357062e7c84a4c9d60516c0f4cb28aedf1d Author: Karel Zak Date: Mon Oct 7 12:24:43 2019 +0200 lib/pty-session: make wait_child callback optional Now the code is duplicate on many places, but all we usually need is to remember child status. It seems good enough to have very simple callback child_die() to inform application about a change. The patch also add PID to all signal related callbacks. Signed-off-by: Karel Zak include/pty-session.h | 16 ++++-- lib/pty-session.c | 121 +++++++++++++++++++++++++--------------------- login-utils/su-common.c | 6 ++- term-utils/script.c | 56 ++++++--------------- term-utils/scriptlive.c | 51 ++++++------------- term-utils/scriptreplay.c | 2 +- 6 files changed, 112 insertions(+), 140 deletions(-) commit ec10634e7ec41c05865f04aa8a62ec854dd66b9d Author: Karel Zak Date: Thu Oct 3 14:33:25 2019 +0200 script: use lib/pty-session This patch consolidate pseudo-terminal stuff in util-linux. From now there is only one implementation used in su(1) --pty, scriptlive(1) and script(1). The new stuff is based on the original script(1) -- it means poll() and signalfd() based. Note that script(1) code does not provide fallback for systems/libc where is no openpty(). Signed-off-by: Karel Zak configure.ac | 2 +- term-utils/Makemodule.am | 10 +- term-utils/script.c | 832 ++++++++++++----------------------- tests/expected/script/buffering-race | 4 +- tests/expected/script/replay | 4 +- 5 files changed, 286 insertions(+), 566 deletions(-) commit f3e55e3e7c5cea9c2b632175b84e643a23e198da Author: Karel Zak Date: Thu Oct 3 13:28:37 2019 +0200 scriptlive: translate error messages too Signed-off-by: Karel Zak term-utils/scriptlive.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 4f7f723b319cf0d45e946cbf4ac3c91367c645c2 Author: Karel Zak Date: Thu Oct 3 13:23:41 2019 +0200 lib/pty-session: add loggin callback to code, follow return codes Signed-off-by: Karel Zak include/pty-session.h | 2 +- lib/pty-session.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) commit 04f0c95f9332c00da649fe02ab8aa7b58d855c37 Author: Karel Zak Date: Wed Oct 2 17:34:51 2019 +0200 lib/pty-session: add log callbacks Signed-off-by: Karel Zak include/pty-session.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) commit cb4631fc52af4d0e0a67f06c4cd6fd2fc5e85b12 Author: Karel Zak Date: Wed Oct 2 16:55:15 2019 +0200 scriptlive: add man page Signed-off-by: Karel Zak term-utils/script.1 | 3 +- term-utils/scriptlive.1 | 97 +++++++++++++++++++++++++++++++++++++++++++++++ term-utils/scriptreplay.1 | 5 ++- 3 files changed, 102 insertions(+), 3 deletions(-) commit fc176b0e2ff6b85a997ec89dc01caad399d87c10 Author: Karel Zak Date: Wed Oct 2 16:13:25 2019 +0200 scriptreplay: fix io data log use Signed-off-by: Karel Zak term-utils/script-playutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit d51f8ec129a74d40a0651f7374f2755d0024e361 Author: Karel Zak Date: Wed Oct 2 14:22:12 2019 +0200 scriptreplay: make data log file optional for --summary Signed-off-by: Karel Zak term-utils/script.1 | 6 +++++- term-utils/scriptreplay.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) commit 467aa4c1c017935d16e600db953936f949e48e36 Author: Karel Zak Date: Wed Oct 2 14:05:01 2019 +0200 script: fix man page on --logging-format Signed-off-by: Karel Zak term-utils/script.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c4bacbd115868ea3a15967da4e6fa8507b306b25 Author: Karel Zak Date: Fri Aug 9 10:22:27 2019 +0200 lib/pty-session: improve debug messages Signed-off-by: Karel Zak lib/pty-session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 263835e82442a6bfe64c79bcdc97aa5d50fa10fb Author: Karel Zak Date: Thu Aug 8 15:36:04 2019 +0200 scriptlive: free resource at the and Signed-off-by: Karel Zak term-utils/script-playutils.c | 13 ++++++++++++- term-utils/script-playutils.h | 2 +- term-utils/scriptlive.c | 6 +++--- term-utils/scriptreplay.c | 2 ++ 4 files changed, 18 insertions(+), 5 deletions(-) commit ab61a038814e6a4fe618792e791b12afa7f87891 Author: Karel Zak Date: Thu Aug 8 15:34:00 2019 +0200 lib/pty: save sigmask, add API to free all resources Signed-off-by: Karel Zak include/pty-session.h | 2 +- lib/pty-session.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) commit 46737a73328c9d25cf152ccb2cb2c73139cf0629 Author: Karel Zak Date: Thu Aug 8 15:32:13 2019 +0200 su: (pty) remove unnecessary call The pty code has to save the original signal mask without application assistance. Signed-off-by: Karel Zak login-utils/su-common.c | 3 --- 1 file changed, 3 deletions(-) commit 63869b842f12b12a2c9f3daa16643ca82fa7eb11 Author: Karel Zak Date: Thu Aug 8 15:08:14 2019 +0200 build-sys: fix build with pty Signed-off-by: Karel Zak login-utils/Makemodule.am | 10 ++++++---- term-utils/Makemodule.am | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) commit 984082fa8538383f5d1a8260e5a58debbaef517a Author: Karel Zak Date: Wed Jul 31 11:57:26 2019 +0200 lib/pty: reset mainloop timeout on signal Signed-off-by: Karel Zak lib/pty-session.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit a33f1fc432fede653e7ee58bacfee76441af2e71 Author: Karel Zak Date: Tue Jul 30 14:59:34 2019 +0200 scriptreplay: add -T, --log-timing Add alias to -t,--timing to make it easy to copy and past script(1) comnand line to scriptlive(1) and scriptreplay(1) command lines. For example: record: $ script --log-timing tm --log-in in print: $ scriptreplay --log-timing tm --log-in in re-run: $ scriptlive --log-timing tm --log-in in And command line is still the same. Signed-off-by: Karel Zak term-utils/scriptlive.c | 5 ++++- term-utils/scriptreplay.1 | 5 +++++ term-utils/scriptreplay.c | 12 ++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) commit 37a11e1a3dc33ed2c330a4952c22c51b636a6beb Author: Karel Zak Date: Tue Jul 30 14:32:13 2019 +0200 scriptlive: run shell in PTY After this change shell executed by scriptlive(1) is going to behave like shell in script(1). It means that the shell stdin is a pseudo-terminal rather than pipe. This allows live replay of interactive applications, ssh sessions, etc. Signed-off-by: Karel Zak configure.ac | 4 +- term-utils/Makemodule.am | 7 +- term-utils/scriptlive.c | 274 ++++++++++++++++++++++++++++++----------------- 3 files changed, 186 insertions(+), 99 deletions(-) commit 4d5b2fed8ff6d3678a179bb3396bec7701720217 Author: Karel Zak Date: Tue Jul 30 14:29:20 2019 +0200 lib/pty: allow use callback from mainloop This allows to control mainloop behavior from PTY applications. For example you can write to child (shell) process independently on the current stdin. Signed-off-by: Karel Zak include/pty-session.h | 8 ++++++ lib/Makemodule.am | 3 +- lib/pty-session.c | 80 +++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 81 insertions(+), 10 deletions(-) commit a46e54583d13b0bd79a6de27310ccbdbcc4cbc72 Author: Karel Zak Date: Tue Jul 30 14:27:51 2019 +0200 scriptreplay: (utils) detect empty steps Signed-off-by: Karel Zak term-utils/script-playutils.c | 7 +++++++ term-utils/script-playutils.h | 1 + 2 files changed, 8 insertions(+) commit b639c2a39be29a0e016cd08a2a66c583b7f978a3 Author: Karel Zak Date: Mon Jul 29 12:50:17 2019 +0200 scriptreplay: use struct timeval for delay * use timeval rather than double for delay * use sys/time.h macros for wirk with timeval * add delay normalization to script-playutils.c API Signed-off-by: Karel Zak term-utils/script-playutils.c | 104 ++++++++++++++++++++++++++++++++++-------- term-utils/script-playutils.h | 6 ++- term-utils/scriptreplay.c | 45 +++++++++--------- 3 files changed, 114 insertions(+), 41 deletions(-) commit a1cc831b594b16800468aaf9eac7262bbfcc27ec Author: Karel Zak Date: Mon Jul 29 12:43:06 2019 +0200 cript: always use decimal point numbers in logs The new header/info lines in log uses 0, but it's unexpected by scriptreplay as there was always number formatted by %f. Signed-off-by: Karel Zak term-utils/script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8ef57fdf137c40f33169e45a359ea156bcba9bf7 Author: Karel Zak Date: Mon Jul 29 12:10:22 2019 +0200 script: add missing exit() Signed-off-by: Karel Zak term-utils/script.c | 2 ++ 1 file changed, 2 insertions(+) commit b923bdbe528e449c62a96c7ed483673a7951c4ab Author: Karel Zak Date: Thu Jul 4 11:59:23 2019 +0200 su: use lib/pty-session.c code for --pty Signed-off-by: Karel Zak login-utils/Makemodule.am | 8 +- login-utils/su-common.c | 428 ++++++---------------------------------------- 2 files changed, 63 insertions(+), 373 deletions(-) commit 6954895cae3413f587ad77afe2206d31a151334f Author: Karel Zak Date: Thu Jul 4 11:57:11 2019 +0200 lib/pty-session: add generic PTY container code The idea is to consolidate script(1), scriptlive(1) and su(1) --pty and use the same code everywhere. TODO: add callbacks for stdin/out logging (necessary for script(1)). Signed-off-by: Karel Zak configure.ac | 7 + include/pty-session.h | 53 +++++ lib/Makemodule.am | 9 +- lib/pty-session.c | 586 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 654 insertions(+), 1 deletion(-) commit 33869e5ac0534ac6c2a7a33a274642b07b030e25 Author: Karel Zak Date: Tue Jul 2 17:03:53 2019 +0200 scriptlive: add new command to re-execute script(1) typescript The old good scriptreplay(1) just display your recorded session, the scriptlive(1) uses stdin typescript (from new script(1)) to execute your commands again. Signed-off-by: Karel Zak .gitignore | 1 + configure.ac | 3 + term-utils/Makemodule.am | 9 ++ term-utils/script.c | 1 - term-utils/scriptlive.c | 299 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 312 insertions(+), 1 deletion(-) commit 12352c967c6a069677a02883e58231194bd57ee0 Author: Karel Zak Date: Mon Jul 1 15:00:52 2019 +0200 scriptreplay: move all utils to script-playutils.{c,h} Signed-off-by: Karel Zak term-utils/Makemodule.am | 4 +- term-utils/script-playutils.c | 484 ++++++++++++++++++++++++++++++++++++++++ term-utils/script-playutils.h | 45 ++++ term-utils/scriptreplay.c | 499 ++---------------------------------------- 4 files changed, 555 insertions(+), 477 deletions(-) commit 4a4f4a6260dec16b849125458bd3668a82f6db49 Author: Karel Zak Date: Fri Jun 28 10:19:40 2019 +0200 scriptreplay: add --summary Signed-off-by: Karel Zak term-utils/scriptreplay.1 | 6 ++++++ term-utils/scriptreplay.c | 31 ++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) commit 70c2cd9a60d83af79f6c172426617481b548bc46 Author: Karel Zak Date: Fri Jun 28 10:01:29 2019 +0200 script: add more information to timing log Let's record also exit code, duration and start time. Signed-off-by: Karel Zak term-utils/script.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) commit f923a595962786ed20c455ed4e18f79d242b897e Author: Karel Zak Date: Fri Jun 28 10:00:53 2019 +0200 scriptreplay: check for EOF Signed-off-by: Karel Zak term-utils/scriptreplay.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit fd42a45bea030bb2f027b1a69648ae35581e95b3 Author: Karel Zak Date: Thu Jun 27 14:02:47 2019 +0200 script: cleanup info logging Signed-off-by: Karel Zak term-utils/script.c | 59 +++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 27 deletions(-) commit 7c4a374f637bfb321acf18b082b79f802313081a Author: Karel Zak Date: Wed Jun 26 17:32:49 2019 +0200 scriptreplay: print info and signals Signed-off-by: Karel Zak term-utils/scriptreplay.c | 136 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 113 insertions(+), 23 deletions(-) commit 3cecd1761008588aff338e009c7eb777f9060f9d Author: Karel Zak Date: Wed Jun 26 17:32:18 2019 +0200 script: log additional information Signed-off-by: Karel Zak term-utils/script.c | 100 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 82 insertions(+), 18 deletions(-) commit 23afadca57cb68ba4f6fead08b23f6fe6910c9e3 Author: Karel Zak Date: Wed Jun 26 16:47:24 2019 +0200 include/strutils: add strrealloc() include/strutils.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) commit 6646f9f896576665ffd4a4828c49be7b11dc288c Author: Karel Zak Date: Wed Jun 26 12:27:34 2019 +0200 scriptreplay: make sure timing file specified Signed-off-by: Karel Zak term-utils/scriptreplay.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit fbed5507da99a76cba52722a6cfbf20387a9e82b Author: Karel Zak Date: Mon Jun 24 12:45:44 2019 +0200 script: write signals to timing file Signed-off-by: Karel Zak term-utils/script.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) commit 7031577246906bcfdf9e336ca6d901a425707073 Author: Karel Zak Date: Thu Jun 20 13:19:56 2019 +0200 scriptreplay: add --stream to the man page Signed-off-by: Karel Zak term-utils/scriptreplay.1 | 5 +++++ 1 file changed, 5 insertions(+) commit 88b8e9bffd148441c77ea61d03bbf6106da45339 Author: Karel Zak Date: Thu Jun 20 13:08:00 2019 +0200 scriptreplay: add --cr-mode The stdin log does not contain line breaks as command line uses CR between commands. This makes scriptreplay for stdin very user-unfriendly, because it overwrites still the same line. The new option --cr-mode provides opportunity to control this behavior. The default for stdin logs is replace CR with line-break. Signed-off-by: Karel Zak term-utils/scriptreplay.1 | 6 +++++ term-utils/scriptreplay.c | 62 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 63 insertions(+), 5 deletions(-) commit cf0609a3ea0165aa775ab83e905b64ee32fc7f8c Author: Karel Zak Date: Thu Jun 20 12:48:21 2019 +0200 scriptreplay: (man) add missing --log-* oprions Signed-off-by: Karel Zak term-utils/scriptreplay.1 | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) commit 4f4bac42d8c88c9623beab68aab49e61e2908716 Author: Karel Zak Date: Thu Jun 20 12:00:07 2019 +0200 scriptreplay: fix error path Signed-off-by: Karel Zak term-utils/scriptreplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 41ce6545d2288d7e2f57c823ac097d5e8efefdac Author: Karel Zak Date: Thu Jun 20 11:52:13 2019 +0200 scriptreplay: add --stream Let's allow to specify stream, default to entry type according to the command line options. Signed-off-by: Karel Zak term-utils/scriptreplay.c | 70 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 15 deletions(-) commit d628e9cf7c4507232cc59467516b0a0a633fe06c Author: Karel Zak Date: Thu Jun 20 11:50:15 2019 +0200 script: default to new format when new features expected The old format should be the default for stdout only. Signed-off-by: Karel Zak term-utils/script.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 0d955cd8ac75f3da301e0adf89d46ba39045a7e9 Author: Karel Zak Date: Thu Jun 20 10:45:14 2019 +0200 scriptreplay: add --log-{in,out,io} options Signed-off-by: Karel Zak term-utils/scriptreplay.c | 73 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 19 deletions(-) commit 02a51ce1e3d8cd7b7d41fc8d84018f421b1aa553 Author: Karel Zak Date: Wed Jun 19 15:56:58 2019 +0200 scriptreplay: cleanup usage() Signed-off-by: Karel Zak term-utils/scriptreplay.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit daee4d95aea711cf77c1e86ed52864d1241c49d3 Author: Karel Zak Date: Wed Jun 19 15:47:44 2019 +0200 script: add --logging-format Signed-off-by: Karel Zak term-utils/script.1 | 19 ++++++++++++++----- term-utils/script.c | 20 +++++++++++++++++--- 2 files changed, 31 insertions(+), 8 deletions(-) commit 7d5617c409a00adb76f5656c6e106e171a7ec0fb Author: Karel Zak Date: Wed Jun 19 13:05:46 2019 +0200 script: add note about --log-in and passwords Signed-off-by: Karel Zak term-utils/script.1 | 4 ++++ 1 file changed, 4 insertions(+) commit 65dc24abac73f21b9bf495a1e6fe5eec0b2414a7 Author: Karel Zak Date: Wed Jun 19 12:55:02 2019 +0200 script: make --help more readable Signed-off-by: Karel Zak term-utils/script.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 167a485172dff0d22ebd6be9816879ecec7e4546 Author: Karel Zak Date: Tue Apr 23 17:07:50 2019 +0200 scriptreplay: skip unwanted steps Signed-off-by: Karel Zak term-utils/scriptreplay.c | 82 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 24 deletions(-) commit 36b1369bdffc3d087647930fac72312f1909d933 Author: Karel Zak Date: Tue Apr 23 17:06:29 2019 +0200 script: add multistream timing file initialization Signed-off-by: Karel Zak term-utils/script.c | 1 + 1 file changed, 1 insertion(+) commit fec06a063e5e3a3cea94d4d4cd42ee3c752a0932 Author: Karel Zak Date: Tue Apr 23 14:41:20 2019 +0200 scriptreplay: rewrite to support new timing file format * add internal support for multiple log files * add support for new timing file format (default is old format) Signed-off-by: Karel Zak term-utils/script.c | 9 ++ term-utils/scriptreplay.c | 389 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 331 insertions(+), 67 deletions(-) commit 88025c74e33676966eae39fcd0fb4bbced8f3db7 Author: Karel Zak Date: Thu Apr 18 13:21:05 2019 +0200 script: remove unused variable Signed-off-by: Karel Zak term-utils/script.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit c1c2ee0b3afec6e05d044b611362d9a5a6966467 Author: Karel Zak Date: Fri Apr 12 16:27:54 2019 +0200 script: support multi-stream logging * allow to use --log-in and --log-out in the same time * add --log-io to log stdout and stdin to the one log file * introduce a new timing file format with entry type identifirs I : info about input stream O : info about output stream in the next commits it's possible to add 'S' for signals and 'H' for extra (header) information. * the new file format is optional and enabled only if multiple streams logging is requested. Signed-off-by: Karel Zak term-utils/script.1 | 29 +++++++++++++++++++---- term-utils/script.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 84 insertions(+), 13 deletions(-) commit 70062aad13552c9508b73f61c6dd157e61603a99 Author: Karel Zak Date: Fri Apr 12 14:14:55 2019 +0200 script: add --log-in Let's allow to log input independently on output. So it's possible to script --log-in infile : logs only input script --log-out outfile : logs only output script --log-out outfile --log-in infile : logs both to separated files Signed-off-by: Karel Zak term-utils/script.1 | 12 ++++++++++-- term-utils/script.c | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 16 deletions(-) commit fc58044f795f49325213b28f27205cf149691b31 Author: Karel Zak Date: Fri Apr 12 12:47:03 2019 +0200 script: add option --log-timing The current -t[=] is pretty messy due to optional argument; and default is to output to stderr. The default output to stderr is very unusual semantic. This path makes the old -t deprecated. The new option -T, --log-timing requires the file name. Signed-off-by: Karel Zak term-utils/script.1 | 14 ++++++++++---- term-utils/script.c | 22 ++++++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) commit ddbdb79256ee7129701aa22cc0eb30b3c417cbb0 Author: Karel Zak Date: Fri Apr 12 12:13:08 2019 +0200 script: add option --log-out Let's make script(1) command line more explicit about typescript file. Signed-off-by: Karel Zak term-utils/script.1 | 6 +++++- term-utils/script.c | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) commit c64963f87c8ac4cd16a6109e48bb430eafa85d11 Author: Karel Zak Date: Fri Apr 12 11:53:29 2019 +0200 script: cleanup usage Signed-off-by: Karel Zak term-utils/script.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit 9f822648519d76ed74dd5bb2f55a76f1fb0d96ea Author: Karel Zak Date: Fri Apr 12 11:40:52 2019 +0200 script: allow to use the same log for more streams The plan (for the next commits) is to use for example timing file for stdin as well as for stdout. Signed-off-by: Karel Zak term-utils/script.c | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) commit d805688afc0c709154c9c6f29383b175c05ffc92 Author: Karel Zak Date: Wed Apr 3 16:51:18 2019 +0200 script: report also timing file, do it only once Signed-off-by: Karel Zak term-utils/script.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) commit 4f7521d66c22c0ff34fd880c08fa946d6c9c5bee Author: Karel Zak Date: Wed Apr 3 16:36:43 2019 +0200 script: make optional argument more robust Signed-off-by: Karel Zak term-utils/script.c | 2 ++ 1 file changed, 2 insertions(+) commit 596f42027d7e9ff7486abe90cf38e3f6cbd6f44c Author: Karel Zak Date: Wed Apr 3 16:32:41 2019 +0200 script: log file usage refactoring This commit does not add any new feature. It just prepare code for future extensions only. * introduce two new structs: script_stream and script_log * define two streams: 'stdout' and 'stdin' * allow associate log files (type script or timing file) with the stream * support more log file formats Signed-off-by: Karel Zak term-utils/script.c | 374 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 244 insertions(+), 130 deletions(-) commit b3fc2a3c33905cc6871f99334e56221478d2609c Author: Karel Zak Date: Mon Oct 7 12:57:43 2019 +0200 hwclock: report rtc open() errors on --verbose Let's be more verbose and provide real open() error to make debugging easier on --verbose. For example: $ hwclock --verbose hwclock from util-linux 2.34.193-6bebea-dirty System Time: 1570445823.701266 Trying to open: /dev/rtc0 hwclock: cannot open /dev/rtc0: Permission denied <--- No usable clock interface found. hwclock: Cannot access the Hardware Clock via any known method. Addresses: https://github.com/karelzak/util-linux/issues/879 Signed-off-by: Karel Zak sys-utils/hwclock-rtc.c | 9 ++++++--- sys-utils/hwclock.c | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) commit 6bebea1b13991157552f8da3fa98c7a3a0eda0dc Merge: a7f958874 e7305e4ea Author: Karel Zak Date: Mon Oct 7 12:41:32 2019 +0200 Merge branch 'for-upstream/more-pseudofs' of https://github.com/dlitz/util-linux * 'for-upstream/more-pseudofs' of https://github.com/dlitz/util-linux: libmount: Recognize more FUSE pseudofs (avfsd, lxcfs, vmware-vmblock) commit a7f9588745f34f5973eecf33d1c7e8aec04666d2 Author: Jan Chren (rindeal) Date: Fri Oct 4 16:40:49 2019 +0200 po/update-potfiles: fallback to `find` when git doesn't work It allows to run po/update-potfiles not only in tarballs and git repositories, but in git snapshots as well. po/update-potfiles | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit e7305e4ea30406920fbf0d2cf7507c1e876a0d27 Author: Darsey Litzenberger Date: Wed Oct 2 17:29:05 2019 -0700 libmount: Recognize more FUSE pseudofs (avfsd, lxcfs, vmware-vmblock) General info about these filesystems: * fuse.avfsd: https://sourceforge.net/projects/avf/ * fuse.lxcfs: https://linuxcontainers.org/lxcfs/ * fuse.vmware-vmblock: https://github.com/vmware/open-vm-tools Signed-off-by: Darsey Litzenberger libmount/src/utils.c | 3 +++ 1 file changed, 3 insertions(+) commit 7b41ae5b4ecbff8c2a01da2cd29d858cdf33ed50 Author: Karel Zak Date: Tue Oct 1 13:17:03 2019 +0200 docs: add sfdisk --dump and --backup improvements to TODO Addresses: https://github.com/karelzak/util-linux/issues/850 Addresses: https://github.com/karelzak/util-linux/issues/852 Signed-off-by: Karel Zak Documentation/TODO | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 2bb3aa36b285fa0b2333c62ae77ef4b3bccfd98c Author: Elliott Mitchell Date: Wed Aug 28 16:25:57 2019 -0700 cleanup: Remove some spurious spaces Sorry detail-oriented people tend to wipe these out if they notice them. Add in automated tools and lots of excess end-of-line spaces get wiped out. Addresses: https://github.com/karelzak/util-linux/pull/849 Signed-off-by: Karel Zak Documentation/TODO | 10 +++--- Documentation/cal.txt | 4 +-- Documentation/example.files/motd | 2 +- Documentation/getopt_changelog.txt | 2 +- Documentation/howto-compilation.txt | 2 +- Documentation/howto-tests.txt | 6 ++-- Documentation/hwclock.txt | 2 +- Documentation/modems-with-agetty.txt | 6 ++-- Documentation/mount.txt | 2 +- Documentation/poeigl.txt | 58 +++++++++++++++---------------- Documentation/releases/v2.15-ReleaseNotes | 30 ++++++++-------- Documentation/releases/v2.17-ReleaseNotes | 10 +++--- Documentation/releases/v2.18-ReleaseNotes | 18 +++++----- Documentation/releases/v2.19-ReleaseNotes | 6 ++-- Documentation/releases/v2.20-ReleaseNotes | 8 ++--- Documentation/releases/v2.21-ReleaseNotes | 10 +++--- Documentation/releases/v2.22-ReleaseNotes | 14 ++++---- Documentation/releases/v2.23-ReleaseNotes | 14 ++++---- Documentation/releases/v2.25-ReleaseNotes | 14 ++++---- Documentation/releases/v2.28-ReleaseNotes | 2 +- Documentation/releases/v2.31-ReleaseNotes | 6 ++-- Documentation/releases/v2.33-ReleaseNotes | 12 +++---- Documentation/releases/v2.34-ReleaseNotes | 6 ++-- NEWS | 16 ++++----- disk-utils/cfdisk.8 | 2 +- disk-utils/fsck.8 | 2 +- disk-utils/mkfs.c | 2 +- disk-utils/mkfs.minix.c | 6 ++-- include/plymouth-ctrl.h | 2 +- libblkid/src/libblkid.sym | 2 +- libblkid/src/superblocks/bluestore.c | 2 +- libfdisk/src/gpt.c | 4 +-- libfdisk/src/iter.c | 2 +- libmount/python/fs.c | 2 +- libmount/src/libmount.sym | 2 +- login-utils/last.c | 2 +- login-utils/lslogins.1 | 2 +- login-utils/sulogin-consoles.h | 2 +- m4/ul.m4 | 2 +- misc-utils/blkid.8 | 2 +- misc-utils/fincore.c | 2 +- misc-utils/mcookie.c | 2 +- po/cs.po | 4 +-- po/da.po | 14 ++++---- po/it.po | 2 +- po/pt_BR.po | 2 +- sys-utils/adjtime_config.5 | 2 +- sys-utils/blkzone.8 | 2 +- sys-utils/dmesg.1 | 2 +- sys-utils/hwclock.c | 2 +- sys-utils/mount.c | 2 +- term-utils/setterm.c | 4 +-- tests/ts/cal/weekarg | 2 +- tests/ts/kill/kill_functions.sh | 2 +- tests/ts/libmount/update | 2 +- tests/ts/lsblk/lsblk | 2 +- tests/ts/lsblk/mk-input.sh | 2 +- tests/ts/lsmem/lsmem | 2 +- tests/ts/misc/flock | 4 +-- tests/ts/sfdisk/dos | 2 +- tests/ts/uuid/uuidgen | 2 +- tools/checkdecl.sh | 2 +- tools/checkincludes.pl | 2 +- tools/config-gen | 4 +-- tools/config-gen-functions.sh | 2 +- tools/ko-release-gen | 2 +- tools/ko-release-push | 2 +- 67 files changed, 186 insertions(+), 186 deletions(-) commit 1d84470388cb6b101a4ce1ecc079af9404bf052d Author: Karel Zak Date: Tue Oct 1 12:51:04 2019 +0200 libfdisk: (gpt) fix hybrid MBR detection, fix 'w' * current code overwrites hybrid MBR because EE partition is expected from fist sector, this is not true for hybrid MBR * print "The partition table has been altered." message also for nested contexts * remove "You have to sync the MBR manually" message Addresses: https://github.com/karelzak/util-linux/issues/851 Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 3 ++- libfdisk/src/context.c | 5 ++++- libfdisk/src/gpt.c | 23 +++++++++++++---------- 3 files changed, 19 insertions(+), 12 deletions(-) commit eb913f6b98c2198592341b38fd70cc061a8904b2 Author: Elliott Mitchell Date: Wed Aug 28 20:12:50 2019 -0700 fdisk: Correct handling of hybrid MBR The traditional MBR has pretty well NO limitations on slices. They can be a single misaligned sector if desired. While this is undesireable for most real world uses, for the few places they're still used extra limitations cause breakage not safety. Signed-off-by: Karel Zak libfdisk/src/dos.c | 62 +++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) commit 5c1c594ee5a9c443d42f835337bbaf162671b258 Author: Karel Zak Date: Mon Sep 30 13:11:17 2019 +0200 fdisk: use 'r' to return from MBR to GPT The current code uses 'M' to switch between MBR and GPT, but it's not intuitive to "go back" by 'M'. It seems more user-friendly to use 'r' as in another places (for example when go from expert menu or from BRD menu). The 'M' to return to GPT is still supported for backward compatibility. Addresses: https://github.com/karelzak/util-linux/pull/849 Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit 980a25f9c4b66165363909a83d14b7d7ee4de9d1 Author: Karel Zak Date: Mon Sep 30 12:25:17 2019 +0200 sfdisk: (move-data) improve MiB/s progress bar Signed-off-by: Karel Zak disk-utils/sfdisk.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) commit 52a1f767c0d6d400790deaaa93109090d6052fa6 Merge: 8e4d8767f 7ef86a089 Author: Karel Zak Date: Mon Sep 30 11:15:57 2019 +0200 Merge branch 'master' of https://github.com/dsd/util-linux * 'master' of https://github.com/dsd/util-linux: libblkid: improve handling of ISO files with partition tables commit 8e4d8767fd207024f0530523cad4bc59fcdd2661 Merge: 1c0761593 616f57d94 Author: Karel Zak Date: Mon Sep 30 11:12:35 2019 +0200 Merge branch 'nproc' of https://github.com/mator/util-linux * 'nproc' of https://github.com/mator/util-linux: Don't use `nproc --all` for getting cpu number. For example below, sparc64 is reporting 128 as a total, but only 32 is online. So use only online cpus for tests parallel runs. commit 1c076159327ce7b5c80579ab788d715a27c884a5 Merge: 2ebc944fa 0c8865f84 Author: Karel Zak Date: Mon Sep 30 11:06:09 2019 +0200 Merge branch 'non-canonical-completion' of https://github.com/kevinoid/util-linux * 'non-canonical-completion' of https://github.com/kevinoid/util-linux: bash-completion: Add non-canonical device fallback bash-completion: Add fallback for symlinks/images bash-completion: Standardize fsck/mkfs file/device commit 2ebc944fa4b2502148526bef3d1153782ddb7d17 Author: Andrius Štikonas Date: Mon Sep 23 22:22:48 2019 +0100 docs: fix mixtyped constant. Signed-off-by: Andrius Štikonas libfdisk/src/iter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 83db544ddab2b7f8f4189881d8d6c4d56712a10a Author: Quentin Rameau Date: Sat Sep 21 20:50:21 2019 +0200 chsh: replace getpw unsafe functions with xgetpw login-utils/chsh.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit cd083615b4a2d9a1ca01467b8012fedca500e22f Author: Quentin Rameau Date: Sat Sep 21 20:50:20 2019 +0200 lib/pwdutils: add xgetpwuid include/pwdutils.h | 1 + lib/pwdutils.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) commit 135e03892b2a9c6dd7ae4716643fb732c7937c74 Author: Karel Zak Date: Tue Sep 17 11:06:08 2019 +0200 sfdisk: (man) add note about interactive mode) Signed-off-by: Karel Zak disk-utils/sfdisk.8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7ef86a08914427d6486734614d7d3bbed1f108fe Author: Daniel Drake Date: Tue Sep 24 17:46:16 2019 +0800 libblkid: improve handling of ISO files with partition tables The ISO format specifically leaves the first 32kb blank so that it can be used for other purposes, such as adding a partition table. This is commonly used (e.g. by Endless and Fedora installation media) to have partition 0 starting at sector 0 as a mountable iso9660 filesystem, followed by more partitions (e.g. an EFI system partition). Such layouts can be easily created by tools such as xorriso. When plugging in a USB disk flashed with this type of ISO, blkid presents a somewhat confusing view of the block devices. Taking the example of a 'sda' disk with two partitions: 1. The "iso partition" 2. An unformatted partition In such a setup, before the changes here, blkid will currently report the ISO metadata attributes ID_FS_PUBLISHER_ID, ID_FS_UUID, ID_FS_LABEL, and ID_FS_TYPE=iso9660 on both sda *and* sda1. Since sda2 is unformatted, it won't have any ID_FS_ attributes of it's own. And due to the following standard udev rule: # for partitions import parent information ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" sda2 will actually import all of the ID_FS_ stuff from the parent device sda. The result at this point is that three udev devices all have the same ID_FS_ attribute values, leading to strange results such as three devices all racing to own the link in /dev/disk/by-uuid, so you can't reliably do a mount-by-UUID. Clean up this situation by detecting such partitioned ISO disks in the superblock probing setup. If files of this kind are detected, we now only expose the ISO metadata attributes on the specific partition that points to the ISO data (and not the parent disk). Signed-off-by: Daniel Drake libblkid/src/superblocks/iso9660.c | 37 +++++++++++ tests/expected/blkid/iso-partitions-no_partitions | 9 +++ tests/expected/blkid/iso-partitions-partitions | 25 ++++++++ tests/ts/blkid/iso-partitions | 71 ++++++++++++++++++++++ tests/ts/blkid/iso-partitions.img.xz | Bin 0 -> 1188 bytes 5 files changed, 142 insertions(+) commit 616f57d949171f6852ee1d7b40f250057a6dd08a Author: Anatoly Pugachev Date: Tue Sep 24 18:15:33 2019 +0300 Don't use `nproc --all` for getting cpu number. For example below, sparc64 is reporting 128 as a total, but only 32 is online. So use only online cpus for tests parallel runs. $ nproc 32 $ nproc --all 128 $ lscpu Architecture: sparc64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Big Endian CPU(s): 32 On-line CPU(s) list: 0-31 Thread(s) per core: 8 Core(s) per socket: 4 Socket(s): 1 Model name: UltraSparc T5 (Niagara5) Flags: sun4v Signed-off-by: Anatoly Pugachev tests/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 775022bdd7b2bd91eb4833c8f72c5c79ee80fd61 Merge: 55ff4da89 206216489 Author: Karel Zak Date: Sun Sep 22 14:05:18 2019 +0200 Merge branch 'next' of https://github.com/rskvaril/util-linux * 'next' of https://github.com/rskvaril/util-linux: tests: lscpu s390 nested virtualization commit 2062164894fffa314ecb7ac99dc6c98062484389 Author: Radka Skvarilova Date: Sun Sep 22 13:49:45 2019 +0200 tests: lscpu s390 nested virtualization Signed-off-by: Radka Skvarilova Addresses:https://bugzilla.redhat.com/show_bug.cgi?id=1739443 tests/expected/lscpu/lscpu-s390-nested-virt | 45 +++++++++++++++++++++++++++ tests/ts/lscpu/dumps/s390-nested-virt.tar.gz | Bin 0 -> 7199 bytes 2 files changed, 45 insertions(+) commit 55ff4da89066c09fdb7f50e5bbbc6902de9b96e5 Author: Karel Zak Date: Sun Sep 22 13:39:40 2019 +0200 docs: update howto-tests.txt Signed-off-by: Karel Zak Documentation/howto-tests.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit bc747dfccf511419312ec872cefa90e25d83136a Author: Karel Zak Date: Sat Sep 21 11:16:34 2019 +0200 libmount: fix free() call on error Signed-off-by: Karel Zak libmount/src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dc626a7586f99e4ba4e103203bee6a595acc5449 Author: Karel Zak Date: Fri Sep 20 16:13:52 2019 +0200 hexdump: add header file guards [lgtm scan] Signed-off-by: Karel Zak text-utils/hexdump.h | 5 +++++ 1 file changed, 5 insertions(+) commit 0f60f643a9dc1bafc14cc07d904c63d61174dc6f Author: Karel Zak Date: Fri Sep 20 16:12:34 2019 +0200 term-utils: add header file guards [lgtm scan] Signed-off-by: Karel Zak term-utils/ttymsg.h | 4 ++++ 1 file changed, 4 insertions(+) commit b04f7d0e0115f9f703d87e5c5614ec625c806174 Author: Karel Zak Date: Fri Sep 20 16:10:43 2019 +0200 login-utils: add header file guards [lgtm scan] Signed-off-by: Karel Zak login-utils/auth.h | 4 ++++ login-utils/islocal.h | 5 +++++ login-utils/libuser.h | 4 ++++ 3 files changed, 13 insertions(+) commit e0bea4dfa85d3759ca7c2b6da1de6b4ca67d63cf Author: Karel Zak Date: Fri Sep 20 16:06:00 2019 +0200 libuuid: add header file guard [lgtm scan] Signed-off-by: Karel Zak libuuid/src/uuidP.h | 4 ++++ 1 file changed, 4 insertions(+) commit b2ce7d5827f7a4e34999b1afe3436b30692565e0 Author: Karel Zak Date: Fri Sep 20 16:00:13 2019 +0200 include/all-io: remove unnecessary condition [lgtm scan] Signed-off-by: Karel Zak include/all-io.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 8e76d28dbde02a378262cf9666155a757731051d Author: Karel Zak Date: Fri Sep 20 15:57:31 2019 +0200 fsfreeze: remove unnecessary condition [lgtm scan] Signed-off-by: Karel Zak sys-utils/fsfreeze.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 351de28ae68c33b6d6f1957f5168137a01fff189 Author: Karel Zak Date: Fri Sep 20 15:52:34 2019 +0200 libblkid: remove unnecessary condition [lgtm scan] Signed-off-by: Karel Zak libblkid/src/probe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit a6a24f18e6759bb7038b7331a319053302b4aadc Author: Karel Zak Date: Fri Sep 20 15:47:55 2019 +0200 mkswap: cast before lseek [lgtm scan] Signed-off-by: Karel Zak disk-utils/mkswap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c1356257340212cd29bac73a53bd0c30481f2c5e Author: Karel Zak Date: Fri Sep 20 15:45:15 2019 +0200 fdformat: cast before lseek [lgtm scan] Signed-off-by: Karel Zak disk-utils/fdformat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e3cabf33e588232db943d06459a024fcdbf65338 Author: Karel Zak Date: Fri Sep 20 15:43:12 2019 +0200 libfdisk: (bsd) cast before ask [lgtm scan] Signed-off-by: Karel Zak libfdisk/src/bsd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 2815af9ed4d1d466ed44f729ab7b4c99611ba0fd Author: Karel Zak Date: Fri Sep 20 15:40:14 2019 +0200 libfdisk: (gpt) cast number of entries [lgtm scan] Signed-off-by: Karel Zak libfdisk/src/gpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7618b3be4bd9513fe88e2027bc1442ca8de07079 Author: Karel Zak Date: Fri Sep 20 15:31:31 2019 +0200 build-sys: fix UTIL_LINUX_PT_SGI_H macro [lgtm scan] Signed-off-by: Karel Zak include/pt-sgi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 026f7d302066a4e6f5a69dc9818ec3180939f4a3 Author: Karel Zak Date: Fri Sep 20 13:00:19 2019 +0200 libmount: use fmemopen() in more robust way [coverity scan] Signed-off-by: Karel Zak libmount/src/utils.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit 0c8865f843c1a9552a13a51bcb4c4c31a4e1242d Author: Kevin Locke Date: Thu Sep 19 07:45:54 2019 -0600 bash-completion: Add non-canonical device fallback It is desirable for bash-completion to complete block devices via symlinks (e.g. under /dev/disk) and with non-canonical locations (e.g. ./sda if $PWD is /dev, and /chroot/dev/sda). Unfortunately, this is a non-trivial task due to how bash-completion works. It is necessary to un-escape the last partial argument, search, then escape the results, ideally handling tilde and variable expansion/completion. See [_get_comp_words_by_ref] and [_filedir] in the bash-completion project for details. Given the development costs of a complete and correct implementation, the annoyance/frustration which would result from an incomplete/buggy implementation, and the trade-offs between under- and over-completion, this commit adds fallback to bash default completion if the argument does not match any canonical device names. This correctly completes in the cases mentioned above, although it incorrectly completes on non-block-device files as well. [_filedir]: https://github.com/scop/bash-completion/blob/2.9/bash_completion#L552 [_get_comp_words_by_ref]: https://github.com/scop/bash-completion/blob/2.9/bash_completion#L365 Signed-off-by: Kevin Locke bash-completion/addpart | 1 + bash-completion/blkdiscard | 1 + bash-completion/blkid | 1 + bash-completion/blkzone | 1 + bash-completion/blockdev | 1 + bash-completion/delpart | 1 + bash-completion/eject | 1 + bash-completion/lsblk | 1 + bash-completion/resizepart | 1 + 9 files changed, 9 insertions(+) commit 6ead91ce1e8431bec5b6f10c37b54a82f0be078a Author: Kevin Locke Date: Thu Sep 19 07:40:13 2019 -0600 bash-completion: Add fallback for symlinks/images For commands which support operating on files (i.e. disk images), it is desirable for bash-completion to complete matching file names. It is also desirable to complete on block device symlinks (e.g. under /dev/disk). To complete common use cases, often on canonical device names, continue to try completion using canonical device names, then fall back to matching any file incrementally as Bash does by default.[1] [1]: https://github.com/karelzak/util-linux/issues/842#issuecomment-523450243 Signed-off-by: Kevin Locke bash-completion/cfdisk | 1 + bash-completion/fdisk | 1 + bash-completion/fsck | 1 + bash-completion/fsck.cramfs | 1 + bash-completion/fsck.minix | 1 + bash-completion/mkfs | 1 + bash-completion/mkfs.bfs | 1 + bash-completion/mkfs.cramfs | 1 + bash-completion/mkfs.minix | 1 + bash-completion/mkswap | 1 + bash-completion/partx | 1 + bash-completion/sfdisk | 2 ++ bash-completion/wipefs | 1 + 13 files changed, 14 insertions(+) commit 559888c873a196c790137bbeee678dc5212c4430 Author: Kevin Locke Date: Thu Sep 19 07:27:31 2019 -0600 bash-completion: Standardize fsck/mkfs file/device Some of the fsck and mkfs commands complete differently than the others, and differently than the desired behavior.[1] Standardize on completing with $(lsblk -pnro name): * fsck: Don't complete completes on all block devices and device links under /dev immediately (which is excessive and prone to search problems). * mkfs, mkfs.bfs: Don't complete "/path/to/file" literally. I assume this was copy/pasted from example code, since it does not appear to be a valid argument unless it is a valid path, which is rare. * fsck.cramfs, mkfs, mkfs.bfs, mkfs.cramfs, mkswap: Don't complete on all filenames initially. The desired behavior is to complete filenames only if there are no canonical matches.[1] Note: A subsequent commit will add the desired fallback behavior. [1]: https://github.com/karelzak/util-linux/issues/842#issuecomment-523450243 Signed-off-by: Kevin Locke bash-completion/fsck | 3 +-- bash-completion/fsck.cramfs | 4 +--- bash-completion/mkfs | 2 +- bash-completion/mkfs.bfs | 2 +- bash-completion/mkfs.cramfs | 4 +--- bash-completion/mkswap | 4 +--- 6 files changed, 6 insertions(+), 13 deletions(-) commit d978ec31f71308f2c9a7e0eae121165b33bd3237 Merge: c50d77e6a e79f20f57 Author: Karel Zak Date: Mon Sep 16 12:38:43 2019 +0200 Merge branch 'typos' of https://github.com/kerolasa/util-linux * 'typos' of https://github.com/kerolasa/util-linux: bash-completion: update options misc: fix typos [codespell] commit c50d77e6a3cdd5e2030b8de8cc9518bbdffe7641 Author: Karel Zak Date: Mon Sep 16 12:01:54 2019 +0200 tests: update sfdisk dumps Signed-off-by: Karel Zak tests/expected/sfdisk/dos-write-dump | 1 + tests/expected/sfdisk/dos-write-json | 1 + tests/expected/sfdisk/gpt-write-dump | 1 + tests/expected/sfdisk/gpt-write-json | 1 + 4 files changed, 4 insertions(+) commit e56ca0681514dcf0846225cd67a72d1ab260b8a6 Author: Karel Zak Date: Mon Sep 16 10:29:41 2019 +0200 libfdisk: add sector-size to dump We do not use sector-size from dumps to create partition tables, because it's always necessary to use real device specific settings. The new sector-size value is usable when you use the dump as a description of the device or disk image. Addresses: https://github.com/karelzak/util-linux/issues/869 Signed-off-by: Karel Zak disk-utils/sfdisk.8 | 5 +++++ libfdisk/src/script.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) commit e79f20f57d4084672fba684decb0a1331c810205 Author: Sami Kerola Date: Thu Sep 12 19:43:17 2019 +0100 bash-completion: update options unshare: cef4decf0436953031b4a8ea91a8aec89459a8fd --keep-caps dmesg: 646bba41fd162fe1b8e303ff90914253e5fc669e --noescape Signed-off-by: Sami Kerola bash-completion/dmesg | 2 +- bash-completion/unshare | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) commit 218b1dd6f977fdce970efe200fee069f181f07b6 Author: Sami Kerola Date: Thu Sep 5 20:38:41 2019 +0100 misc: fix typos [codespell] Signed-off-by: Sami Kerola configure.ac | 2 +- include/c.h | 2 +- lib/colors.c | 2 +- lib/sysfs.c | 2 +- libblkid/src/partitions/aix.c | 2 +- libblkid/src/partitions/dos.c | 2 +- libsmartcols/src/calculate.c | 2 +- login-utils/login.c | 2 +- m4/ul.m4 | 8 ++++---- sys-utils/mountpoint.1 | 2 +- tests/ts/blkid/md-raid1-part | 2 +- tests/ts/mount/fstab-symlink | 2 +- tests/ts/mount/fstab-uuid | 6 +++--- text-utils/more.c | 2 +- tools/checkdecl.sh | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) commit 9245c84dfdd1949a67d9247971e65d4ff64a6f65 Merge: bce4a17b0 c7a3455c1 Author: Karel Zak Date: Thu Sep 12 13:28:55 2019 +0200 Merge branch 'sfdisk-man-page-typo' of https://github.com/mkrupcale/util-linux * 'sfdisk-man-page-typo' of https://github.com/mkrupcale/util-linux: disk-utils: docs: fix sfdisk(8) man page typo commit bce4a17b01c1b400a5890b971ccbbd55c9147082 Author: Karel Zak Date: Thu Sep 12 13:24:42 2019 +0200 blkid: (man) add note about udev to --list-one Addresses: https://github.com/karelzak/util-linux/issues/866 Signed-off-by: Karel Zak misc-utils/blkid.8 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit 2c2ff2ed261c66b2908e32d8ccbad9ebb10ef6b6 Author: Karel Zak Date: Thu Sep 12 12:45:30 2019 +0200 build-sys: check for linux/capability.h Addresses: https://github.com/karelzak/util-linux/pull/864 Signed-off-by: Karel Zak configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 8434a362c97da36c00210f90ebb4e3fd6bb26552 Merge: b221b9a9d cef4decf0 Author: Karel Zak Date: Thu Sep 12 12:29:28 2019 +0200 Merge branch 'unshare/keep-caps' of https://github.com/jpeach/util-linux * 'unshare/keep-caps' of https://github.com/jpeach/util-linux: unshare: add --keep-caps option commit c7a3455c1258a64a1807d4df3999ccd2720bfbbf Author: Matthew Krupcale Date: Tue Sep 10 17:05:22 2019 -0400 disk-utils: docs: fix sfdisk(8) man page typo * disk-utils/sfdisk.8: fix typo: "ir" -> "it" disk-utils/sfdisk.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b221b9a9d775ee432181e9a12a99daf0a0295d83 Author: Ernesto A. Fernández Date: Mon Sep 9 17:59:07 2019 -0300 libfdisk: (gpt) add GUID for APFS containers Add the partition type GUID for the Apple File System to gpt_parttypes. Signed-off-by: Ernesto A. Fernández libfdisk/src/gpt.c | 1 + 1 file changed, 1 insertion(+) commit bc6439ba3209fd0694c6c97c2be1d318d97b39e0 Author: Karel Zak Date: Tue Sep 10 12:14:25 2019 +0200 setterm: cleanup usage() and man page usage: * use --option[=] to make it obvious that '=' is required * don't use [ ] for required arguments * add separators to make it more readable man page * use --option=[] for optional arguments in man page * don't use \fI or \fB for keywords based arguments (on|off|default ...) * use the same style in all man page Signed-off-by: Karel Zak term-utils/setterm.1 | 92 ++++++++++++++++++++++++++++++-------------------- term-utils/setterm.c | 94 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 112 insertions(+), 74 deletions(-) commit 36ce5ebaf4348afe2abbb3e3e0c0bd04d8bec283 Author: Karel Zak Date: Tue Sep 10 11:12:38 2019 +0200 setterm: fix --clear * make argument optional as in the original version * fix typo (reset -> rest) Addresses: https://github.com/karelzak/util-linux/issues/861 Signed-off-by: Karel Zak term-utils/setterm.1 | 2 +- term-utils/setterm.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) commit fd7b0b4e54446c2c8dc2266e35bd4e5bec886bfe Author: Karel Zak Date: Tue Sep 10 10:34:01 2019 +0200 dmesg: do not stop on \0 ... but I have doubts this change fixes the issue. It seems (on my system) that \0 is already filtered out by kernel/syslog. Addresses: https://github.com/karelzak/util-linux/issues/862 Signed-off-by: Karel Zak sys-utils/dmesg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit cef4decf0436953031b4a8ea91a8aec89459a8fd Author: James Peach Date: Thu Jan 17 14:16:54 2019 -0800 unshare: add --keep-caps option Add the --keep-caps option to unshare to preserve capabilities that are granted when creating a new user namespace. This allows the child process to retain privilege within the new user namespace without also being UID 0. include/Makemodule.am | 1 + include/caputils.h | 34 ++++++++++++++++++++++++++++++++++ lib/Makemodule.am | 1 + lib/caputils.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ sys-utils/setpriv.c | 41 +++++------------------------------------ sys-utils/unshare.1 | 4 ++++ sys-utils/unshare.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 7 files changed, 140 insertions(+), 37 deletions(-) commit a1790d265d50b15b3a06506209806d59a5b707e3 Author: Karel Zak Date: Mon Sep 9 12:58:03 2019 +0200 bash-completion: (unshare) add --map-current-user Signed-off-by: Karel Zak bash-completion/unshare | 1 + 1 file changed, 1 insertion(+) commit 646bba41fd162fe1b8e303ff90914253e5fc669e Author: Karel Zak Date: Mon Sep 9 12:53:08 2019 +0200 dmesg: add --noescape We have no way how to print the kernel message buffer in really raw way. The new option --noescape disables all \x translations. Addresses: https://github.com/karelzak/util-linux/issues/858 Signed-off-by: Karel Zak bash-completion/dmesg | 1 + sys-utils/dmesg.1 | 9 +++++++- sys-utils/dmesg.c | 63 +++++++++++++++++++++++++++++---------------------- 3 files changed, 45 insertions(+), 28 deletions(-) commit a6cc5c16f4deec1c4c79b81bdc7efff9d3b23449 Merge: b008e4d66 4175f29e6 Author: Karel Zak Date: Mon Sep 9 11:31:04 2019 +0200 Merge branch 'unshare/map-current' of https://github.com/jpeach/util-linux * 'unshare/map-current' of https://github.com/jpeach/util-linux: unshare: add --map-current-user option commit b008e4d6682d00a922519d4a565c5ac348d0ff2a Author: Karel Zak Date: Mon Sep 9 11:27:03 2019 +0200 tests: (sfdisk) update move output Signed-off-by: Karel Zak tests/expected/sfdisk/movedata-down | 5 ++++- tests/expected/sfdisk/movedata-non-overlay | 5 ++++- tests/expected/sfdisk/movedata-up | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) commit 4175f29e62ca065acf2527eaaa81e6d9357f6fa5 Author: James Peach Date: Thu Jan 17 14:17:54 2019 -0800 unshare: add --map-current-user option Add the --map-current-user option to unshare. This option maps the current effective UID and GID in the new user namespace so that the inner and outer credentials match. Signed-off-by: James Peach sys-utils/unshare.1 | 7 ++++++- sys-utils/unshare.c | 50 +++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 10 deletions(-) commit 925f2d4f4fbb671d8bd543cff1d6c3cb59a554c5 Author: Karel Zak Date: Fri Sep 6 16:57:40 2019 +0200 sfdisk: (--move-data) add speed to progress bar, don't use POSIX_FADV_DONTNEED posix_fadvise() in the loop is pretty expensive. Signed-off-by: Karel Zak disk-utils/sfdisk.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) commit 4bf424188ddb69718801f41a8d005c43283fad8a Author: Karel Zak Date: Fri Sep 6 15:05:21 2019 +0200 sfdisk: (--move-data) add simple progress bar Addresses: https://github.com/karelzak/util-linux/issues/848 Signed-off-by: Karel Zak disk-utils/sfdisk.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) commit e4e0b1a6f054e3553772ca65874a6b4b0921d76f Author: Karel Zak Date: Fri Sep 6 14:32:12 2019 +0200 libfdisk: cleanup fdisk_deassign_device() docs Signed-off-by: Karel Zak libfdisk/src/context.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 7942ba8a799ac7a6c1e9614e60a23c9eefd98de2 Author: Karel Zak Date: Fri Sep 6 14:27:42 2019 +0200 sfdisk: add --move-use-fsync, disable fsync() by default It's slow, so slooow... Addresses: https://github.com/karelzak/util-linux/issues/848 Signed-off-by: Karel Zak disk-utils/sfdisk.8 | 6 ++++++ disk-utils/sfdisk.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) commit 69f30c31261190fdf2ddf7001ebc3ec03bae4a5c Author: Karel Zak Date: Fri Sep 6 14:17:28 2019 +0200 sfdisk: (--move-data) make log optional The log may be pretty huge and very probably not used by many users. Let's make it optional. The patch also clean up move-data output messages. Addresses: https://github.com/karelzak/util-linux/issues/848 Signed-off-by: Karel Zak disk-utils/sfdisk.8 | 7 +++--- disk-utils/sfdisk.c | 64 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 31 deletions(-) commit 4ce4675cce59b6d0ddc730db64bfce30433af39f Author: Karel Zak Date: Fri Sep 6 13:53:50 2019 +0200 sfdisk: (--move-data) keep step size based on optimal I/O The current implementation is too paranoid and tries to keep in memory only data which are on disk too. It means very small step size when move partition only a few sectors left/right. This patch enlarge the buffer to at least 1MiB and aligned to optimal I/O. Addresses: https://github.com/karelzak/util-linux/issues/848 Signed-off-by: Karel Zak disk-utils/sfdisk.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) commit 1116884cf7de88727845c0ee5c2ee7cb440e44d7 Author: Karel Zak Date: Fri Sep 6 13:09:30 2019 +0200 libfdisk: use grain as small as possible The current implementation does not allow to move partition for example in +/-1 sector range, because free space analyze is by default based on regular grain used for partitioning (=1MiB). Signed-off-by: Karel Zak libfdisk/src/partition.c | 11 +++++++++-- libfdisk/src/table.c | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) commit 45aaa8f3db45783f19f866ba0aa6b78d30a5e250 Author: Karel Zak Date: Fri Sep 6 12:37:26 2019 +0200 sfdisk: make --no-act usable for --move-data too Signed-off-by: Karel Zak disk-utils/sfdisk.c | 72 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 31 deletions(-) commit 492a5c70b4fb2e3dde62341635c96743d1bea524 Merge: 91099dea3 037bc610e Author: Karel Zak Date: Fri Sep 6 10:33:45 2019 +0200 Merge branch 'xfs-v5' of https://github.com/mator/util-linux * 'xfs-v5' of https://github.com/mator/util-linux: tests: Add test for current version (v5) of XFS filesystem commit 91099dea357e06074a38f81758c055b5806c1b05 Author: Karel Zak Date: Thu Sep 5 16:46:14 2019 +0200 tests: update sfdisk wipe output - stderr is used for the warning (like in fdisk) Signed-off-by: Karel Zak disk-utils/sfdisk.c | 2 +- tests/expected/sfdisk/wipe-fs-to-dos | 2 -- tests/expected/sfdisk/wipe-fs-to-dos.err | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) commit f227757c77bf0992de4c3c03349ab4a345e6b409 Author: Karel Zak Date: Thu Sep 5 16:28:49 2019 +0200 fstrim: ignore non-directory mountpoints It seems better to silently ignore mount binds on file (= mountpoint is not a directory). This patch also fixes use-after-free bug from commit 402006fa6e. Addresses: https://github.com/karelzak/util-linux/issues/857 Signed-off-by: Karel Zak sys-utils/fstrim.8 | 2 +- sys-utils/fstrim.c | 38 ++++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 15 deletions(-) commit 40af0db4cdadc50d9ba7ea77d8fa0689bf976f9f Author: Karel Zak Date: Thu Sep 5 12:34:01 2019 +0200 fdisk: fix quit dialog for non-libreadline version We need to clear stdin errors otherwise it returns EOF forever after CTRL+D. Reported-by: Lukas Czerner Signed-off-by: Karel Zak disk-utils/fdisk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit fff85eb577d0547d90304143d699ef7e46d9a406 Author: Karel Zak Date: Thu Sep 5 12:06:27 2019 +0200 fdisk: make quit question more usable Reported-by: Lukas Czerner Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6cd671d42798cb6f5746dfbe3dc84576836c2b00 Author: Karel Zak Date: Wed Sep 4 14:51:02 2019 +0200 fdisk: cleanup wipe warning Let's remove 'old' from the sentence, add man page reference to sfdisk. Signed-off-by: Karel Zak disk-utils/fdisk.c | 4 ++-- disk-utils/sfdisk.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) commit 037bc610e54c217412247805ea6140fc08912c5b Author: Anatoly Pugachev Date: Tue Sep 3 19:08:22 2019 +0300 tests: Add test for current version (v5) of XFS filesystem Old xfs.img cannot be used with current version (5.0) of xfsprogs, so create a new version of xfs-v5.img. Since I wasn't able to find logs on how was created old xfs.img, saving create log with this commit message: $ fallocate -l 16M xfs-v5.img $ mkfs.xfs -L test-xfs-v5 xfs-v5.img $ ./blkid -p -o udev xfs-v5.img | sort -V > tests/expected/blkid/low-probe-xfs-v5 $ xz -c xfs-v5.img > tests/ts/blkid/images-fs/xfs-v5.img.xz Signed-off-by: Anatoly Pugachev tests/expected/blkid/low-probe-xfs-v5 | 7 +++++++ tests/ts/blkid/images-fs/xfs-v5.img.xz | Bin 0 -> 4040 bytes 2 files changed, 7 insertions(+) commit 03154d2cf25c1d5ce908da9e72d324004b8d5722 Author: Karel Zak Date: Tue Sep 3 16:22:21 2019 +0200 sfdisk: add -J between mutually exclusive options Signed-off-by: Karel Zak disk-utils/sfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 987ec2a6963f6eaf061c322b4005413035dbd302 Author: Karel Zak Date: Tue Sep 3 16:18:48 2019 +0200 libmount: fix typo Signed-off-by: Karel Zak libmount/src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2771d40b88660a11306aa5d4e200fc0ebebfe315 Author: Karel Zak Date: Tue Sep 3 15:10:35 2019 +0200 libblkid: (xfs) fix sector size calculation Reported-by: Anatoly Pugachev Signed-off-by: Karel Zak libblkid/src/superblocks/xfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ce16f04efa733a0c4364667c4d9e44488d7c12fc Author: Karel Zak Date: Tue Sep 3 11:53:59 2019 +0200 fdisk: add hint about --wipe to warning Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1748020 Signed-off-by: Karel Zak disk-utils/fdisk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit eabcbfc44956ade48f431786439be623d9ee18d0 Author: Karel Zak Date: Mon Sep 2 13:10:44 2019 +0200 sfdisk: mark --dump and --list-free as mutually exclusive Reported-by: Bertrand Jacquin Signed-off-by: Karel Zak disk-utils/sfdisk.c | 1 + 1 file changed, 1 insertion(+) commit e7d318a9dd63c9fae8f07754ce12aa9af4dce089 Author: Karel Zak Date: Mon Sep 2 12:57:11 2019 +0200 tests: (blkid) update regression tests (due to BLOCK_SIZE) Signed-off-by: Karel Zak tests/expected/blkid/low-probe-befs | 1 + tests/expected/blkid/low-probe-exfat | 1 + tests/expected/blkid/low-probe-ext2 | 1 + tests/expected/blkid/low-probe-ext3 | 1 + tests/expected/blkid/low-probe-f2fs | 1 + tests/expected/blkid/low-probe-fat | 1 + tests/expected/blkid/low-probe-fat16_noheads | 1 + tests/expected/blkid/low-probe-fat32_cp850_O_tilde | 1 + tests/expected/blkid/low-probe-fat32_label_64MB | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1 | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1_dosfslabel_NO_NAME | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1_dosfslabel_empty | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1_dosfslabel_label2 | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1_mlabel_NO_NAME | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1_mlabel_erase | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1_xp_erase | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_label1_xp_label2 | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_none | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_none_dosfslabel_NO_NAME | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_none_dosfslabel_label1 | 1 + .../blkid/low-probe-fat32_mkdosfs_none_dosfslabel_label1_xp_label2 | 1 + tests/expected/blkid/low-probe-fat32_mkdosfs_none_xp_label1 | 1 + .../blkid/low-probe-fat32_mkdosfs_none_xp_label1_dosfslabel_label2 | 1 + tests/expected/blkid/low-probe-fat32_xp_label1 | 1 + tests/expected/blkid/low-probe-fat32_xp_none | 1 + tests/expected/blkid/low-probe-fat32_xp_none_dosfslabel_label1 | 1 + tests/expected/blkid/low-probe-fat32_xp_none_mlabel_label1 | 1 + tests/expected/blkid/low-probe-gfs2 | 1 + tests/expected/blkid/low-probe-hfsplus | 1 + tests/expected/blkid/low-probe-hpfs | 1 + tests/expected/blkid/low-probe-iso | 1 + tests/expected/blkid/low-probe-iso-joliet | 1 + tests/expected/blkid/low-probe-iso-rr-joliet | 1 + tests/expected/blkid/low-probe-jbd | 1 + tests/expected/blkid/low-probe-jfs | 1 + tests/expected/blkid/low-probe-minix-BE | 1 + tests/expected/blkid/low-probe-minix-LE | 1 + tests/expected/blkid/low-probe-nilfs2 | 1 + tests/expected/blkid/low-probe-ntfs | 1 + tests/expected/blkid/low-probe-ocfs2 | 1 + tests/expected/blkid/low-probe-reiser3 | 1 + tests/expected/blkid/low-probe-reiser4 | 1 + tests/expected/blkid/low-probe-romfs | 1 + tests/expected/blkid/low-probe-small-fat32 | 1 + tests/expected/blkid/low-probe-udf | 1 + tests/expected/blkid/low-probe-udf-bdr-2.60-nero | 1 + tests/expected/blkid/low-probe-udf-cd-mkudfiso-20100208 | 1 + tests/expected/blkid/low-probe-udf-cd-nero-6 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-1 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-2 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-1 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-2 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-3 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-6 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-7 | 1 + tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-8 | 1 + tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.5 | 1 + tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.7 | 1 + tests/expected/blkid/low-probe-udf-hdd-win7 | 1 + tests/expected/blkid/low-probe-ufs | 1 + tests/expected/blkid/low-probe-xfs | 1 + tests/expected/blkid/low-probe-zfs | 1 + 64 files changed, 64 insertions(+) commit cd129b7d2fecd5f2013512936de2db1bf244aa75 Author: Mikulas Patocka Date: Mon Sep 2 12:28:39 2019 +0200 blkid: retport block size of a filesystem This patch extends libblkid, so that it reports filesystem block size. When blkid returns a specific number in the BLOCK_SIZE attribute, it guarantees that all the bios submitted by the filesystem are aligned on this boundary. We need this because when we want to enable dm-integrity or dm-writecache on an existing filesystem, we need to know filesystem block size, so that dm-integrity or dm-writecache is initialized with matching block size. We could always use block size 512 for dm-integrity and dm-writecache, but that would cause metadata overhead and performance degradation. On the other hand, if we used block size 4096, it would fail if the filesystem has smaller blocksize. [kzak@redhat.com: - move vfat BLOCK_SIZE to probing function - remove unwanted debug fprintf from ZFS prober] Signed-off-by: Mikulas Patocka Signed-off-by: Karel Zak libblkid/src/superblocks/apfs.c | 2 + libblkid/src/superblocks/befs.c | 3 ++ libblkid/src/superblocks/btrfs.c | 1 + libblkid/src/superblocks/exfat.c | 2 + libblkid/src/superblocks/exfs.c | 4 ++ libblkid/src/superblocks/ext.c | 3 ++ libblkid/src/superblocks/f2fs.c | 2 + libblkid/src/superblocks/gfs.c | 1 + libblkid/src/superblocks/hfs.c | 2 + libblkid/src/superblocks/hpfs.c | 1 + libblkid/src/superblocks/iso9660.c | 2 + libblkid/src/superblocks/jfs.c | 1 + libblkid/src/superblocks/minix.c | 5 +++ libblkid/src/superblocks/nilfs.c | 3 ++ libblkid/src/superblocks/ntfs.c | 2 + libblkid/src/superblocks/ocfs.c | 3 ++ libblkid/src/superblocks/reiserfs.c | 10 ++++- libblkid/src/superblocks/romfs.c | 3 ++ libblkid/src/superblocks/squashfs.c | 2 + libblkid/src/superblocks/superblocks.c | 7 ++++ libblkid/src/superblocks/superblocks.h | 2 + libblkid/src/superblocks/udf.c | 2 + libblkid/src/superblocks/ufs.c | 5 +++ libblkid/src/superblocks/vfat.c | 2 + libblkid/src/superblocks/vxfs.c | 18 ++++++++- libblkid/src/superblocks/xfs.c | 1 + libblkid/src/superblocks/zfs.c | 74 +++++++++++++++++++++++++--------- 27 files changed, 142 insertions(+), 21 deletions(-) commit 530220b6bf35f5e7bb7d8558155512106b111a5a Author: Patrick Steinhardt Date: Thu Aug 22 11:40:15 2019 +0200 include/closestream: fix assignment to read-only standard streams In order to avoid closing standard streams multiple times, commit 52aa1a661 (include/closestream: avoid close more than once, 2019-06-13) introduced code to set the standard output and error streams to `NULL`. As musl libc defines standard streams as constant pointers, the change causes compiler errors on systems with that libc. According to ISO C89, being able to assign to the standard text streams is not a requirement for any C implementation, see footnote 238 in chapter §7.19.5.6: The primary use of the freopen function is to change the file associated with a standard text stream (stderr, stdin, or stdout), as those identifiers need not be modifiable lvalues to which the value returned by the fopen function may be assigned. This commit implements a new function `flush_standard_stream` that tries to reliably flush standard streams without actually closing them. By not calling fclose(3P), we can neatly avoid the issue of accessing standard streams in an unspecified state and thus remove the infringing `NULL` assignments. Properly flushing standard streams without fclose(3P) proves to be more intricate than one may expect, though, as some filesystems like NFS may defer flushing until they see a close(3P) of the underlying descriptor. One may call fsync(3P) to remedy that, but this may incur a heavy performance penalty in some scenarios. To work around the issue and still get proper errors, we duplicate the stream's file descriptor and close that one instead, which is sufficient to cause a flush. Note that both `close_stdout` and `close_stdout_atexit` are misnamed after this change, as we do not actually close the streams now. In order to avoid unnecessary code churn, we still retain their current names. Signed-off-by: Patrick Steinhardt include/closestream.h | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) commit d3565072076f9414e315750862621e83a2be5afb Author: Karel Zak Date: Mon Sep 2 11:53:10 2019 +0200 colcrt: make seek to \n more robust Signed-off-by: Karel Zak text-utils/colcrt.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit 50c77b6afeec6ed535cc442d03698402eb0e0910 Author: Karel Zak Date: Fri Aug 30 20:45:29 2019 +0200 tests: (colcrt) use env to set locale Signed-off-by: Karel Zak tests/ts/colcrt/regressions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e3803ff86961cca74d424225c99216f4ba797f2a Author: Karel Zak Date: Fri Aug 30 20:35:55 2019 +0200 tests: (getopt) remove unwanted paths from error output Signed-off-by: Karel Zak .../getopt/options-invalid_getopt_option.err | 2 +- .../getopt/options-long_option_ambiguous_1.err | 2 +- .../getopt/options-quiet_output_option_long.err | 8 ++++---- .../getopt/options-quiet_output_option_short.err | 8 ++++---- tests/expected/getopt/options-unknown_options.err | 4 ++-- tests/ts/getopt/options | 20 ++++++++++---------- 6 files changed, 22 insertions(+), 22 deletions(-) commit eb61e95f1c625e15728e2a77b2151996a50b9953 Author: Karel Zak Date: Fri Aug 30 16:10:48 2019 +0200 tests: remove unbuffered ts_run feature It's unnecessary as stdout and stderr are split in the tests. Signed-off-by: Karel Zak tests/expected/misc/swaplabel | 3 --- tests/expected/misc/swaplabel.err | 3 +++ tests/expected/rename/exit_codes | 1 - tests/expected/rename/exit_codes.err | 1 + tests/functions.sh | 26 -------------------------- tests/ts/misc/swaplabel | 29 ++++++++++++++++------------- tests/ts/rename/exit_codes | 2 +- 7 files changed, 21 insertions(+), 44 deletions(-) commit 18c1f9e6433aee2f1add86e9a50016eae3642f08 Author: Karel Zak Date: Fri Aug 30 16:10:01 2019 +0200 tests: add remaining stderr outputs Signed-off-by: Karel Zak .../expected/libfdisk/mkpart-full-gpt-err-overlap | 2 -- .../libfdisk/mkpart-full-gpt-err-overlap.err | 2 ++ .../expected/libfdisk/mkpart-full-mbr-err-logical | 1 - .../libfdisk/mkpart-full-mbr-err-logical.err | 1 + .../expected/libfdisk/mkpart-full-mbr-err-nospace | 2 -- .../libfdisk/mkpart-full-mbr-err-nospace.err | 2 ++ .../expected/libfdisk/mkpart-full-mbr-err-primary | 2 -- .../libfdisk/mkpart-full-mbr-err-primary.err | 2 ++ tests/ts/libfdisk/mkpart-full | 28 ++++++++++------------ 9 files changed, 20 insertions(+), 22 deletions(-) commit b161f810b010eff898090c9432dc2c8a665a3181 Author: Karel Zak Date: Fri Aug 30 16:05:50 2019 +0200 libdisk: write sample output to stdout Signed-off-by: Karel Zak libfdisk/samples/mkpart-fullspec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cbf858aa085e25aa5afd1d06decaea6e14a8963f Author: Karel Zak Date: Fri Aug 30 15:50:07 2019 +0200 tests: split stdout and stderr * add $TS_ERRLOG for script stderr output * add optional $TS_EXPECTED_ERR which points to expected/*/*.err This change allows to keep track about stderr output from our commands (already found bug in sfdisk...). We do not have to depend on fragile stdout vs. stderr order (due to different buffering semantic in different libc, etc.). Signed-off-by: Karel Zak tests/expected/blkdiscard/offsets | 20 -- tests/expected/blkdiscard/offsets.err | 20 ++ tests/expected/cramfs/fsck-bad-header-nopad-4K-be | 8 - .../cramfs/fsck-bad-header-nopad-4K-be.err | 15 + tests/expected/cramfs/fsck-bad-header-nopad-4K-le | 8 - .../cramfs/fsck-bad-header-nopad-4K-le.err | 15 + tests/expected/cramfs/fsck-bad-header-pad-4K-be | 8 - .../expected/cramfs/fsck-bad-header-pad-4K-be.err | 15 + tests/expected/cramfs/fsck-bad-header-pad-4K-le | 8 - .../expected/cramfs/fsck-bad-header-pad-4K-le.err | 15 + tests/expected/cramfs/fsck-bad-header-pad-64K-be | 8 - .../expected/cramfs/fsck-bad-header-pad-64K-be.err | 15 + tests/expected/cramfs/fsck-bad-header-pad-64K-le | 8 - .../expected/cramfs/fsck-bad-header-pad-64K-le.err | 15 + tests/expected/cramfs/fsck-bad-header.err | 0 tests/expected/fdisk/gpt-resize | 11 - tests/expected/fdisk/gpt-resize.err | 4 + tests/expected/fdisk/oddinput | 8 +- tests/expected/fdisk/oddinput.err | 4 + tests/expected/fincore/count.4096 | 2 - tests/expected/fincore/count.65536 | 2 - tests/expected/fincore/count.err.4096 | 4 + tests/expected/fincore/count.err.65536 | 4 + tests/expected/fincore/count.err.nosize | 4 + tests/expected/fincore/count.nosize | 2 - tests/expected/getopt/basic.err | 0 .../getopt/options-alternative_option_clash.err | 0 .../getopt/options-alternative_option_long.err | 0 .../getopt/options-alternative_option_short.err | 0 tests/expected/getopt/options-compatible | 2 - tests/expected/getopt/options-compatible.err | 2 + tests/expected/getopt/options-csh.err | 0 .../expected/getopt/options-invalid_getopt_option | 2 - .../getopt/options-invalid_getopt_option.err | 2 + .../getopt/options-invocation_model_one.err | 0 .../options-invocation_model_three_as_one.err | 0 .../getopt/options-invocation_model_two_as_one.err | 0 .../getopt/options-invocation_without_parameters | 2 - .../options-invocation_without_parameters.err | 2 + .../getopt/options-long_option_ambiguous_1 | 1 - .../getopt/options-long_option_ambiguous_1.err | 1 + tests/expected/getopt/options-longopts.err | 0 tests/expected/getopt/options-name_option_long | 2 - tests/expected/getopt/options-name_option_long.err | 2 + tests/expected/getopt/options-name_option_short | 2 - .../expected/getopt/options-name_option_short.err | 2 + tests/expected/getopt/options-no-arguments | 2 - tests/expected/getopt/options-no-arguments.err | 2 + tests/expected/getopt/options-non-option.err | 0 tests/expected/getopt/options-posix_correctly.err | 0 .../expected/getopt/options-quiet_option_long.err | 0 .../expected/getopt/options-quiet_option_short.err | 0 .../getopt/options-quiet_output_option_long | 4 - .../getopt/options-quiet_output_option_long.err | 4 + .../getopt/options-quiet_output_option_short | 4 - .../getopt/options-quiet_output_option_short.err | 4 + .../getopt/options-same_long_short_options.err | 0 tests/expected/getopt/options-sh.err | 0 .../getopt/options-test_for_enhanced_getopt.err | 0 tests/expected/getopt/options-unknown_options | 2 - tests/expected/getopt/options-unknown_options.err | 2 + .../getopt/options-unquoted_option_bash.err | 0 .../getopt/options-unquoted_option_tcsh.err | 0 .../expected/getopt/options-weird_quoting_bash.err | 0 .../expected/getopt/options-weird_quoting_tcsh.err | 0 tests/expected/getopt/options.err | 0 tests/expected/kill/all_processes | 2 - tests/expected/kill/all_processes.err | 5 + tests/expected/logger/errors-check_socket.err | 0 tests/expected/logger/errors-id_with_space | 5 - tests/expected/logger/errors-id_with_space.err | 5 + tests/expected/logger/errors-invalid_prio | 1 - tests/expected/logger/errors-invalid_prio.err | 1 + tests/expected/logger/errors-invalid_socket | 1 - tests/expected/logger/errors-invalid_socket.err | 1 + tests/expected/logger/errors-kern_priority | 1 - tests/expected/logger/errors-kern_priority.err | 1 + tests/expected/logger/errors-kern_priority_numeric | 1 - .../logger/errors-kern_priority_numeric.err | 1 + tests/expected/logger/errors-multi-line | 3 - tests/expected/logger/errors-multi-line.err | 3 + tests/expected/logger/errors-rfc5424_exceed_size | 1 - .../expected/logger/errors-rfc5424_exceed_size.err | 1 + .../logger/errors-rfc5424_msgid_with_space | 1 - .../logger/errors-rfc5424_msgid_with_space.err | 1 + tests/expected/logger/errors-tag_with_space | 2 - tests/expected/logger/errors-tag_with_space.err | 2 + tests/expected/logger/errors-tcp | 1 - tests/expected/logger/errors-tcp.err | 1 + tests/expected/logger/formats-check_socket | 1 - tests/expected/logger/formats-check_socket.err | 0 tests/expected/logger/formats-octet_counting | 2 - tests/expected/logger/formats-octet_counting.err | 2 + tests/expected/logger/formats-priorities | 304 --------------------- tests/expected/logger/formats-priorities.err | 304 +++++++++++++++++++++ tests/expected/logger/formats-rfc3164 | 2 - tests/expected/logger/formats-rfc3164.err | 2 + tests/expected/logger/formats-rfc5424_msgid | 2 - tests/expected/logger/formats-rfc5424_msgid.err | 2 + tests/expected/logger/formats-rfc5424_nohost | 2 - tests/expected/logger/formats-rfc5424_nohost.err | 2 + tests/expected/logger/formats-rfc5424_notime | 2 - tests/expected/logger/formats-rfc5424_notime.err | 2 + tests/expected/logger/formats-rfc5424_simple | 2 - tests/expected/logger/formats-rfc5424_simple.err | 2 + tests/expected/logger/journald | 3 - tests/expected/logger/journald.err | 3 + tests/expected/logger/options-check_socket | 1 - tests/expected/logger/options-check_socket.err | 0 .../expected/logger/options-input_file_empty_line | 4 - .../logger/options-input_file_empty_line.err | 4 + .../expected/logger/options-input_file_prio_prefix | 2 - .../logger/options-input_file_prio_prefix.err | 2 + tests/expected/logger/options-input_file_simple | 2 - .../expected/logger/options-input_file_simple.err | 2 + .../expected/logger/options-input_file_skip_empty | 3 - .../logger/options-input_file_skip_empty.err | 3 + tests/expected/logger/options-log_pid | 2 - tests/expected/logger/options-log_pid.err | 2 + tests/expected/logger/options-log_pid_define | 2 - tests/expected/logger/options-log_pid_define.err | 2 + tests/expected/logger/options-log_pid_long | 2 - tests/expected/logger/options-log_pid_long.err | 2 + tests/expected/logger/options-log_pid_no_arg | 2 - tests/expected/logger/options-log_pid_no_arg.err | 2 + tests/expected/logger/options-simple | 2 - tests/expected/logger/options-simple.err | 2 + tests/expected/logger/options.err | 0 tests/expected/minix/fsck | 5 - tests/expected/minix/fsck.err | 32 +++ tests/expected/misc/ionice | 7 - tests/expected/misc/ionice.err | 7 + tests/expected/misc/mountpoint-mutually-exclusive | 1 - .../misc/mountpoint-mutually-exclusive.err | 1 + tests/expected/misc/setarch-options | 2 - tests/expected/misc/setarch-options.err | 4 + tests/expected/misc/strtosize | 4 - tests/expected/misc/strtosize.err | 4 + tests/expected/sfdisk/dos-explicit-size | 7 - tests/expected/sfdisk/dos-explicit-size.err | 7 + tests/expected/sfdisk/dos-read-dump | 2 - tests/expected/sfdisk/dos-read-dump.err | 2 + tests/expected/sfdisk/gpt-attrs | 2 - tests/expected/sfdisk/gpt-attrs-broken-guid | 2 - tests/expected/sfdisk/gpt-attrs-broken-guid.err | 2 + tests/expected/sfdisk/gpt-attrs-broken-nosep | 2 - tests/expected/sfdisk/gpt-attrs-broken-nosep.err | 2 + tests/expected/sfdisk/gpt-attrs-guid | 2 - tests/expected/sfdisk/gpt-attrs-guid.err | 0 tests/expected/sfdisk/gpt-attrs-space | 2 - tests/expected/sfdisk/gpt-attrs-space.err | 0 tests/expected/sfdisk/gpt-attrs-unsupported | 2 - tests/expected/sfdisk/gpt-attrs-unsupported.err | 2 + tests/expected/sfdisk/gpt-attrs-with-typo | 2 - tests/expected/sfdisk/gpt-attrs-with-typo.err | 0 tests/expected/sfdisk/gpt-attrs.err | 0 tests/expected/sfdisk/gpt-list-pmbr | 1 - tests/expected/sfdisk/gpt-list-pmbr.err | 1 + tests/expected/sfdisk/script-broken-1 | 3 +- tests/expected/sfdisk/script-broken-1.err | 1 + tests/expected/sfdisk/script-broken-2 | 3 +- tests/expected/sfdisk/script-broken-2.err | 1 + tests/expected/sfdisk/script-broken-3 | 3 +- tests/expected/sfdisk/script-broken-3.err | 1 + tests/expected/sfdisk/script-broken-4 | 3 +- tests/expected/sfdisk/script-broken-4.err | 1 + tests/expected/sfdisk/script-broken-5 | 3 +- tests/expected/sfdisk/script-broken-5.err | 1 + tests/expected/sfdisk/wipe-fs-to-dos | 4 +- tests/expected/sfdisk/wipe-fs-to-dos.err | 0 tests/expected/sfdisk/wipe-gpt-to-dos-auto.err | 0 tests/expected/sfdisk/wipe-gpt-to-dos.err | 0 tests/expected/sfdisk/wipe-partition | 1 - tests/expected/sfdisk/wipe-partition.err | 1 + tests/expected/sfdisk/wipe.err | 0 tests/functions.sh | 79 ++++-- tests/ts/blkdiscard/offsets | 2 +- tests/ts/blkid/dm-err | 2 +- tests/ts/blkid/low-probe | 2 +- tests/ts/blkid/md-raid0-whole | 10 +- tests/ts/blkid/md-raid1-part | 12 +- tests/ts/blkid/md-raid1-whole | 10 +- tests/ts/colcrt/functional | 16 +- tests/ts/colcrt/regressions | 2 +- tests/ts/colrm/rm2-2 | 2 +- tests/ts/column/columnate | 13 +- tests/ts/column/invalid-multibyte | 2 +- tests/ts/column/multi-file | 2 +- tests/ts/column/table | 34 +-- tests/ts/cramfs/doubles | 2 +- tests/ts/cramfs/fsck-bad-header | 4 +- tests/ts/cramfs/fsck-endianness | 4 +- tests/ts/cramfs/mkfs | 4 +- tests/ts/cramfs/mkfs-endianness | 2 +- tests/ts/dmesg/indentation | 14 +- tests/ts/fdisk/align-512-4K | 4 +- tests/ts/fdisk/align-512-4K-63 | 4 +- tests/ts/fdisk/align-512-4K-md | 12 +- tests/ts/fdisk/align-512-512 | 2 +- tests/ts/fdisk/align-512-512-topology | 4 +- tests/ts/fdisk/bsd | 16 +- tests/ts/fdisk/gpt | 2 +- tests/ts/fdisk/gpt-resize | 10 +- tests/ts/fdisk/mbr-dos-mode | 24 +- tests/ts/fdisk/mbr-nondos-mode | 26 +- tests/ts/fdisk/oddinput | 24 +- tests/ts/fdisk/sunlabel | 18 +- tests/ts/fincore/count | 46 ++-- tests/ts/fsck/ismounted | 4 +- tests/ts/getopt/basic | 6 +- tests/ts/getopt/options | 68 ++--- tests/ts/hardlink/options | 20 +- tests/ts/hexdump/format-strings | 4 +- tests/ts/ipcs/mk-rm-msg | 4 +- tests/ts/ipcs/mk-rm-sem | 4 +- tests/ts/ipcs/mk-rm-shm | 4 +- tests/ts/isosize/print-size | 6 +- tests/ts/kill/all_processes | 17 +- tests/ts/kill/name_to_number | 4 +- tests/ts/kill/options | 4 +- tests/ts/kill/print_pid | 4 +- tests/ts/kill/queue | 4 +- tests/ts/libfdisk/gpt | 16 +- tests/ts/libfdisk/mkpart | 16 +- tests/ts/libfdisk/mkpart-full | 52 ++-- tests/ts/libmount/context | 50 ++-- tests/ts/libmount/context-py | 48 ++-- tests/ts/libmount/context-utab | 26 +- tests/ts/libmount/context-utab-py | 26 +- tests/ts/libmount/loop | 36 +-- tests/ts/libmount/loop-overlay | 12 +- tests/ts/libmount/utils | 10 +- tests/ts/libsmartcols/fromfile | 34 +-- tests/ts/libsmartcols/title | 2 +- tests/ts/logger/errors | 6 +- tests/ts/logger/formats | 8 +- tests/ts/logger/journald | 4 +- tests/ts/logger/options | 8 +- tests/ts/lsblk/lsblk | 2 +- tests/ts/lscpu/lscpu | 6 +- tests/ts/lsmem/lsmem | 2 +- tests/ts/minix/fsck | 8 +- tests/ts/minix/fsck-images | 16 +- tests/ts/minix/mkfs | 2 +- tests/ts/misc/fallocate | 4 +- tests/ts/misc/flock | 2 +- tests/ts/misc/ionice | 12 +- tests/ts/misc/line | 14 +- tests/ts/misc/mbsencode | 8 +- tests/ts/misc/mcookie | 2 +- tests/ts/misc/mountpoint | 12 +- tests/ts/misc/rev | 6 +- tests/ts/misc/setarch | 16 +- tests/ts/misc/setsid | 2 +- tests/ts/misc/strtosize | 68 ++--- tests/ts/misc/swaplabel | 6 +- tests/ts/misc/ul | 2 +- tests/ts/more/regexp | 2 +- tests/ts/more/squeeze | 2 +- tests/ts/mount/devname | 6 +- tests/ts/mount/fslists | 8 +- tests/ts/mount/fstab-btrfs | 28 +- tests/ts/mount/fstab-devname | 4 +- tests/ts/mount/fstab-devname2label | 2 +- tests/ts/mount/fstab-devname2uuid | 2 +- tests/ts/mount/fstab-label | 6 +- tests/ts/mount/fstab-label2devname | 4 +- tests/ts/mount/fstab-label2uuid | 4 +- tests/ts/mount/fstab-loop | 8 +- tests/ts/mount/fstab-none | 2 +- tests/ts/mount/fstab-symlink | 6 +- tests/ts/mount/fstab-uuid | 6 +- tests/ts/mount/fstab-uuid2devname | 4 +- tests/ts/mount/fstab-uuid2label | 4 +- tests/ts/mount/label | 4 +- tests/ts/mount/regfile | 2 +- tests/ts/mount/shared-subtree | 12 +- tests/ts/mount/umount-alltargets | 12 +- tests/ts/mount/umount-recursive | 12 +- tests/ts/mount/uuid | 4 +- tests/ts/namei/logic | 4 +- tests/ts/partx/partx | 20 +- tests/ts/partx/partx-image | 2 +- tests/ts/rename/basic | 2 +- tests/ts/rename/exit_codes | 6 +- tests/ts/rename/overwrite | 4 +- tests/ts/rename/subdir | 20 +- tests/ts/rename/symlink | 2 +- tests/ts/schedutils/chrt | 2 +- tests/ts/schedutils/chrt-non-root | 4 +- tests/ts/script/replay | 6 +- tests/ts/sfdisk/dos | 32 +-- tests/ts/sfdisk/gpt | 60 ++-- tests/ts/sfdisk/movedata | 6 +- tests/ts/sfdisk/resize | 10 +- tests/ts/sfdisk/script | 24 +- tests/ts/sfdisk/wipe | 24 +- tests/ts/swapon/devname | 2 +- tests/ts/swapon/label | 2 +- tests/ts/swapon/uuid | 2 +- tests/ts/utmp/utmpdump-circle | 2 +- tests/ts/utmp/utmpdump-tobin | 2 +- tests/ts/utmp/utmpdump-tobin-ipv6 | 2 +- tests/ts/uuid/uuid_parser | 2 +- tests/ts/uuid/uuidd | 9 +- tests/ts/uuid/uuidgen | 4 +- tests/ts/uuid/uuidparse | 2 +- 307 files changed, 1369 insertions(+), 1264 deletions(-) commit 7837cd491a6c99aa69a31082b28a0c8b6045b7bc Author: Karel Zak Date: Fri Aug 30 15:40:06 2019 +0200 sfdisk: write all message to stdout The code writes message to stdout and \n to stderr. Signed-off-by: Karel Zak disk-utils/sfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ee551c909f95437fd9fcd162f398c069d0ce9720 Author: Karel Zak Date: Thu Aug 29 15:50:58 2019 +0200 libmount; fix and improve read+poll mountinfo * fix read() buffer size (stupid bug...) * split read() EINTR and poll() based attempts * use 100 attempts * wait 10000 usec between attempts, but first 10 attempts are without this delay. It makes the function usable for usual use-cases as well as on very busy systems (successfully tested with 300 concurrent mount/umount processes) Signed-off-by: Karel Zak libmount/src/utils.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) commit e4925f591c1bfb83719418b56b952830d15b77eb Author: Karel Zak Date: Wed Aug 28 15:47:16 2019 +0200 libmount: improve mountinfo reliability The standard way how we read mount table is not reliable because during the read() syscalls the table may be modified by some another process. The changes in the table is possible to detect by poll() event, and in this case it seems better to lseek to the begin of the file and read it again. It's expensive, but better than races... This patch does not modify mountinfo parser, but it reads all file to memory (by read()+poll()) and than it creates memory stream from the buffer and use it rather than a regular file stream. It means the parser is still possible to use for normal files (e.g. fstab) as well as for mountinfo and it's also portable to systems where for some reason is no fmemopen(). Note that re-read after poll() event is limited to 5 attempts (but successful read() without event zeroize the counter). It's because we do not want to wait for consistent mountinfo for ever. It seems better to use old (less reliable) way than hang up in read()+poll() loop. Addresses: https://github.com/systemd/systemd/issues/10872 Reported-by: Zbigniew Jędrzejewski-Szmek Signed-off-by: Karel Zak configure.ac | 1 + libmount/src/mountP.h | 2 + libmount/src/tab_parse.c | 87 +++++++++++++++++++++----- libmount/src/utils.c | 155 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 230 insertions(+), 15 deletions(-) commit 59a46f36b604fe46747d5a5b6c85078a39b37c2e Author: Patrick Steinhardt Date: Wed Aug 28 08:56:24 2019 +0200 tests: use env and support both unbuffer/stdbuf Triggered by commit f612c4c67 (tests: fix --unbuffered mode with ASAN, 2019-08-27), which says: Well, this patch sucks. It would be nice to have things in the way how it has been original expected by Patrick's patch, but ... So this commit here effectively reverts it and instead tries to improve the shortcomings of the original patch. First, it uses env(1) to set ASAN_OPTIONS instead of directly adding it to the args array to fix execution of "${args[@]}" "$@". Second, it now supports both unbuffer(1) and stdbuf(1). The latter uses LD_PRELOAD tricks, which doesn't play nicely with ASAN, so it will not be used if ASAN has been requested. It's still valuable to have support for both, as many more systems will have stdbuf(1) from coreutils installed but not unbuffer(1) from expect. Signed-off-by: Karel Zak tests/functions.sh | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) commit 71210f5babd0666494ac649374c47a0dd6db8546 Author: Karel Zak Date: Tue Aug 27 14:38:21 2019 +0200 tests: don't show diff for TS_KNOWN_FAIL Signed-off-by: Karel Zak tests/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 751fae0d96385230ed3c7109a0345d869db17be3 Author: Karel Zak Date: Tue Aug 27 14:28:11 2019 +0200 tests: improve unbuffer check * remove obsolete stdbuf check * check for unbuffer command in ts_run() than skip all test Reported-by: Patrick Steinhardt Signed-off-by: Karel Zak tests/functions.sh | 2 +- tests/ts/libfdisk/mkpart-full | 1 - tests/ts/misc/swaplabel | 1 - tests/ts/rename/exit_codes | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) commit 2ede7ec214ad49e58b999c833e00e68cc052eb7e Author: Patrick Steinhardt Date: Fri Aug 23 15:32:58 2019 +0200 tests: (fdisk) avoid hardcoding of errno string The test fdisk/oddinput hardcodes strings returned by strerror(3P) for both the errors ENOENT and ENOTTY. As these strings are unportable, convert the tests to use the test_strerror helper instead to convert them with sed(1). Signed-off-by: Patrick Steinhardt tests/expected/fdisk/oddinput | 4 ++-- tests/helpers/test_strerror.c | 2 ++ tests/ts/fdisk/oddinput | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) commit f612c4c674e8e07fc40644432d8147a05c62058e Author: Karel Zak Date: Tue Aug 27 13:02:38 2019 +0200 tests: fix --unbuffered mode with ASAN Unfortunately, ASAN is pretty sensitive to LD_PRELOAD, but stdbuf from coreutils is based on LD_PRELOAD. So, I have replaced stdbuf with unbuffer (from expect pkg). The another problem is "${args[@]}" "$@" which does not work as expected. Well, this patch sucks. It would be nice to have things in the way how it has been original expected by Patrick's patch, but ... Signed-off-by: Karel Zak tests/functions.sh | 39 +++++++++++++++++++++------------------ tests/ts/libfdisk/mkpart-full | 1 + tests/ts/misc/swaplabel | 1 + tests/ts/rename/exit_codes | 2 ++ 4 files changed, 25 insertions(+), 18 deletions(-) commit f7f25faae084eda078e038022377e88ee0883aa7 Merge: eebc9e4dc dbeb1d733 Author: Karel Zak Date: Tue Aug 27 10:11:02 2019 +0200 Merge branch '2019wk33' of https://github.com/kerolasa/util-linux * '2019wk33' of https://github.com/kerolasa/util-linux: docs: try to find broken man references and fix them docs: correct su.1 runuser reference from section 8 to 1 po: remove possibility to translate static option arguments commit eebc9e4dc2d3c0de174511823eca74a4cd645bff Author: Patrick Steinhardt Date: Fri Aug 23 15:32:57 2019 +0200 tests: (col) avoid hardcoding of errno string The col/multibyte test has a hardcoded error string as part of its expected output that is returned by glibc's strerror(3P) function. Even though many of these strings are the same across libc implementations, they are not standardiced and some are certainly different. One example is the string for EILSEQ on musl libc. To fix this, we introduce a new test helper "test_strerror". The helper can be invoked with an error code like "EILSEQ", which will cause it to print out the the respective error message for that code. Note that "test_strerror" cannot act on the error's value (e.g. 84 for EILSEQ), as these aren't standardized either. Instead, we thus need to have an array of the error's string representation ("EILSEQ") to its respective error code (the define EILSEQ). The array can trivially be extended as required, thus it is only sparsely populated with EILSEQ right now. To fix the col/multibyte test, we introduce a call to sed(1) to replace the strerror(3P) message from EILSEQ with "EILSEQ". Furthermore, as we're running tests with the POSIX locale by default which treats all bytes as valid multibyte sequences, we have to change to the C.UTF-8 locale instead to actually get an error. Signed-off-by: Patrick Steinhardt tests/commands.sh | 1 + tests/expected/col/multibyte | 2 +- tests/helpers/Makemodule.am | 3 +++ tests/helpers/test_strerror.c | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/ts/col/multibyte | 5 +++-- 5 files changed, 50 insertions(+), 3 deletions(-) commit 6ef9a9e18471b9a57d2b28fd76b4b8e3840d3ffa Author: Patrick Steinhardt Date: Fri Aug 23 15:32:56 2019 +0200 tests: (column) use actually invalid multibytes to test encoding If reading an invalid multibyte sequence, column(1) will encode the byte as "\x" instead. The tests try to verify that by piping "£" into column(1). As the tests run with LC_ALL=POSIX by default, though, libc implementations strictly adhering to the POSIX standard will treat all characters as valid multibyte characters. As a consequence, no EILSEQ is raised by mbtowc(3P) and the character is not encoded as hex, breaking the test. Fix this by setting LC_ALL=C.UTF-8. As "£" is a valid UTF-8 character, we also change the test to use a proper illegal multibyte sequence. Signed-off-by: Patrick Steinhardt tests/expected/column/invalid-multibyte | 2 +- tests/ts/column/invalid-multibyte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 5718f8d96b90871dc4ff759be4164f6daf4f6161 Author: Patrick Steinhardt Date: Fri Aug 23 15:32:55 2019 +0200 tests: (colcrt) fix reliance on EILSEQ in POSIX locale The input file "crash1" in the colcrt/regressions test contains the illegal byte sequence "\x94\x7e". While "\x7e" is '~', "\x94" is not a valid character. Thus, the test assumes that getwc(3P) will return `WEOF` and set `errno=EILSEQ`, causing colcrt(1) to abort reading the stream and thus not print the trailing '~'. This assumption holds just fine for glibc as it will dutifully report EILSEQ, but musl libc will happily read the complete stream without complaining about the illegal character. But in fact, as tests run with LC_ALL=POSIX by default, glibc's behaviour is wrong while musl is right. Quoting mbrtowc(3P) from POSIX.1-2017: [EILSEQ] An invalid character sequence is detected. In the POSIX locale an [EILSEQ] error cannot occur since all byte values are valid characters. Fix the issue by running the colcrt tests with C.UTF8 locale. Signed-off-by: Patrick Steinhardt tests/ts/colcrt/regressions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8892f94c5777dd667b963ac70f48c3c8ac05c880 Author: Patrick Steinhardt Date: Fri Aug 23 15:32:54 2019 +0200 tests: (libfdisk) remove reliance on buffer behaviour of standard streams The tests in libfdisk/mkpart-full all rely on the buffering behaviour of standard output and standard error streams, most importantly that stderr is non-buffering and stdout is buffering. This doesn't hold on all libc implementations when redirecting to a file, breaking the test suite on such platforms. Use `ts_run --unbuffered` to stop buffering of the standard output stream to fix this. Signed-off-by: Patrick Steinhardt tests/expected/libfdisk/mkpart-full-gpt | 14 ++++++------ .../expected/libfdisk/mkpart-full-gpt-err-overlap | 8 +++---- tests/expected/libfdisk/mkpart-full-gpt-nopartno | 14 ++++++------ tests/expected/libfdisk/mkpart-full-gpt-partno-gap | 14 ++++++------ tests/expected/libfdisk/mkpart-full-gpt-space-gap | 10 ++++----- .../expected/libfdisk/mkpart-full-mbr-err-logical | 14 ++++++------ .../expected/libfdisk/mkpart-full-mbr-err-nospace | 6 ++--- .../expected/libfdisk/mkpart-full-mbr-err-primary | 6 ++--- tests/expected/libfdisk/mkpart-full-mbr-logical | 14 ++++++------ tests/expected/libfdisk/mkpart-full-mbr-nopartno | 14 ++++++------ tests/expected/libfdisk/mkpart-full-mbr-primary | 8 +++---- .../libfdisk/mkpart-full-mbr-primary-nopartno | 8 +++---- tests/expected/libfdisk/mkpart-full-mbr-space-gap | 6 ++--- tests/ts/libfdisk/mkpart-full | 26 +++++++++++----------- 14 files changed, 81 insertions(+), 81 deletions(-) commit 801d689e47095f7ecf6c57a8cdf0c8b6108279e3 Author: Patrick Steinhardt Date: Fri Aug 23 15:32:53 2019 +0200 tests: remove reliance on buffer behaviour of stderr/stdout streams In the test cases "rename::exit_codes" and "rename::exit_codes", we rely on the flushing behaviour of stderr and stdout streams relative to each other. Streams in glibc will not flush on newlines if stdout is pointing to a non-TTY file descriptor, but relying on this is fragile and may break on systems with a different behaviour like musl libc. Fix this by introducing a new parameter "--unbuffered" to `ts_run`. If this parameter is passed and stdbuf(1) from coreutils is available, then it will use it to disable buffering of standard output completely. Like this, we can selectively run tests with this if ordering of messages from stdout and stderr is being checked. Signed-off-by: Patrick Steinhardt x tests/expected/misc/swaplabel | 2 +- tests/expected/rename/exit_codes | 2 +- tests/functions.sh | 47 +++++++++++++++++++++++++++++----------- tests/ts/misc/swaplabel | 4 ++-- tests/ts/rename/exit_codes | 2 +- 5 files changed, 39 insertions(+), 18 deletions(-) commit 85efb6562102880c3eade7a0de4edcbce321c591 Author: Bjarni Ingi Gislason Date: Mon Aug 26 19:05:01 2019 +0000 sys-utils/manuals: Make the number of the paired macros ".RS" and ".RE" equal Adjust the number of the macros ".RS" and ".RE" to be equal. There is no change in the formatted output. Signed-off-by: Bjarni Ingi Gislason sys-utils/chcpu.8 | 1 - sys-utils/fstab.5 | 1 + sys-utils/mount.8 | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) commit dbeb1d733e9eb8b77139250d0f5ec8db2c1f44b7 Author: Sami Kerola Date: Sat Aug 24 22:34:16 2019 +0100 docs: try to find broken man references and fix them Unfortunately methods I used to find and fix were based on quite manual process that cannot be easily repeated so I do not see how this fix could be turned into a tools/checkmans.sh addition. Well, lets hope doing this manually twice every decade is good enough. Signed-off-by: Sami Kerola disk-utils/fdisk.8 | 2 +- disk-utils/fsck.8 | 2 +- disk-utils/sfdisk.8 | 2 +- misc-utils/fincore.1 | 2 +- misc-utils/mcookie.1 | 2 +- sys-utils/adjtime_config.5 | 2 +- sys-utils/fstab.5 | 2 +- sys-utils/hwclock.8.in | 4 ++-- sys-utils/mount.8 | 2 +- sys-utils/prlimit.1 | 2 +- sys-utils/renice.1 | 2 +- sys-utils/setarch.8 | 4 ++-- sys-utils/swapon.8 | 2 +- term-utils/script.1 | 2 +- term-utils/setterm.1 | 2 +- text-utils/colrm.1 | 2 +- text-utils/line.1 | 2 +- text-utils/pg.1 | 2 +- text-utils/ul.1 | 4 ++-- 19 files changed, 22 insertions(+), 22 deletions(-) commit 2e028ccce8690b1b4e12b73a5869e5bdc445b791 Author: Sami Kerola Date: Wed Aug 21 21:18:21 2019 +0100 docs: correct su.1 runuser reference from section 8 to 1 Addresses: https://bugs.debian.org/929677 Signed-off-by: Sami Kerola login-utils/su.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a7466bdcbe80ec3b387b835647c8e44fe4ef3c98 Author: Sami Kerola Date: Wed Aug 21 20:25:31 2019 +0100 po: remove possibility to translate static option arguments These strings are expected to be wrote exactly as they are parsed, so make translating them impossible. Since mkfs.cramfs -N option arguments need this treatment use opportunity to slice usage() output to multiple lines. Addresses: https://bugs.debian.org/907568 Signed-off-by: Sami Kerola disk-utils/cfdisk.c | 3 ++- disk-utils/fdisk.c | 9 ++++++--- disk-utils/mkfs.cramfs.c | 36 ++++++++++++++++++------------------ disk-utils/sfdisk.c | 9 ++++++--- misc-utils/cal.c | 3 ++- sys-utils/dmesg.c | 3 ++- 6 files changed, 36 insertions(+), 27 deletions(-) commit e8765d3301285b6d38111184ccec6f8efa473cd0 Merge: 975b321b5 ca8c52b86 Author: Karel Zak Date: Fri Aug 23 12:32:06 2019 +0200 Merge branch 'fix-ger-translation-chrt-help' of https://github.com/Thermi/util-linux * 'fix-ger-translation-chrt-help' of https://github.com/Thermi/util-linux: Fix -n to -b in German help message commit 975b321b5dae3b73346886e4d44fc1e4d6a2862b Author: Karel Zak Date: Thu Aug 22 14:00:32 2019 +0200 libfidk: (dos) fix tiny partitions calculation The code uses last_sector -= 1 for tiny partitions. This does not make sense. This stupidity has been introduced by (my) badly commented commit 09a4ca5e450c5e7cbe860453b76fd68c60fe591f ... sorry. Fortunately, this issue is visible only for tiny partitions on large devices (partitions where size < grain; usual grain is 1MiB) if the last sector is specified by relative notation (+size{siffix}). Note that "last -= 1" makes sense when the "last" is align to the optimal I/O boundary; in this case we need to set the end of the partition one sector before the boundary. For tiny devices it does not makes sense as we do not align these partitions. Addresses: https://github.com/karelzak/util-linux/issues/843 Signed-off-by: Karel Zak libfdisk/src/dos.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 8c863d0eacf41958e39845667b3b5f9a541f1ca2 Author: Karel Zak Date: Thu Aug 22 13:05:06 2019 +0200 eject: use O_EXCL on default * by default we assume all is umounted; so O_EXCL is no problem, otherwise there is bug or race (someone else remounted the device)... * --force and --no-umount disable O_EXCL Addresses: https://github.com/karelzak/util-linux/issues/423 Signed-off-by: Karel Zak sys-utils/eject.1 | 17 +++++++++++++---- sys-utils/eject.c | 20 +++++++++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) commit ca8c52b8609ab3629a60b64672937320a3ce3cfe Author: Noel Kuntze Date: Thu Aug 22 09:02:49 2019 +0200 Fix -n to -b in German help message po/de.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 273ebba11d184a8bb04571dcc8fe4ffdfb1ae3ab Author: Sami Kerola Date: Sun Aug 18 11:11:00 2019 +0100 include/xalloc: reindent function bodies to unify indentation The file used unusual 7 spaces indent step in some of the functions. Signed-off-by: Sami Kerola include/xalloc.h | 55 ++++++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) commit aba9e76e25887a4f73c37eb13f79b4768943578a Author: Sami Kerola Date: Sun Aug 18 11:03:44 2019 +0100 include/xalloc: use multiline function declarations There are two things happening in this commit. 1) Move each function attribute to it's own line 2) move function return value after attributes so that function inputs and outputs are on same line. Signed-off-by: Sami Kerola include/xalloc.h | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) commit ff9da8efca1ca92f332250197fee9b94feb7a82d Author: Sami Kerola Date: Sun Aug 18 10:29:32 2019 +0100 setpwnam: use more appropriate allocation size types Signed-off-by: Sami Kerola login-utils/setpwnam.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) commit 073abd4ca8bd97c19dffc6b5eb50e7c9468f02c5 Author: Sami Kerola Date: Sat Aug 17 21:05:39 2019 +0100 column: pass control struct to local_wcstok() Signed-off-by: Sami Kerola text-utils/column.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 23b98f775f05a75ae7549e37838fc8a47ba3592e Merge: 5200aa99d 0280d31a2 Author: Karel Zak Date: Wed Aug 21 14:37:26 2019 +0200 Merge branch 'container' of https://github.com/slashdd/util-linux * 'container' of https://github.com/slashdd/util-linux: fstrim shouldn't run inside a container commit 5200aa99d27e084b514e8b035db32f39b49562a3 Author: Karel Zak Date: Wed Aug 21 13:42:22 2019 +0200 partx: document -d vs. --nr and fix test The commit ab025087f91b66ee8e23a16bc49eb0d9bd421d65 has disabled error message, but unfortunately it keeps wrong return code. This has been fixed by commit 53ae7d60cfeacd4e87bfe6fcc015b58b78ef4555. This commit add hit about it to docs and fix regression test too. Signed-off-by: Karel Zak disk-utils/partx.8 | 5 ++++- tests/ts/partx/partx | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) commit 53ae7d60cfeacd4e87bfe6fcc015b58b78ef4555 Author: Karel Zak Date: Wed Aug 21 10:51:18 2019 +0200 partx: don't report ENXIO as error on -d The errno ENXIO should be ignored, unfortunately the current code uses variable 'rc' for ioctl return code as well as for final del_parts() return value. So, failed ioctl (which should be ignored) affects all del_parts() status. # modprobe scsi_debug dev_size_mb=100 # partx -d --nr 1-1024 /dev/sdc; echo $? 1 The device dos not contains any partitions, so 0 return code is expected in this case. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1739179 Signed-off-by: Karel Zak disk-utils/partx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit ad167a9023aa1fd04653c6aed0256132514827aa Author: Patrick Steinhardt Date: Thu Aug 15 12:50:05 2019 +0200 libmount: fix comment referring to passno field There's an obvious copy-paste error in `mnt_parse_table_line` when referring to the 6th field of the fstab format, where it says "freq" instead of "passno". This has probably been copied from the 5th field, which is in fact correctly labelled as "freq". Fix the mistake by changing the comment to say "passno" instead. Signed-off-by: Patrick Steinhardt libmount/src/tab_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cdd2d60e56ad2ef103ba6fa46bc6276d52c65f10 Author: Patrick Steinhardt Date: Thu Aug 15 14:03:23 2019 +0200 wdctl: remove duplicate include of The header is included twice in "wdctl.c". Remove one of these includes to keep "make checkincludes" happy. Signed-off-by: Patrick Steinhardt sys-utils/wdctl.c | 1 - 1 file changed, 1 deletion(-) commit 042057d8029dde27cc465d573731579f50c89eee Author: Kevin Hao Date: Mon Aug 19 16:30:22 2019 +0800 libmount: Keep the mnt_tab info for the existent dest in mnt_copy_fs() The "umount -f -a -r" get stuck in a endless loop when run with a mountinfo like below: 15 0 179:2 / / ro,relatime - ext4 /dev/root ro 16 15 0:6 / /dev rw,relatime - devtmpfs devtmpfs rw,size=242896k,nr_inodes=60724,mode=755 17 15 0:4 / /proc rw,relatime - proc proc rw 18 15 0:15 / /mnt/.psplash rw,relatime - tmpfs tmpfs rw,size=40k 19 15 0:16 / /sys rw,relatime - sysfs sysfs rw 20 19 0:7 / /sys/kernel/debug rw,relatime - debugfs debugfs rw 21 15 0:17 / /run rw,nosuid,nodev - tmpfs tmpfs rw,mode=755 22 15 0:18 / /var/volatile rw,relatime - tmpfs tmpfs rw 23 15 179:1 / /boot rw,relatime - vfat /dev/mmcblk0p1 rw,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 24 16 0:19 / /dev/pts rw,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000 25 18 0:20 / /mnt/.psplash rw,relatime - tmpfs tmpfs rw,size=40k The reason is that the two same mnt entry "/mnt/.psplash" will cause the dst->tab set to NULL when umount this mnt entry the second time. This will trigger an endless loop in mnt_reset_table() because that mnt entry is linked on the libmnt_table but its .tab is set to NULL. Signed-off-by: Kevin Hao libmount/src/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 424b66c514501f3a6311b73a69db5ec5729fca49 Author: Karel Zak Date: Mon Aug 19 14:28:50 2019 +0200 tests: Skip fdisk/mbr-nondos-mode on Sparc as unsupported The test has been originally designed as usable on sparc, but now we use it for many features which are MBR specific. Reported-by: John Paul Adrian Glaubitz Co-Author: Anatoly Pugachev Signed-off-by: Karel Zak tests/expected/fdisk/mbr-nondos-mode.sparc | 189 ----------------------------- tests/ts/fdisk/mbr-nondos-mode | 7 +- 2 files changed, 2 insertions(+), 194 deletions(-) commit 9210c0d225fd808da451d86055bf243a8b47a525 Author: Karel Zak Date: Mon Aug 19 14:03:07 2019 +0200 chfn: don't append extra tailing commas # grep kzak /etc/passwd kzak:x:1000:1000::/home/kzak:/bin/bash # chfn kzak ... grep kzak /etc/passwd old version: kzak:x:1000:1000:Karel Zak,,,,:/home/kzak:/bin/bash fixed version: kzak:x:1000:1000:Karel Zak:/home/kzak:/bin/bash Reported-by: Filip Dvorak References: f723cbf544a7eac2927634f2cb6d802437a2d519 Signed-off-by: Karel Zak login-utils/chfn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0280d31a2bd6292acd9a4b86d0f6b5feb275a618 Author: Eric Desrochers Date: Wed Aug 14 12:58:39 2019 -0400 fstrim shouldn't run inside a container Container type implies the following products: openvz OpenVZ/Virtuozzo lxc Linux container implementation by LXC lxc-libvirt Linux container implementation by libvirt systemd-nspawn systemd's minimal container implementation, see systemd-nspawn(1) docker Docker container manager podman Podman container manager rkt rkt app container runtime wsl Windows Subsystem for Linux References: https://www.freedesktop.org/software/systemd/man/systemd.unit.html https://www.freedesktop.org/software/systemd/man/systemd-detect-virt.html# Fix: #840 Signed-off-by: Eric Desrochers sys-utils/fstrim.service.in | 1 + sys-utils/fstrim.timer | 1 + 2 files changed, 2 insertions(+) commit 050def0f3511f743d948458ecd3fda637168a7c7 Author: Rosen Penev Date: Thu Aug 8 12:14:39 2019 -0700 Remove unused utime.h header It is sometimes unavailable and errors on inclusion. For example, when disabled in uClibc-ng. disk-utils/fsck.cramfs.c | 1 - 1 file changed, 1 deletion(-) commit 76b680b1a9deeb83c310115fd96fd6f51d37cd53 Author: Rosen Penev Date: Thu Aug 8 12:12:55 2019 -0700 Remove isascii usage There is a c_isascii function that can be used. isascii is deprecated and not available with some libcs like uClibc-ng where it can be compile time disabled. include/carefulputc.h | 4 +++- term-utils/agetty.c | 3 ++- term-utils/wall.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) commit c60231a7447692c42602c77cf96f1291740f4637 Author: Karel Zak Date: Thu Aug 8 14:20:05 2019 +0200 tests: update fdisk output Signed-off-by: Karel Zak tests/expected/fdisk/gpt-resize | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 08474fde6669d89f5b77653ba9d378fc16e19903 Author: Karel Zak Date: Thu Aug 8 10:34:27 2019 +0200 libfdisk: (script) support shortcuts in the type= field The unnamed-field format supports partition type shortcuts: ",1MiB,L' but for named-field format it requires full type: (mbr) "size=1MiB,type=83" (gpt) "size=1MiB,type=0FC63DAF-8483-4772-8E79-3D69D8477DE4" This patch implements type shortcuts also for named-field format: "size=1MiB,type=L" to make it more user-friendly and unified. Addresses: https://github.com/karelzak/util-linux/issues/837 Signed-off-by: Karel Zak disk-utils/sfdisk.8 | 3 ++- libfdisk/src/script.c | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) commit 11aaedf5742771b1989add0c3801bbaede6bf3b4 Author: Karel Zak Date: Wed Aug 7 11:45:57 2019 +0200 tests: use subtests for mountpoint(1) Signed-off-by: Karel Zak tests/expected/misc/mountpoint | 9 --------- tests/expected/misc/mountpoint-default | 2 ++ tests/expected/misc/mountpoint-mutually-exclusive | 2 ++ tests/expected/misc/mountpoint-nofollow | 2 ++ tests/ts/misc/mountpoint | 10 ++++++---- 5 files changed, 12 insertions(+), 13 deletions(-) commit cd38987bf4ddff34366866fb3305305c6816dd22 Merge: 2adf30dce 6d5625122 Author: Karel Zak Date: Wed Aug 7 11:20:21 2019 +0200 Merge branch 'issue832' of https://github.com/kerolasa/util-linux * 'issue832' of https://github.com/kerolasa/util-linux: mountpoint: add --nofollow option commit 2adf30dceb71135674a74f6f66c84ba5768f107c Merge: cb74ebad2 079751193 Author: Karel Zak Date: Wed Aug 7 11:16:14 2019 +0200 Merge branch 'master' of https://github.com/chstarkd/util-linux * 'master' of https://github.com/chstarkd/util-linux: removed double space fixed mount man page typo, "bythe" -> "by the" commit cb74ebad253c6aaaf81b8f5fcdee8be71c956dbf Author: Karel Zak Date: Tue Aug 6 12:24:33 2019 +0200 libfdisk: refer to partx(8) rather than to kpartx(8) Reported-by: Petr Pisar Signed-off-by: Karel Zak libfdisk/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0797511930ff90d8f97c05e15e37a3cce10197ad Author: Chistyj Arkadij Date: Sun Aug 4 21:21:55 2019 +0300 removed double space sys-utils/mount.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e9d2e0c8197ffcb1b5e92be3002656c644e588d3 Author: Chistyj Arkadij Date: Sun Aug 4 17:06:38 2019 +0300 fixed mount man page typo, "bythe" -> "by the" sys-utils/mount.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6d56251220954f4937c9fafbcdb427d4aa50d330 Author: Sami Kerola Date: Fri Aug 2 19:39:05 2019 +0100 mountpoint: add --nofollow option The no follow option will allow user to distinct mount points from symbolic links pointing to them. Arguably this is pretty pedantic option, mounting a device or bind mount to a directory via symlink does not have or cause any issues. Addresses: https://github.com/karelzak/util-linux/issues/832 Signed-off-by: Sami Kerola bash-completion/mountpoint | 2 +- sys-utils/mountpoint.1 | 7 ++++++- sys-utils/mountpoint.c | 19 ++++++++++++++++--- tests/expected/misc/mountpoint | 9 +++++++++ tests/ts/misc/mountpoint | 27 +++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 5 deletions(-) commit 3661aab4cf7509b03f749477082553f4eee7dc0e Author: Karel Zak Date: Thu Aug 1 11:43:58 2019 +0200 dmesg: fix output hex encoding The current code ignores single-byte non-printable characters. Reported-by: Marc Deslauriers Signed-off-by: Karel Zak sys-utils/dmesg.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) commit 0c493067dddfed8989ee143873e1cda5d2fe3cb9 Author: Karel Zak Date: Thu Aug 1 11:06:06 2019 +0200 choom: improve docs It's not obvious from the current docs that you have to explicitly split command line options and wanted commands. Addresses: https://github.com/karelzak/util-linux/issues/833 Signed-off-by: Karel Zak sys-utils/choom.1 | 1 + sys-utils/choom.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) commit c4d6d1c54dcd0eff701236d396d88b1fc6251768 Author: Karel Zak Date: Wed Jul 31 16:18:27 2019 +0200 libblkid: fix file descriptor leak in blkid_verify() The function blkid_verify() uses private device file descriptor and uses blkid_probe_set_device() to assign the descriptor to low-level probing code. Unfortunately, close() in this case is not enough as the prober can internally open whole-disk device too. The library API has been extended so blkid_probe_set_device() deallocates and close previously used prober for whole-disk. This new functionality is used in blkid_verify() now. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1734545 Signed-off-by: Karel Zak libblkid/src/probe.c | 19 ++++++++++++++++--- libblkid/src/verify.c | 4 +++- 2 files changed, 19 insertions(+), 4 deletions(-) commit efee3e01bf64e45a764b2af98e578deb20578f6b Merge: 325bfd53e b5f376d11 Author: Karel Zak Date: Mon Jul 29 11:13:51 2019 +0200 Merge branch '2019wk29' of https://github.com/kerolasa/util-linux * '2019wk29' of https://github.com/kerolasa/util-linux: lscpu: prefer memcpy() to manual pointer arithmetic commit 325bfd53e889fd52f240e4bcbd690b03dddc7570 Author: Yousong Zhou Date: Mon Jul 29 01:24:29 2019 +0000 column: fix outputing empty column at the end of line The following commands manifests the problem. In old versions before commit 4762ae9d60 ("column: use libsmartcols for --table"), both of them should output with 2 "|" echo '||' | column -o '|' -s '|' -t echo '|| ' | column -o '|' -s '|' -t Fixes: 4762ae9d60 ("column: use libsmartcols for --table") Signed-off-by: Yousong Zhou Reviewed-by: Sami Kerola tests/expected/column/table-empty-column-at-eol | 1 + tests/expected/column/table-empty-column-at-eol2 | 1 + tests/ts/column/table | 8 ++++++++ text-utils/column.c | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) commit b5f376d11d9f9e25be32920705bd5ee54684ca36 Author: Sami Kerola Date: Sat Jul 27 18:55:01 2019 +0100 lscpu: prefer memcpy() to manual pointer arithmetic With pointer arithmetic clang address sanitizer gives following error this change addresses. Notice the following happens only when running as root. sys-utils/lscpu-dmi.c:83:14: runtime error: load of misaligned address 0x55a1d62f3d1d for type 'const uint16_t' (aka 'const unsigned short'), which requires 2 byte alignment Signed-off-by: Sami Kerola sys-utils/lscpu-dmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8bad603ae0a87f58cc79eb590a9fd7c68514009a Author: Karel Zak Date: Thu Jul 25 12:23:59 2019 +0200 lscpu: (man) add note about cache sizes Addresses: https://github.com/karelzak/util-linux/issues/827 Signed-off-by: Karel Zak sys-utils/lscpu.1 | 5 +++++ 1 file changed, 5 insertions(+) commit 2a952555d2b56ffaf461465139255c94bf6a49a5 Author: Sami Kerola Date: Sun Jul 21 21:36:28 2019 +0100 agetty: simplify code in dolog() preprocessor blocks Aim is to make dolog() a lot more readable and understandable, with downside of when (rarely?) USE_SYSLOG it not defined the function will use a bit more space from stack. I think that is price well worth paying. Signed-off-by: Sami Kerola term-utils/agetty.c | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) commit 1aaee548e3cbe00a084103792b03605182eefd04 Author: Sami Kerola Date: Sun Jul 21 19:12:03 2019 +0100 login: simplify string handling Signed-off-by: Sami Kerola login-utils/login.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 0675f52ab5014b8c0ef5c1a2763b8526e8b03eaa Author: Sami Kerola Date: Sat Jul 20 11:11:01 2019 +0100 last: replace strncat() with more robust mem2strcpy() Signed-off-by: Sami Kerola login-utils/last.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 7ea0907364e626eaed4441355f00fc6d79fcd3db Author: Karel Zak Date: Tue Jul 23 16:35:20 2019 +0200 tests: (fdisk) update padding in output Signed-off-by: Karel Zak tests/expected/fdisk/sunlabel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit fc970a0947469b2a7fe80af704e9fca307116c0f Author: Karel Zak Date: Tue Jul 23 16:26:48 2019 +0200 tests: (libsmartcols) add padding tests Signed-off-by: Karel Zak .../expected/libsmartcols/fromfile-padding-default | 11 ++++++ .../expected/libsmartcols/fromfile-padding-maxout | 11 ++++++ .../expected/libsmartcols/fromfile-padding-minout | 11 ++++++ tests/ts/libsmartcols/files/data-string-empty | 10 +++++ tests/ts/libsmartcols/fromfile | 46 ++++++++++++++++++++++ 5 files changed, 89 insertions(+) commit 94dbb322737524027a55e6ed5646dc69c5ed9e5b Author: Karel Zak Date: Tue Jul 23 16:04:51 2019 +0200 libsmartcols: cleanup and extend padding functionality LIBSMARTCOLS_DEBUG_PADDING=on in the next examples forces libsmartcols print '.' as a padding char. See line "ffff" in the exmaples. * default output is to fill all except last cell $ LIBSMARTCOLS_DEBUG_PADDING=on ./sample-scols-fromfile --nlines 10 --width 80 --column tests/ts/libsmartcols/files/col-name --column tests/ts/libsmartcols/files/col-number --column tests/ts/libsmartcols/files/col-string --column tests/ts/libsmartcols/files/col-string tests/ts/libsmartcols/files/data-string tests/ts/libsmartcols/files/data-number tests/ts/libsmartcols/files/data-string-empty tests/ts/libsmartcols/files/data-string-empty 2> /dev/null NAME.. ......NUM STRINGS STRINGS aaaa.. ........0 aaaa... aaaa bbb... ......100 bbb.... bbb ccccc. .......21 ccccc.. ccccc dddddd ........3 dddddd. dddddd ee.... ......411 ee..... ee ffff.. .....5111 ....... gggggg 678993321 gggggg. gggggg hhh... ..7666666 hhh.... hhh * scols_table_enable_minout() minimizes output for tailing empty cells, example: $ LIBSMARTCOLS_DEBUG_PADDING=on ./sample-scols-fromfile --nlines 10 --minout --width 80 --column tests/ts/libsmartcols/files/col-name --column tests/ts/libsmartcols/files/col-number --column tests/ts/libsmartcols/files/col-string --column tests/ts/libsmartcols/files/col-string tests/ts/libsmartcols/files/data-string tests/ts/libsmartcols/files/data-number tests/ts/libsmartcols/files/data-string-empty tests/ts/libsmartcols/files/data-string-empty 2> /dev/null NAME.. ......NUM STRINGS STRINGS aaaa.. ........0 aaaa... aaaa bbb... ......100 bbb.... bbb ccccc. .......21 ccccc.. ccccc dddddd ........3 dddddd. dddddd ee.... ......411 ee..... ee ffff.. .....5111 gggggg 678993321 gggggg. gggggg hhh... ..7666666 hhh.... hhh * cleanup up scols_table_enable_maxout() use, example: $ LIBSMARTCOLS_DEBUG_PADDING=on ./sample-scols-fromfile --nlines 10 --maxout --width 80 --column tests/ts/libsmartcols/files/col-name --column tests/ts/libsmartcols/files/col-number --column tests/ts/libsmartcols/files/col-string --column tests/ts/libsmartcols/files/col-string tests/ts/libsmartcols/files/data-string tests/ts/libsmartcols/files/data-number tests/ts/libsmartcols/files/data-string-empty tests/ts/libsmartcols/files/data-string-empty 2> /dev/null NAME.............. ..................NUM STRINGS............ STRINGS............ aaaa.............. ....................0 aaaa............... aaaa............... bbb............... ..................100 bbb................ bbb................ ccccc............. ...................21 ccccc.............. ccccc.............. dddddd............ ....................3 dddddd............. dddddd............. ee................ ..................411 ee................. ee................. ffff.............. .................5111 ................... ................... gggggg............ ............678993321 gggggg............. gggggg............. hhh............... ..............7666666 hhh................ hhh................ Note that we cannot make scols_table_enable_minout() default because for example "column --table" is pretty commonly used with non-blank columns separator and in this case all cells has to be filled. $ echo -e "aa,b,ccc\na,,\naaa,bbb,ccc" | column --table --separator ',' --output-separator '|' aa |b |ccc a | | aaa|bbb|ccc Addresses: https://github.com/karelzak/util-linux/issues/826 Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 3 + libsmartcols/samples/fromfile.c | 11 +++- libsmartcols/src/libsmartcols.h.in | 3 + libsmartcols/src/libsmartcols.sym | 6 ++ libsmartcols/src/print.c | 81 +++++++++++++++++++++++---- libsmartcols/src/smartcolsP.h | 1 + libsmartcols/src/table.c | 68 +++++++++++++++++++++- tests/expected/lsblk/lsblk-simple-lvm-vendor | 38 ++++++------- tests/expected/lsblk/lsblk-simple-nvme-vendor | 22 ++++---- 9 files changed, 188 insertions(+), 45 deletions(-) commit 10c39f03a1e70cf2a4b8e0301784174ac5730251 Author: Karel Zak Date: Mon Jul 22 12:09:38 2019 +0200 libfdisk: improve partition copy on resize It seems pretty fragile to copy also reference counting and reference to table list. Addresses: https://github.com/karelzak/util-linux/pull/822 Signed-off-by: Karel Zak libfdisk/src/partition.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 1768d77c18a4c892adb985870438325496d57f83 Author: Karel Zak Date: Mon Jul 22 11:49:45 2019 +0200 libblkid: (drbd) fix comment formatting ... to avoid misinterpretation by gtk-docs. Signed-off-by: Karel Zak libblkid/src/superblocks/drbd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 68cf159b0703b0886a11750237d7fa8b1a9066eb Merge: c64d452b3 79f37ec4e Author: Karel Zak Date: Mon Jul 22 11:35:12 2019 +0200 Merge branch 'master_fix-partition-copy' of https://github.com/vojtechtrefny/util-linux commit c64d452b3eb85fe55e238144082247b05cc143ea Author: Karel Zak Date: Mon Jul 22 11:10:30 2019 +0200 fstrim: fix systemd service protection ProtectHome=yes makes /home inaccessible, but we need to open the directories (mountpoints) read-only. Addresses: https://github.com/karelzak/util-linux/issues/824 Signed-off-by: Karel Zak sys-utils/fstrim.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 79f37ec4e1ab65664a2930793f497b288563e907 Author: Vojtech Trefny Date: Fri Jul 19 13:35:11 2019 +0200 libfdisk: Fix double free of *_chs strings in fdisk_partition __copy_partition doesn't duplicate these strings which leads to occasional double free. Signed-off-by: Vojtech Trefny libfdisk/src/partition.c | 4 ++++ 1 file changed, 4 insertions(+) commit 1ace839781b73517790f714fbd9c9c48e2297148 Author: Karel Zak Date: Wed Jul 17 12:42:39 2019 +0200 libfdisk: don't use NTFS as MBR Same as 7c643ed2855058657798d9e8e80701023de14a08. Signed-off-by: Karel Zak libfdisk/src/dos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit cdb91409674cfb5d94a374b1e3b2bf1869ecfec7 Author: Karel Zak Date: Wed Jul 17 12:35:45 2019 +0200 libblkid: do not interpret NTFS as MBR # mkntfs -Q -F /dev/sdc old version: # ./blkid -p /dev/sdc /dev/sdc: UUID="0E9E8C5F2F718479" TYPE="ntfs" USAGE="filesystem" PTTYPE="dos" new version:  # ./blkid -p /dev/sdc /dev/sdc: UUID="0E9E8C5F2F718479" TYPE="ntfs" USAGE="filesystem" Reported-by: Mike Fleetwood Signed-off-by: Karel Zak libblkid/src/partitions/dos.c | 7 +++++++ libblkid/src/superblocks/ntfs.c | 24 +++++++++++++++++++++++- libblkid/src/superblocks/superblocks.h | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) commit 7c643ed2855058657798d9e8e80701023de14a08 Author: Karel Zak Date: Wed Jul 17 12:11:38 2019 +0200 libfdisk: don't use FAT as MBR The current libfdisk MBR detection is too weak, the result is that it reuses MBR from FAT. The correct behavior is to create a new MBR, wipe first sector (on write) and warn about obsolete FAT superblock. Reported-by: Mike Fleetwood Signed-off-by: Karel Zak libfdisk/src/context.c | 16 +++++++++++----- libfdisk/src/dos.c | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) commit b1062292066e0568adbbdbb104b7afdcc5dac25f Author: Karel Zak Date: Mon Jul 15 15:32:49 2019 +0200 build-sys: improve hwclock CMOS dependences Let's use standard UL_* macros to check for dependencies (architectures and hwclock). Signed-off-by: Karel Zak configure.ac | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) commit c7eca69d6d89262c71b6d412f6b3a469fad07d7d Author: Karel Zak Date: Mon Jul 15 15:31:40 2019 +0200 build-sys: add UL_REQUIRES_ARCH() Signed-off-by: Karel Zak m4/ul.m4 | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) commit 88bc304ba815e21b09373cfec4e2f1f087482214 Author: Carlos Santos Date: Wed Jul 3 13:31:34 2019 -0300 hwclock: use CMOS clock only if available - Add --disable-hwclock-cmos configuration argument - Add USE_HWCLOCK_CMOS (enabled by default for i386/x86_64) - Add define(USE_HWCLOCK_CMOS) - Compile hwclock-cmos.c only if USE_HWCLOCK_CMOS is true - Remove all unnecessary #ifdefs from hwclock-cmos.c - Add #ifdef USE_HWCLOCK_CMOS around the determine_clock_access_method() call in hwclock.c Signed-off-by: Carlos Santos configure.ac | 13 +++++++++++++ sys-utils/Makemodule.am | 7 +++++-- sys-utils/hwclock-cmos.c | 47 ++++++----------------------------------------- sys-utils/hwclock.c | 2 ++ 4 files changed, 26 insertions(+), 43 deletions(-) commit 8ebecc18e859474986cdb2fbe9fa3419e3417e28 Author: Karel Zak Date: Mon Jul 15 12:46:11 2019 +0200 tests: (libmount) make X-* and x-* more robust Addresses: https://github.com/karelzak/util-linux/issues/818 Signed-off-by: Karel Zak .../expected/libmount/{context-X-mount.mkdir => context-X-comment} | 0 .../libmount/{context-x-mount.mkdir => context-x-permanent} | 0 tests/ts/libmount/context | 7 ++++--- 3 files changed, 4 insertions(+), 3 deletions(-) commit 9e677de1ecbb5c724f679e66d773494e370db97f Author: Karel Zak Date: Mon Jul 15 12:28:26 2019 +0200 lsblk: fix -E segfault We need to check if referenced wholedisk defines the de-duplication key... Addresses: https://github.com/karelzak/util-linux/issues/819 Signed-off-by: Karel Zak misc-utils/lsblk-devtree.c | 2 ++ 1 file changed, 2 insertions(+) commit 5c8a88356d436f6a87e2c40347dd19d6f5b50198 Author: Karel Zak Date: Mon Jul 15 12:07:42 2019 +0200 libblkid: (drbd) simplify padding We do not need all the metadata and it seems the extra padding is problematic in some cases. Let's keep is simple and use fixed offset for the metadata rather than sizeof(). References: https://github.com/karelzak/util-linux/pull/820 Signed-off-by: Karel Zak libblkid/src/superblocks/drbd.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) commit 6744302ce5b23ef19d7cfaa20cb53d27642ea8ac Merge: 1632856ef f55dd4cc2 Author: Karel Zak Date: Mon Jul 15 11:37:17 2019 +0200 Merge branch '2019wk27' of https://github.com/kerolasa/util-linux * '2019wk27' of https://github.com/kerolasa/util-linux: libblkid: fix address sanitizer issues libblkid: check number of test_blkid_save arguments correctly include/xalloc: ensure xstrdup() and xstrndup() returns nonnull attribute libmount: fix potential null pointer dereference libfdisk: fix variable shadowing lib/ttyutils: avoid checking same thing twice commit 1632856ef19efb50c57c939b82a9ff712b3c0b09 Author: Florian Weimer Date: Fri Jul 5 17:20:27 2019 +0200 build-sys: Include in ./configure wchar_t test Without #include , this configure check fails for strict C99/C11 compilers which do not support implicit function declarations (which are a C90 feature removed from C99). Signed-off-by: Karel Zak configure.ac | 1 + 1 file changed, 1 insertion(+) commit f55dd4cc2dadfa74e5a207a4058489fa4d10387a Author: Sami Kerola Date: Sun Jul 14 10:17:32 2019 +0100 libblkid: fix address sanitizer issues With aligned attribute many blkid tests fail with following error. So instead of aligning to 4K add padding that makes the struct same size without causing asan trip over. libblkid/src/superblocks/drbd.c:179:6: runtime error: member access within misaligned address 0x55913d7e6958 for type 'struct meta_data_on_disk_9', which requires 4096 byte alignment In zfs structure it seems compiler is adding padding, that does not mix well with be32_to_cpu() and other bit operations. libblkid/src/superblocks/zfs.c:109:23: runtime error: load of misaligned address 0x7ff6406540e4 for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment Signed-off-by: Sami Kerola libblkid/src/superblocks/drbd.c | 2 +- libblkid/src/superblocks/zfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 9175f39075b130bce00ed4b0d23be90a1defa915 Author: Sami Kerola Date: Sat Jul 13 09:31:06 2019 +0100 libblkid: check number of test_blkid_save arguments correctly Without this running test_blkid_save without arguments will cause a crash when strdup() refers to none-exiting file name. Signed-off-by: Sami Kerola libblkid/src/save.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f3aded3fdb1e19818b05f205b74cd4bff7532811 Author: Sami Kerola Date: Fri Jul 12 22:28:10 2019 +0100 include/xalloc: ensure xstrdup() and xstrndup() returns nonnull attribute Turned out lsblk is passing null as argument to xstrdup(), so fix that and add assert() to make sure promise of not returning null is kept in future. Signed-off-by: Sami Kerola include/xalloc.h | 6 ++---- misc-utils/lsblk.c | 8 +++++++- 2 files changed, 9 insertions(+), 5 deletions(-) commit 371be858d74fe5562a403af75e596d7bd0042905 Author: Sami Kerola Date: Fri Jul 12 21:56:52 2019 +0100 libmount: fix potential null pointer dereference This is false positive warning, but lets silence it so that if and when warnings crop up they are easy to notice and take seriously. libmount/src/optstr.c:354:29: warning: potential null pointer dereference [-Wnull-dereference] Signed-off-by: Sami Kerola libmount/src/optstr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 34813bdd29cd2012bec61156286018ed9e13817a Author: Sami Kerola Date: Fri Jul 12 21:45:50 2019 +0100 libfdisk: fix variable shadowing libfdisk/src/context.c:678:7: warning: declaration of ‘rc’ shadows a previous local [-Wshadow] Signed-off-by: Sami Kerola libfdisk/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5119ef0a8335a7a9e3fde2b6990ed66e2c0b5974 Author: Sami Kerola Date: Mon Jul 1 22:02:06 2019 +0100 lib/ttyutils: avoid checking same thing twice Check cols and lines are not NULL only once. Signed-off-by: Sami Kerola lib/ttyutils.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit e3bb9bfb76c17b1d05814436ced62c05c4011f48 Author: Karel Zak Date: Thu Jun 27 09:22:18 2019 +0200 lsblk: force to print PKNAME for partition PKNAME (parent kernel device name) is based on printed tree according to parent -> child relationship. The tree is optional and not printed if partition specified (.e.g "lsblk -o+PKNAME /dev/sda1"), but old versions print the PKNAME also in this case. Addresses: https://github.com/karelzak/util-linux/issues/813 Signed-off-by: Karel Zak misc-utils/lsblk.c | 3 +++ 1 file changed, 3 insertions(+) commit cfb9934d5fb6a8fb3499d9c6cdac6640ce57275a Author: Sanchit Saini <49326387+sanchit-saini@users.noreply.github.com> Date: Fri Jun 21 23:21:46 2019 +0530 TODO: fix typo Documentation/TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d670a3f30bfc4794b42ba9d564656d419c946572 Author: Stanislav Brabec Date: Thu Jun 20 23:42:40 2019 +0200 Fix translations for losetup typo fix Signed-off-by: Stanislav Brabec po/cs.po | 2 +- po/da.po | 2 +- po/de.po | 4 ++-- po/es.po | 2 +- po/fr.po | 2 +- po/hr.po | 4 ++-- po/pl.po | 2 +- po/pt_BR.po | 4 ++-- po/sv.po | 2 +- po/uk.po | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) commit ec06412c90f789864a99361f46740fe640a01679 Author: Stanislav Brabec Date: Thu Jun 20 23:41:30 2019 +0200 losetup: Typo fix Fix a typo in usage introduced in a1a41597bf. Signed-off-by: Stanislav Brabec sys-utils/losetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b0853a08dba1163613069ba24cb09cc2f0282d98 Author: Stanislav Brabec Date: Thu Jun 20 22:16:42 2019 +0200 agetty: Remove superfluous fflush() eval_issue_file() contains fflush(stdout). It comes from an old code that used fputs() to write to the console. In the new code, we write to a temporary memstream, and fclose(ie->output) fully replaces possible fflush(ie->output) in this implementation. The new print_issue_file() does not need it as well, as it uses unbuffered write_all(). Signed-off-by: Stanislav Brabec term-utils/agetty.c | 2 -- 1 file changed, 2 deletions(-) commit f1424a94239f9149939b45ed9f19e8f77fb1847d Author: Marcos Mello Date: Thu Jun 20 08:22:25 2019 -0300 libfdisk: fix typos libfdisk/src/alignment.c | 2 +- libfdisk/src/context.c | 8 ++++---- libfdisk/src/label.c | 8 ++++---- libfdisk/src/script.c | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) commit dab1303287b7ebe30b57ccc78591070dad0a85ea Author: Karel Zak Date: Tue Jun 18 22:05:16 2019 +0200 Revert "lib/loopdev.c: Inline loopcxt_has_device" ... no caller in that file, this change has no effect. This reverts commit 3bb960c7b5f1428f1bff885b2667787e8af5001b. lib/loopdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7571ec08a15d54ad05e4b619ccef5a6f10ce30bc Author: Karel Zak Date: Tue Jun 18 13:30:42 2019 +0200 libfdisk: add fdisk_assign_device_by_fd() It's possible that caller has the device already opened for some other task, so let's reuse the file descriptor. Requested-by: Lennart Poettering Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/context.c | 142 ++++++++++++++++++++++++------------ libfdisk/src/fdiskP.h | 1 + libfdisk/src/libfdisk.h.in | 2 + libfdisk/src/libfdisk.sym | 1 + 5 files changed, 99 insertions(+), 48 deletions(-) commit fdf62463ce5461c7cc1d2799a031fc8cbbd02b62 Merge: bddcf5b81 9a1a98220 Author: Karel Zak Date: Tue Jun 18 11:26:12 2019 +0200 Merge branch 'su_err_msg' of https://github.com/jhrozek/util-linux * 'su_err_msg' of https://github.com/jhrozek/util-linux: su: More descriptive error message on malformed user entry commit bddcf5b81673b4cc362b36bac3caaeabb1738fcc Merge: 52aa1a661 b3dd29d1b Author: Karel Zak Date: Mon Jun 17 15:48:28 2019 +0200 Merge branch 'topic/wdctl' commit b3dd29d1b878865102c5cb366dd3e814ce043cb9 Author: Karel Zak Date: Thu Jun 6 11:17:13 2019 +0200 wdctl; read from /sys if necessary The device can be inaccessible for non-root user or busy (already used by another process). In this case it seems better to read information from /sys. Note that /sys does not provide struct watchdog_info.options, so we cannot print list of supported watchdog features. Addresses: https://github.com/karelzak/util-linux/issues/804 Signed-off-by: Karel Zak include/pathnames.h | 1 + sys-utils/wdctl.8 | 4 +++ sys-utils/wdctl.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 77 insertions(+), 9 deletions(-) commit e3188dd90a4cd51723fefdcea8c3b82a6e7afc29 Author: Karel Zak Date: Thu Jun 6 11:09:17 2019 +0200 lib/path: make sure ul_path_read_buffer() derminate result Signed-off-by: Karel Zak lib/path.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 8c8df4214656794b82d4eac5dffe36d3cac389e3 Author: Karel Zak Date: Fri May 31 14:49:23 2019 +0200 wdctl: default to /dev/watchdog0 Let's use miscdev /dev/watchdog as fallback only. We need (if possible) cdev /dev/watchdog0 as this device has entry in /sys/class/watchdog. Signed-off-by: Karel Zak include/pathnames.h | 3 --- sys-utils/wdctl.c | 43 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 10 deletions(-) commit 5d628f37b7423c0047136c81aa7ff3b812fcaed9 Author: Karel Zak Date: Fri May 31 14:25:41 2019 +0200 wdctl: remove printing from main() Signed-off-by: Karel Zak sys-utils/wdctl.c | 62 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 27 deletions(-) commit a599d1375e80d061dcc6b5fad3f0ffaef55d831d Author: Karel Zak Date: Fri May 31 14:18:19 2019 +0200 wdctl: add control struct * remove global variables * keep all together Signed-off-by: Karel Zak sys-utils/wdctl.c | 58 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) commit e4d511d40c492928b36286b2d64927ffa9382680 Author: Karel Zak Date: Fri May 31 14:06:04 2019 +0200 wdctl: rename watch dog info struct Signed-off-by: Karel Zak sys-utils/wdctl.c | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) commit 52aa1a661110e235a9eff57bb4db88aa8412dac1 Author: Karel Zak Date: Thu Jun 13 13:25:44 2019 +0200 include/closestream: avoid close more than once Signed-off-by: Karel Zak include/closestream.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 25b7045e5db032df5354c0749cb454a20b89c522 Author: Karel Zak Date: Thu Jun 13 13:22:32 2019 +0200 misc: replaces atexit(close_stdout) with new close_stdout_atexit() Signed-off-by: Karel Zak sys-utils/fsfreeze.c | 2 +- sys-utils/ldattach.c | 2 +- sys-utils/losetup.c | 2 +- sys-utils/lscpu.c | 2 +- sys-utils/lsipc.c | 2 +- text-utils/colrm.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) commit 73ec5e164c8e67bb2621c58fcccbdef54da8e1ca Author: Karel Zak Date: Mon Jun 10 11:43:56 2019 +0200 libfdisk: fix fdisk_script_get_table() Make sure we never return NULL and we reuse the table in code. Signed-off-by: Karel Zak libfdisk/src/script.c | 32 +++++++++++++++++++------------- libfdisk/src/table.c | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) commit 9335bfc84503dbb3993a9a07e9a001dd987468cb Author: Karel Zak Date: Fri Jun 7 13:21:23 2019 +0200 libfdisk: (docs) add notes about fdisk_enable_wipe() Signed-off-by: Karel Zak libfdisk/src/context.c | 31 ++++++++++++++++++++++--------- libfdisk/src/label.c | 3 ++- 2 files changed, 24 insertions(+), 10 deletions(-) commit bfdca6d7287bedb8c40c9750fc3523544bbf5022 Author: Karel Zak Date: Fri Jun 7 12:20:53 2019 +0200 libfdisk: add fdisk_script_set_table() This small change improves possibility to modify by script described PT and use script API in another tools as primary way to create partitions. All you need is to compose script by fdisk_script_set_header() and fdisk_script_set_table() and than apply by fdisk_apply_script(). Requested-by: Lennart Poettering Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/libfdisk.h.in | 1 + libfdisk/src/libfdisk.sym | 4 ++ libfdisk/src/script.c | 76 ++++++++++++++++++++++++++++++------- 4 files changed, 69 insertions(+), 13 deletions(-) commit cf3b6b71ebb1f3da975ad12d95a6fa3a15591e63 Author: Karel Zak Date: Thu Jun 6 14:05:26 2019 +0200 lscpu: add a new columns to --cache References: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu Signed-off-by: Karel Zak sys-utils/lscpu.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++----- sys-utils/lscpu.h | 9 ++++++++- 2 files changed, 57 insertions(+), 6 deletions(-) commit 0c93519e78018202052fff6cfb5c0a98eb587ae9 Author: Karel Zak Date: Mon Jun 17 12:55:25 2019 +0200 docs: we have 2019 already Signed-off-by: Karel Zak NEWS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 9a1a98220697f922a4c0d8460b899987ad0e1c61 Author: Jakub Hrozek Date: Fri May 31 13:13:10 2019 +0200 su: More descriptive error message on malformed user entry With users coming from LDAP, it is often the case that the entry in LDAP does not contain one or more attributes required by su or, because of misconfigured access control rights, the attribute might not be readable by the LDAP client. In that case, su just tells the user that the user does not exist. It might be more user-friendly to tell the user to check the user entry for all required fields. login-utils/su-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)