Changes between v2.30 and v2.31-rc1 -------------------------------------------- commit 47ba6dc4118ba9eae88fa0ae1f29b5fc6910c456 Author: Karel Zak Date: Fri Sep 22 12:03:15 2017 +0200 build-sys: release++ (v2.31-rc1) Signed-off-by: Karel Zak NEWS | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) commit e140bddbb81b66e53353f4ec3239efe5dbe2676c Author: Karel Zak Date: Fri Sep 22 11:53:22 2017 +0200 docs: update v2.31 release notes Signed-off-by: Karel Zak Documentation/releases/v2.31-ReleaseNotes | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) commit 566757317f128b2afe0125703adf40209f37864c Author: Karel Zak Date: Fri Sep 22 11:49:50 2017 +0200 po: merge changes Signed-off-by: Karel Zak po/ca.po | 186 +++++++++++++++++++++++++-------------------------- po/cs.po | 191 +++++++++++++++++++++++++++-------------------------- po/da.po | 191 +++++++++++++++++++++++++++-------------------------- po/de.po | 184 +++++++++++++++++++++++++-------------------------- po/es.po | 191 +++++++++++++++++++++++++++-------------------------- po/et.po | 186 +++++++++++++++++++++++++-------------------------- po/eu.po | 173 +++++++++++++++++++++++------------------------- po/fi.po | 184 +++++++++++++++++++++++++-------------------------- po/fr.po | 182 +++++++++++++++++++++++++------------------------- po/gl.po | 168 ++++++++++++++++++++++------------------------ po/hr.po | 168 ++++++++++++++++++++++------------------------ po/hu.po | 186 +++++++++++++++++++++++++-------------------------- po/id.po | 194 ++++++++++++++++++++++++++++-------------------------- po/it.po | 186 +++++++++++++++++++++++++-------------------------- po/ja.po | 192 +++++++++++++++++++++++++++-------------------------- po/nl.po | 192 +++++++++++++++++++++++++++-------------------------- po/pl.po | 191 +++++++++++++++++++++++++++-------------------------- po/pt_BR.po | 191 +++++++++++++++++++++++++++-------------------------- po/ru.po | 173 +++++++++++++++++++++++------------------------- po/sl.po | 186 +++++++++++++++++++++++++-------------------------- po/sv.po | 191 +++++++++++++++++++++++++++-------------------------- po/tr.po | 192 +++++++++++++++++++++++++++-------------------------- po/uk.po | 191 +++++++++++++++++++++++++++-------------------------- po/util-linux.pot | 165 +++++++++++++++++++++------------------------- po/vi.po | 192 +++++++++++++++++++++++++++-------------------------- po/zh_CN.po | 192 +++++++++++++++++++++++++++-------------------------- po/zh_TW.po | 194 ++++++++++++++++++++++++++++-------------------------- 27 files changed, 2512 insertions(+), 2500 deletions(-) commit e552f49ffab7dc14f31b8ea6a089ce5256544352 Author: Masanari Iida Date: Thu Sep 21 23:23:25 2017 +0900 po: Fix translation in ja.po English message and Japanese translation are unmatch. Signed-off-by: Masanari Iida po/ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2f2e6e0f4ee359d18f1cad2cf98c8a48eaccd476 Author: Masanari Iida Date: Thu Sep 21 23:23:24 2017 +0900 po:Fix a typo Signed-off-by: Masanari Iida po/ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 93aa7bd66be7238e38b27328d752ac3c6e5e9513 Merge: 876bd6875 f0a0ce744 Author: Karel Zak Date: Fri Sep 22 10:59:05 2017 +0200 Merge branch '170915' of github.com:jwpi/util-linux * '170915' of github.com:jwpi/util-linux: hwclock: make debug implicit for test mode. hwclock: exit bug fix and single test mode message commit f0a0ce744573bc3b3164062bc25e8fc6ddc7d9b9 Author: J William Piggott Date: Wed Sep 20 18:54:35 2017 -0400 hwclock: make debug implicit for test mode. Calling --test without --debug is not useful, so make it implicit. Signed-off-by: J William Piggott sys-utils/hwclock.8.in | 8 ++++---- sys-utils/hwclock.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) commit c4b0dc3ea3e9d4bb53c29540b60346a5ad0fff7f Author: J William Piggott Date: Tue Sep 19 20:55:23 2017 -0400 hwclock: exit bug fix and single test mode message Bug fix: hwclock returns success when saving /etc/adjtime fails. Remove redundant test mode messages. Signed-off-by: J William Piggott sys-utils/hwclock.c | 61 ++++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 38 deletions(-) commit 876bd687531b8af5851748aaa48ee18018d73760 Author: J William Piggott Date: Wed Sep 20 21:20:47 2017 -0400 Docs: add hwclock 'highlights' v2.31-ReleaseNotes Signed-off-by: J William Piggott Documentation/releases/v2.31-ReleaseNotes | 8 ++++++++ 1 file changed, 8 insertions(+) commit 9445be41143b5deec710d5d9f1db92b3fe5cf6ba Author: J William Piggott Date: Wed Sep 20 21:18:13 2017 -0400 Docs: grammar fixes for v2.31-ReleaseNotes Signed-off-by: J William Piggott Documentation/releases/v2.31-ReleaseNotes | 58 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) commit 323e0668cd380b3353da03d5bd74887ab26f1ea3 Author: Karel Zak Date: Wed Sep 20 12:14:42 2017 +0200 po: fix ipcrm translation error fr.po Addresses: https://github.com/karelzak/util-linux/issues/512 Signed-off-by: Karel Zak po/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9db9997a5a561d37b5d5f2f4955fb665a681028c Author: Karel Zak Date: Wed Sep 20 11:31:42 2017 +0200 docs: update v2.31-ReleaseNotes Signed-off-by: Karel Zak Documentation/releases/v2.31-ReleaseNotes | 596 ++++++++++++++++++++++++++++++ 1 file changed, 596 insertions(+) commit b74a9aa00f4935f69ac11c82b5c83b8920c6c45f Author: Karel Zak Date: Tue Sep 19 14:44:50 2017 +0200 docs: remove UUID v3 and v5 from TODO Signed-off-by: Karel Zak Documentation/TODO | 6 ------ 1 file changed, 6 deletions(-) commit e721615482f4f4258d77f535227c52ccbe1c0c72 Author: Karel Zak Date: Tue Sep 19 14:17:25 2017 +0200 docs: update AUTHORS file Signed-off-by: Karel Zak AUTHORS | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) commit 49b90d82d870b50f4e8ce4e6ef6f3c7288291b9c Author: Karel Zak Date: Tue Sep 19 14:14:46 2017 +0200 po: merge changes Signed-off-by: Karel Zak po/ca.po | 6993 +++++++++++++++++++++++++++----------------------- po/cs.po | 7268 ++++++++++++++++++++++++++++------------------------ po/da.po | 7284 ++++++++++++++++++++++++++++------------------------ po/de.po | 7230 ++++++++++++++++++++++++++++------------------------ po/es.po | 7247 ++++++++++++++++++++++++++++------------------------ po/et.po | 6971 +++++++++++++++++++++++++++----------------------- po/eu.po | 6902 ++++++++++++++++++++++++++----------------------- po/fi.po | 7026 +++++++++++++++++++++++++++----------------------- po/fr.po | 7365 ++++++++++++++++++++++++++++------------------------ po/gl.po | 6779 +++++++++++++++++++++++++----------------------- po/hr.po | 6700 +++++++++++++++++++++++++----------------------- po/hu.po | 6999 +++++++++++++++++++++++++++----------------------- po/id.po | 7023 +++++++++++++++++++++++++++----------------------- po/it.po | 7006 +++++++++++++++++++++++++++----------------------- po/ja.po | 7173 ++++++++++++++++++++++++++++----------------------- po/nl.po | 7220 +++++++++++++++++++++++++++------------------------ po/pl.po | 7147 ++++++++++++++++++++++++++++----------------------- po/pt_BR.po | 7366 +++++++++++++++++++++++++++++------------------------ po/ru.po | 7049 +++++++++++++++++++++++++++----------------------- po/sl.po | 7005 +++++++++++++++++++++++++++----------------------- po/sv.po | 7186 ++++++++++++++++++++++++++++----------------------- po/tr.po | 7177 ++++++++++++++++++++++++++++----------------------- po/uk.po | 7217 +++++++++++++++++++++++++++------------------------ po/util-linux.pot | 6560 +++++++++++++++++++++++++---------------------- po/vi.po | 7199 +++++++++++++++++++++++++++------------------------ po/zh_CN.po | 7176 ++++++++++++++++++++++++++++----------------------- po/zh_TW.po | 7210 +++++++++++++++++++++++++++------------------------ 27 files changed, 103872 insertions(+), 87606 deletions(-) commit 90f43607cfc08fec191af7bdcca4af09a370b86c Author: Rafael Fontenelle Date: Tue Sep 19 14:05:56 2017 +0200 po: update pt_BR.po (from translationproject.org) po/pt_BR.po | 1726 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 820 insertions(+), 906 deletions(-) commit 0891f0d33b3f3f419273fd294c5c5e09555103c1 Author: Stéphane Aulery Date: Tue Sep 19 14:05:56 2017 +0200 po: update fr.po (from translationproject.org) po/fr.po | 1336 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 662 insertions(+), 674 deletions(-) commit baa1e9af8af246501f40f1acaea46e2071fbb487 Author: Antonio Ceballos Roa Date: Tue Sep 19 14:05:56 2017 +0200 po: update es.po (from translationproject.org) po/es.po | 1583 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 735 insertions(+), 848 deletions(-) commit cbb9767bcca9cab8c01c394070d1ed8c9b674d3d Author: Joe Hansen Date: Tue Sep 19 14:05:55 2017 +0200 po: update da.po (from translationproject.org) po/da.po | 3700 +++++++++++++++++++++++--------------------------------------- 1 file changed, 1367 insertions(+), 2333 deletions(-) commit 667d9945141998ef7f4587edd27d069bfe383593 Author: Petr Písař Date: Tue Sep 19 14:05:55 2017 +0200 po: update cs.po (from translationproject.org) po/cs.po | 1983 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 922 insertions(+), 1061 deletions(-) commit d6ff49896f18af8670a814fed77588a8019bd025 Author: Karel Zak Date: Tue Sep 19 13:59:17 2017 +0200 tests: update build-sys tests Signed-off-by: Karel Zak tests/expected/build-sys/config-all | 8 +++++--- tests/expected/build-sys/config-all-non-nls | 8 +++++--- tests/expected/build-sys/config-audit | 8 +++++--- tests/expected/build-sys/config-chfnsh-libuser | 8 +++++--- tests/expected/build-sys/config-chfnsh-no-password | 8 +++++--- tests/expected/build-sys/config-chfnsh-pam | 8 +++++--- tests/expected/build-sys/config-core | 8 +++++--- tests/expected/build-sys/config-devel | 8 +++++--- tests/expected/build-sys/config-devel-non-docs | 8 +++++--- tests/expected/build-sys/config-non-libblkid | 6 ++++-- tests/expected/build-sys/config-non-libmount | 8 +++++--- tests/expected/build-sys/config-non-libs | 4 ++-- tests/expected/build-sys/config-non-libsmartcols | 5 ++--- tests/expected/build-sys/config-non-libuuid | 7 ++++--- tests/expected/build-sys/config-non-nls | 8 +++++--- tests/expected/build-sys/config-selinux | 8 +++++--- tests/expected/build-sys/config-slang | 8 +++++--- tests/expected/build-sys/config-static | 8 +++++--- 18 files changed, 82 insertions(+), 52 deletions(-) commit e163adb83bedb28a4eb3602ae5d6f5769d9d0327 Author: Karel Zak Date: Tue Sep 19 13:48:52 2017 +0200 build-sys: fix non-blkid compilation Signed-off-by: Karel Zak include/partx.h | 1 + libfdisk/src/wipe.c | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) commit 271552c72a91294814dcaaedccc7f51fea46bd4d Author: Karel Zak Date: Tue Sep 19 13:22:31 2017 +0200 build-sys: make rfkill optional (and enabled by default) Signed-off-by: Karel Zak configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ad442a818c6eefabb8258a9949206e12f2296161 Author: Karel Zak Date: Tue Sep 19 12:55:49 2017 +0200 build-sys: add libtinfow check It seems some systems differentiate between tinfo and tinfow. And it seems that mix ncursesw and tinfo (wide vs. non-wide char) is problem for the systems. Note that for example Fedora have ncursesw as well as ncurses, but only one tinfo library. So, we need fallback this scenario. Reported-by: Stanislav Brabec Signed-off-by: Karel Zak configure.ac | 24 +++++++++--------------- m4/ul.m4 | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 15 deletions(-) commit e9fde3e9004d1661b5229a476cf0cacfb8d0ef4f Author: Karel Zak Date: Thu Sep 7 14:19:20 2017 +0200 su: (pty) improve SIGSTOP/SIGCONT semantic We want to use waitpid() only when child is terminated or stopped to pick up child status, otherwise PTY proxy has to be active. This is difference between "su" and "su --pty". For "su" we keep parent all time in waitpid(). It would be possible to use separate code based on signalfd_siginfo, but it seems better to keep all this stuff on one place -- it means wait_for_child(). Signed-off-by: Karel Zak login-utils/su-common.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) commit 13ee2f4d78fd6866cc82b6e237f178752fe60371 Author: Karel Zak Date: Thu Sep 7 12:09:17 2017 +0200 su: (pty) save child status Signed-off-by: Karel Zak login-utils/su-common.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) commit 5328d8e7e8dbb968ba2aa83f98cf132a14266483 Author: Karel Zak Date: Thu Sep 7 11:23:50 2017 +0200 su: (pty) simplify stdin usage in poll() Not sure why I have problem with this years ago for script(1), but it seems .fd=-1 is really enough to the ignore the FD. Reported-by: Vaclav Dolezal Signed-off-by: Karel Zak login-utils/su-common.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit d88b739fbac2ca708d7077db4b59d1723830426d Author: Karel Zak Date: Thu Sep 7 11:22:11 2017 +0200 script: simplify stdin usage in poll() Signed-off-by: Karel Zak term-utils/script.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit 61b3106ba3501ddcbcc39c69df57a49aa926adae Author: Karel Zak Date: Thu Sep 7 10:45:24 2017 +0200 su: (pty) fix slave terminal attributes initialization Reported-by: Vaclav Dolezal Signed-off-by: Karel Zak login-utils/su-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0214f438a6591e9b3b09e3f02329677f1b815223 Author: Karel Zak Date: Thu Sep 7 10:31:21 2017 +0200 su: (pty) fix child signal mask usage The signal mask is used by pty_init_slave(), but it has never been uninitialized before fork(), so child gets 0 as a mask :-( Note that script(1) has no this issue because it opens signal-fd before fork(). Reported-by: Vaclav Dolezal Signed-off-by: Karel Zak login-utils/su-common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 204aa7714d33df6827ae6c69638ec6af261eff1b Author: Sami Kerola Date: Sun Aug 27 21:25:03 2017 +0100 runuser: fix linking Add conditional -lutil to runuser when needed to avoid linking error. login-utils/su-common.o: In function `pty_create': login-utils/su-common.c:269: undefined reference to `openpty' login-utils/su-common.c:273: undefined reference to `openpty' Signed-off-by: Sami Kerola login-utils/Makemodule.am | 3 +++ 1 file changed, 3 insertions(+) commit ae6e2537ffbdff9f774c9cf855b346541104b2b7 Author: Karel Zak Date: Wed Aug 23 14:16:51 2017 +0200 su: fix non-pty compilation Signed-off-by: Karel Zak login-utils/su-common.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) commit 927ded6be6bddefb57909a1c24255ac23643b6dc Author: Karel Zak Date: Wed Aug 23 13:50:04 2017 +0200 su: enable TIOCSCTTY and minor changes Signed-off-by: Karel Zak login-utils/su-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 6461eeecd7abba33bbad4b81df25ca999dbeaed2 Author: Karel Zak Date: Wed Aug 23 13:49:23 2017 +0200 su: add more informartion to man page Signed-off-by: Karel Zak login-utils/su.1 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit eb7d0ad0fed520ecf66ef39075f404e1c7e37a51 Author: Karel Zak Date: Thu Aug 17 16:09:52 2017 +0200 su: add PTY support Signed-off-by: Karel Zak login-utils/Makemodule.am | 3 + login-utils/su-common.c | 471 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 429 insertions(+), 45 deletions(-) commit 04845ec766c15c59803f5d0f983614720b57a9f2 Author: Karel Zak Date: Thu Aug 17 12:07:35 2017 +0200 su: add --pty option Signed-off-by: Karel Zak login-utils/su-common.c | 9 ++++++++- login-utils/su.1 | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) commit 305ef556d615816079d9970e1c4b28cfd2428740 Author: Karel Zak Date: Thu Aug 17 12:01:01 2017 +0200 su: move parent signals setup to separate function Signed-off-by: Karel Zak login-utils/su-common.c | 59 +++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 26 deletions(-) commit b55e712816f11626d4ae466742bbf0ff0b405310 Author: Karel Zak Date: Wed Aug 16 14:03:06 2017 +0200 su: make wait_for_child() usable in arbitrary situation For example if called more than once; to keep PTY code simple and robust. Signed-off-by: Karel Zak login-utils/su-common.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) commit 665f36bed9335adc1c30b69652957ee21d84cfbd Author: Karel Zak Date: Wed Aug 16 13:49:27 2017 +0200 su: keep old sigactions in control struct Signed-off-by: Karel Zak login-utils/su-common.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) commit f6e8b236589d110e2875920a98d0a45b5bed2626 Author: Karel Zak Date: Wed Aug 16 13:57:41 2017 +0200 su: fix refactoring bug in child PID usage Fix child pid cleanup according to commit 0076012563ff34e294a6166d605118bcdd35f7e1. Signed-off-by: Karel Zak login-utils/su-common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 44f36ad1ed64d5bb1f2cf6adbd3da3a2aaa5c3d9 Author: Karel Zak Date: Wed Aug 16 13:42:34 2017 +0200 su: add child to control struct Signed-off-by: Karel Zak login-utils/su-common.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) commit e192de658bf02a57ef3556ee74ac2aeb0c0bcaa9 Author: Karel Zak Date: Wed Aug 16 13:09:47 2017 +0200 su: fix compiler warnings [-Wimplicit-fallthrough=] Signed-off-by: Karel Zak login-utils/su-common.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit b09e7ea851839c97aca8de903c8c5b62e21d4978 Author: Karel Zak Date: Wed Aug 16 13:04:51 2017 +0200 su: add wait_for_child() Signed-off-by: Karel Zak login-utils/su-common.c | 76 +++++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 34 deletions(-) commit 8ce9c38690103fa18fc17fa209996ce747186cd4 Author: Karel Zak Date: Fri Aug 11 17:05:00 2017 +0200 su: unblock signals is all initialized This patch a little bit reorders signals initialization. The original code unblocks SIGINT SIGQUIT before signal handler is set for the signals. It means there is a small possible race. It seems better to compose wanted mask, setup handlers and then unblock all the wanted signals. Signed-off-by: Karel Zak login-utils/su-common.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) commit 5fc211d2178aad934f8d24d44dd73d060f4577e1 Author: Karel Zak Date: Fri Aug 11 16:47:01 2017 +0200 su: clean up signals usage - don't use magic numbers to index old actions - don't use if () if () - make if() conditions more readable Signed-off-by: Karel Zak login-utils/su-common.c | 63 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 20 deletions(-) commit feab56878a28fc242fe55e1aacdfc9359cf60c88 Author: Karel Zak Date: Fri Aug 11 15:18:31 2017 +0200 su: clean up const usage Signed-off-by: Karel Zak login-utils/su-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e19db0449e116e20ce15ff3c300510c30c7395c7 Author: Karel Zak Date: Fri Aug 11 15:15:16 2017 +0200 su: fix debug message Signed-off-by: Karel Zak login-utils/su-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6b28328255aa1248931947a4d1521288bde01837 Author: Karel Zak Date: Wed Feb 1 11:58:09 2017 +0100 su: properly clear child PID The patch from master branch, somehow lost during su refactoring rebase. Reported-by: Tobias Stöckmann Signed-off-by: Karel Zak login-utils/su-common.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 242708de5b7a0aa530869c757a8a38b97f06a1ba Author: Karel Zak Date: Fri Aug 11 15:07:36 2017 +0200 su: improve some debug messages Signed-off-by: Karel Zak login-utils/su-common.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 2260e493d6a4ef690c34d878c63f1cff6533b62a Author: Karel Zak Date: Wed Nov 9 14:46:00 2016 +0100 su: add debug.h stuff Signed-off-by: Karel Zak login-utils/su-common.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 2 deletions(-) commit c34865b96df98c1f39eeca10134f01287aa235a3 Author: Karel Zak Date: Wed Nov 9 14:19:22 2016 +0100 su: use switch() to split after fork Signed-off-by: Karel Zak login-utils/su-common.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) commit a4440cd1f1b818e2365b9f6c8485cb556fde40cd Author: Karel Zak Date: Wed Nov 9 14:15:31 2016 +0100 su: move PAM session initialization to separate function Signed-off-by: Karel Zak login-utils/su-common.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) commit 13de9b2194fc031507bbf6d9da50cbc141623615 Author: Karel Zak Date: Wed Nov 9 14:07:01 2016 +0100 su: rename evaluate_uid() Signed-off-by: Karel Zak login-utils/su-common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit e402d13746618bedf25ae0a18d685d4b292e874a Author: Karel Zak Date: Fri Oct 14 15:40:12 2016 +0200 su: cosmetic code changes Signed-off-by: Karel Zak login-utils/su-common.c | 78 ++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 43 deletions(-) commit 9303158534111b1451dac4ee2f2e2daf60ee2f68 Author: Karel Zak Date: Fri Oct 14 15:28:00 2016 +0200 su: cleanup setuid/gid related code Signed-off-by: Karel Zak login-utils/su-common.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) commit 13396b1046333a459c6bee2201c66f8fea42043c Author: Karel Zak Date: Fri Oct 14 15:23:44 2016 +0200 su: cleanup setenv related code Signed-off-by: Karel Zak login-utils/su-common.c | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) commit 581ddd373ae26066fb6e20406d7887f9dcca996b Author: Karel Zak Date: Fri Oct 14 15:18:37 2016 +0200 su: cleanup shell related code Signed-off-by: Karel Zak login-utils/su-common.c | 54 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) commit 94c6730bb95e22a3390acaec1d252751755feaa8 Author: Karel Zak Date: Fri Oct 14 15:06:33 2016 +0200 su: cleanup usernames usage Signed-off-by: Karel Zak login-utils/su-common.c | 81 ++++++++++++++----------------------------------- 1 file changed, 23 insertions(+), 58 deletions(-) commit 1742c8d84c8cdba817eb62fb7c9f4eb3c1923eb6 Author: Karel Zak Date: Fri Oct 14 15:02:01 2016 +0200 lib/pwdutils: add xgetlogin() Signed-off-by: Karel Zak include/pwdutils.h | 1 + lib/pwdutils.c | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) commit 032d759a104ec253e393af5e4e796a465ab0c6fc Author: Karel Zak Date: Fri Oct 14 13:41:27 2016 +0200 su: cleanup pwd struct usage Signed-off-by: Karel Zak login-utils/su-common.c | 86 +++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 46 deletions(-) commit 4f5f35fc83067b2c4874fce00ea0b53ef2488489 Author: Karel Zak Date: Fri Oct 14 13:21:17 2016 +0200 login: add xgetpwnam() Signed-off-by: Karel Zak include/Makemodule.am | 1 + include/pwdutils.h | 10 ++++++++ lib/Makemodule.am | 5 ++++ lib/pwdutils.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ login-utils/login.c | 29 ++++------------------- 5 files changed, 85 insertions(+), 24 deletions(-) commit 302b7b65e45a58fc46d983a5d12dacf6d04f26b8 Author: Karel Zak Date: Fri Oct 14 12:21:15 2016 +0200 su: consolidate tty name usage Signed-off-by: Karel Zak login-utils/su-common.c | 51 +++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 25 deletions(-) commit dc5bfb71ff693a06f08a954e4235ca30fde132b8 Author: Karel Zak Date: Fri Oct 14 12:02:53 2016 +0200 su: reorder functions Signed-off-by: Karel Zak login-utils/su-common.c | 140 ++++++++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 70 deletions(-) commit b9a92282e5ea319f3b28070ea072a58db4e8465e Author: Karel Zak Date: Thu Oct 13 14:50:22 2016 +0200 su: cleanup PAM stuff Signed-off-by: Karel Zak login-utils/su-common.c | 58 +++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) commit 42be9bda5bd8b2a9a495d250226b190ce27b7725 Author: Karel Zak Date: Thu Oct 13 14:40:54 2016 +0200 su: cleanup usage() Signed-off-by: Karel Zak login-utils/su-common.c | 123 +++++++++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 60 deletions(-) commit 832f5cd5241e14cf85ae9a40e99636a713ec4859 Author: Karel Zak Date: Thu Oct 13 14:22:52 2016 +0200 su: add control struct * setup logindefs loader by function rather than by global pointer * move basic booleans to the su_context struct Signed-off-by: Karel Zak login-utils/logindefs.c | 13 ++- login-utils/logindefs.h | 2 +- login-utils/su-common.c | 251 ++++++++++++++++++++++-------------------------- 3 files changed, 125 insertions(+), 141 deletions(-) commit b1195aa07d9f712e87cd7eda8a392e63ce7b01c2 Author: Karel Zak Date: Thu Oct 13 13:14:58 2016 +0200 su: cosmetic changes after indent Signed-off-by: Karel Zak login-utils/su-common.c | 84 ++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 50 deletions(-) commit 983652abc1de5a9fecc1a3028a0aa990b3ecb352 Author: Karel Zak Date: Thu Oct 13 13:06:35 2016 +0200 su: fix indention Yes, I know... this patch is horrible. We all hate this in git history, but the original indention from coreutils has been so crazy... Signed-off-by: Karel Zak login-utils/su-common.c | 1406 +++++++++++++++++++++++------------------------ 1 file changed, 692 insertions(+), 714 deletions(-) commit cf92105e50c6b662047e23086de70adc0a8f3f43 Author: Karel Zak Date: Mon Sep 18 11:44:57 2017 +0200 docs: add ASAN to TODO list Signed-off-by: Karel Zak Documentation/TODO | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) commit 37a6cc7a143e4b7a9f48927f1709667a37d349d1 Author: Sami Kerola Date: Sun Sep 17 19:49:02 2017 +0100 bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock uuidgen: Add hash-based UUIDs to bash-completion. These were added in commit c6f1ec68a8b38863efff2a18e30b7272db4fb273. wipefs: Command started to use libsmartcols, and it got some new options. Commit d9921b2a128f17aa9a9a110444d5faa43e1b371c. rename: New option was added in commit fabb90676af89bcb5f429793746f141c0. tunelp: The --trust-irq was removed it being years broken. Commit d52eb4bd9062081c8420b22c029c694f29d036c7. setpriv: Add --ambient-caps option from commit 0c92194eeee9c1fd58580ef852. In same go fix 'bash set -u' issue, that is the same as mentioned commit abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056. hwclock: For some reason --get has always been missing from this file. Signed-off-by: Sami Kerola bash-completion/hwclock | 1 + bash-completion/rename | 2 +- bash-completion/setpriv | 5 +++-- bash-completion/tunelp | 3 +-- bash-completion/uuidgen | 20 +++++++++++++++++++- bash-completion/wipefs | 19 ++++++++++++++++++- 6 files changed, 43 insertions(+), 7 deletions(-) commit 6627bc79e44922726eb7ef2095e69f2aae6ca719 Author: Sami Kerola Date: Sun Sep 17 19:49:00 2017 +0100 docs: remove repeated word from mount(8) man page Signed-off-by: Sami Kerola sys-utils/mount.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7928a926a05855c3f13f3d1c115f5a3a093d57ec Author: Karel Zak Date: Mon Sep 18 10:41:20 2017 +0200 libsmartcols: fix scols_line_move_cells() n+1 error [asan] Reported-by: Sami Kerola Signed-off-by: Karel Zak libsmartcols/src/line.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 774178f7271b7b2c3158afcf3cabff0745a0de2a Merge: d369dc42c ed21c47aa Author: Karel Zak Date: Fri Sep 15 14:45:36 2017 +0200 Merge branch 'patch-1' of https://github.com/aner-perez/util-linux commit d369dc42cb4974d6a928ae28ed32fa11b528e5fb Author: Karel Zak Date: Fri Sep 15 14:30:06 2017 +0200 libmount: export locking errors as MNT_EX_FILEIO The mount man page assumes locking errors mapped to MNT_EX_FILEIO (16) return code. Unfortunately, this is internally not exported as a special error code, so it's returned as a generic (errno based) stuff. This patch fixes this issue. Note that we still use locking for example for utab or when enabled /etc/mtab (disabled by default). Signed-off-by: Karel Zak libmount/src/context_mount.c | 11 ++++++++++- libmount/src/context_umount.c | 11 ++++++++++- libmount/src/libmount.h.in | 8 +++++++- libmount/src/tab_update.c | 17 ++++++++++------- 4 files changed, 37 insertions(+), 10 deletions(-) commit 1ed968c52651d457300cea92b59fe43c67e6e55a Author: Karel Zak Date: Fri Sep 15 13:43:54 2017 +0200 libsmartcols: fix heap-buffer-overflow when move columns Reported-by: Sami Kerola Signed-off-by: Karel Zak libsmartcols/src/line.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit ae1c9d60083d1e04c601a3ba3c6d19233d0643ed Author: Karel Zak Date: Fri Sep 15 13:30:45 2017 +0200 uuidparse:fix stack-buffer-overflow [asan] Reported-by: Sami Kerola Signed-off-by: Karel Zak misc-utils/uuidparse.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 3da94b1114d0a8a7e429b61c85cc8e98c1b1927e Author: Karel Zak Date: Fri Sep 15 13:30:40 2017 +0200 swaplabel: fix --disable-libuuid compilation Signed-off-by: Karel Zak disk-utils/swaplabel.c | 5 +++++ 1 file changed, 5 insertions(+) commit 9f20d800799fb1b5104cd87f9c3c68c9b159491f Author: Karel Zak Date: Fri Sep 15 13:25:32 2017 +0200 misc: cleanup UUID_STR_LEN definitions Signed-off-by: Karel Zak libblkid/src/blkidP.h | 6 ++++++ libblkid/src/partitions/partitions.h | 4 ---- libblkid/src/probe.c | 4 ---- libblkid/src/superblocks/superblocks.h | 4 ---- libfdisk/src/fdiskP.h | 1 + libfdisk/src/gpt.c | 4 ---- libuuid/src/uuid.h | 4 ++-- misc-utils/uuidparse.c | 2 -- sys-utils/swapon.c | 2 +- 9 files changed, 10 insertions(+), 21 deletions(-) commit 8b318eb25eeb85b31e6d6c6afab512075b81cd0e Author: Karel Zak Date: Fri Sep 15 12:54:54 2017 +0200 logger: make stdin parsing more friendly to static analyzers Signed-off-by: Karel Zak misc-utils/logger.c | 2 ++ 1 file changed, 2 insertions(+) commit e8f6060f27990881390c8ff4aa4c3aeae00da7b6 Author: Karel Zak Date: Fri Sep 15 12:28:44 2017 +0200 rfkill: fix coding style and error messages Signed-off-by: Karel Zak sys-utils/rfkill.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit b120966812809c816a184f21bf10c65ed837bf49 Author: Sami Kerola Date: Mon Sep 11 20:55:58 2017 +0100 rfkill: do not fsync(3) /dev/rfkill file descriptor Attempt to fsync() this device returns EINVAL, causing the rfkill always to return EXIT_FAILURE when either block or unblock is requested. Simply closing the file descriptor will fix the issue. Signed-off-by: Sami Kerola sys-utils/rfkill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4f892d77d5c960431e0b3f08e469d82ec55da0d8 Author: Sami Kerola Date: Mon Sep 11 20:55:57 2017 +0100 rfkill: allow use of multiple arguments There is no reason why multiple arguments could not be supported. Most common use case is to do multiple control commands in one go without us of 'all' argument that can cause unnecessary connection breakage. For example someone might want to add to a system initialization following commands. rfkill block bluetooth uwb wimax wwan gps fm nfc That will ensure everything but wifi is turned off with as few commands as possible, without killing wifi at any point. Signed-off-by: Sami Kerola sys-utils/rfkill.8 | 18 ++++++++------ sys-utils/rfkill.c | 73 +++++++++++++++++++++++++++++++++--------------------- 2 files changed, 56 insertions(+), 35 deletions(-) commit ed21c47aa1cb606f81aede05343b0d44d2a75ac7 Author: Aner Perez Date: Thu Sep 14 11:30:53 2017 -0400 Example for renaming foo? does not work as described Command for renaming foo? should add 2 zeros to make all the file names have 3 digits as described in the example results. misc-utils/rename.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2e7a92270114cc652ea090251a374e917adb7a72 Author: Karel Zak Date: Fri Sep 8 09:48:29 2017 +0200 script: support sig{stop/cont} * call wait() only when child exited * suspend all session (including script master process) when child get SIGSTOP and send SIGCONT to child when master process resume This allows to suspend all session and later use "fg" shell command to resume. $ ps af 14722 pts/1 Ss 0:00 bash 4870 pts/1 S+ 0:00 \_ ./script 4871 pts/6 Ss+ 0:00 \_ bash -i $ kill -SIGSTOP 4871 and script session on another terminal: $ script Script started, file is typescript $  [1]+ Stopped ./script $ fg 1 ./script ... session again usable ... ^D Script done, file is typescript Signed-off-by: Karel Zak term-utils/script.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit e12364cdfb2c8046bfe34f18af9583f1dcf934c9 Author: Karel Zak Date: Thu Sep 7 10:03:18 2017 +0200 lsblk: small man page change in return codes description Signed-off-by: Karel Zak misc-utils/lsblk.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 40191b5f95d51ace82c5fca05612b103df3259eb Author: Sami Kerola Date: Sun Sep 3 23:34:07 2017 +0100 hwclock: add -a that is short of --adjust to manual page and usage In same go use -V as return value of --version from getopts_long(). Signed-off-by: Sami Kerola sys-utils/hwclock.8.in | 2 +- sys-utils/hwclock.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 08e3c9e6620232aa5433d102d3f8ac28bbae01b0 Author: J William Piggott Date: Sun Sep 3 21:17:28 2017 -0400 hwclock: update usage() Improve usage strings for debug and version. Signed-off-by: J William Piggott include/c.h | 2 +- sys-utils/hwclock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit ec56858bbbb721801182a547d4d61f396080a04d Merge: 3184afa52 5b8e46f7e Author: Karel Zak Date: Tue Sep 5 12:24:40 2017 +0200 Merge branch '170825' of github.com:jwpi/util-linux * '170825' of github.com:jwpi/util-linux: hwclock: close hwaudit_fd unconditionally hwclock: don't always use hwclock_exit hwclock: remove sysexits.h commit 3184afa529de5efc77c4ea1f0574276a6f482f7e Author: Karel Zak Date: Tue Sep 5 12:17:26 2017 +0200 uuidgen: add more details to man page Signed-off-by: Karel Zak misc-utils/uuidgen.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit c6f1ec68a8b38863efff2a18e30b7272db4fb273 Author: Philip Prindeville Date: Mon Aug 28 13:36:30 2017 -0600 uuidgen: add support for hash-based UUIDs Signed-off-by: Philip Prindeville misc-utils/uuidgen.1 | 47 ++++++++++++++++-- misc-utils/uuidgen.c | 124 +++++++++++++++++++++++++++++++++++++++++++++-- tests/expected/uuid/oids | 4 ++ tests/ts/uuid/oids | 31 ++++++++++++ 4 files changed, 197 insertions(+), 9 deletions(-) commit b443c1779e39bb056b6045b81ba655c875b45747 Author: Philip Prindeville Date: Mon Aug 28 13:20:55 2017 -0600 misc: replace magic number 37 with UUID_STR_LEN Signed-off-by: Philip Prindeville disk-utils/mkswap.c | 2 +- libblkid/src/partitions/dos.c | 2 +- libblkid/src/partitions/partitions.c | 8 ++++---- libblkid/src/partitions/partitions.h | 4 ++++ libblkid/src/superblocks/superblocks.c | 2 +- libblkid/src/superblocks/superblocks.h | 4 ++++ libfdisk/src/gpt.c | 14 +++++++++----- libuuid/src/test_uuid.c | 2 +- libuuid/src/uuid.h | 2 ++ misc-utils/test_uuidd.c | 2 +- misc-utils/uuidd.c | 3 --- misc-utils/uuidgen.c | 2 +- sys-utils/swapon.c | 6 +++++- tests/helpers/test_uuid_namespace.c | 2 +- 14 files changed, 35 insertions(+), 20 deletions(-) commit 00476268870b01938800af9a5ca776695df13f5d Author: Philip Prindeville Date: Tue Sep 5 11:19:26 2017 +0200 libuuid: add support for hash-based UUIDs Adding V3 and V5 UUIDs per RFC-4122. [kzak@redhat.com: - fix symbols file] Signed-off-by: Philip Prindeville Signed-off-by: Karel Zak include/Makemodule.am | 1 + include/sha1.h | 46 ++++++ lib/Makemodule.am | 3 +- lib/sha1.c | 296 ++++++++++++++++++++++++++++++++++++ libuuid/src/Makemodule.am | 5 +- libuuid/src/gen_uuid.c | 56 +++++++ libuuid/src/libuuid.sym | 11 +- libuuid/src/predefined.c | 80 ++++++++++ libuuid/src/uuid.h | 15 ++ tests/commands.sh | 2 + tests/expected/sha1/sha1 | 7 + tests/expected/uuid/namespace | 7 + tests/helpers/Makemodule.am | 7 + tests/helpers/test_sha1.c | 29 ++++ tests/helpers/test_uuid_namespace.c | 37 +++++ tests/ts/sha1/data | 7 + tests/ts/sha1/sha1 | 31 ++++ tests/ts/uuid/namespace | 29 ++++ 18 files changed, 666 insertions(+), 3 deletions(-) commit 5b8e46f7e7710e2bb88ff8e763997830c9494df2 Author: J William Piggott Date: Mon Aug 28 21:19:55 2017 -0400 hwclock: close hwaudit_fd unconditionally Signed-off-by: J William Piggott sys-utils/hwclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 652dcf51314abec641b01eb610d512ca8c813256 Author: J William Piggott Date: Sun Sep 3 12:23:44 2017 -0400 hwclock: don't always use hwclock_exit Special exit handling is not wanted for usage() or bad command syntax. For example we do not want to audit: hwclock --set --date foo Signed-off-by: J William Piggott sys-utils/hwclock.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit c47a8f2a87b409ace58f9062bb3f37130f18da81 Author: J William Piggott Date: Sun Aug 27 20:26:41 2017 -0400 hwclock: remove sysexits.h sysexits.h was introduced in v2.11t prior to util-linux-ng, with the HISTORY entry: * hwclock: minor polishing. So there was no specific issue solved by adding it. Its use was never documented so it should be safe to remove. Also, fix return values being used for the exit status that were not magic constants (portability issue). Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 5 ++-- sys-utils/hwclock.8.in | 8 ++++++ sys-utils/hwclock.c | 68 +++++++++++++++++-------------------------------- 3 files changed, 33 insertions(+), 48 deletions(-) commit 58d57ae2d88ef638e3ff07c213b5158334d3f658 Author: Karel Zak Date: Fri Sep 1 10:42:51 2017 +0200 tests: update sfdisk wipe test Now command wipefs returns results in the order how superblocks has been detected on the device. Signed-off-by: Karel Zak tests/expected/sfdisk/wipe-partition | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ea05c23ab79cd9adbfe91d2b210e652c2e5097ab Author: Karel Zak Date: Thu Aug 31 20:40:37 2017 +0200 rfkill: add NFC fallback for old headers Signed-off-by: Karel Zak sys-utils/rfkill.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 0e45b256ac41257e920e1bcf61ff1a1b30ba5b98 Author: Karel Zak Date: Thu Aug 31 14:47:14 2017 +0200 wipefs: cleanup offsets list usage, fix -t filter * move list with offsets specified by -o to the wipe_control struct * don't clone the list of offsets, just keep it simple and stupid * apply all filters (-o and -t) in get_desc_for_probe() * always return offset and len by get_desc_for_probe() and apply always use libblkid hide & step-back Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1486777 Signed-off-by: Karel Zak misc-utils/wipefs.c | 209 +++++++++++++++++++++++++--------------------------- 1 file changed, 99 insertions(+), 110 deletions(-) commit 0158e68fbd97ad6db062abcb3cbf0b3bf06e39b9 Author: Karel Zak Date: Thu Aug 31 14:15:23 2017 +0200 lib/match: make match_fstype() case insensitive Signed-off-by: Karel Zak lib/match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3d47ab05497ba522b0ee96bf3a0c130c0f269d75 Author: Karel Zak Date: Thu Aug 31 11:40:51 2017 +0200 build-sys: add --disable-rfkill Signed-off-by: Karel Zak configure.ac | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 3c5022c645bc0eb9e12b672e8d11d33f9be3ec8f Author: Karel Zak Date: Thu Aug 31 11:16:07 2017 +0200 rfkill: cleanup returns Signed-off-by: Karel Zak sys-utils/rfkill.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) commit 24f9dde539777417325d6039e2f2387d792afe96 Author: Karel Zak Date: Thu Aug 31 10:37:36 2017 +0200 build-sys: remove unused rfkill.py Signed-off-by: Karel Zak sys-utils/rfkill.py | 150 ---------------------------------------------------- 1 file changed, 150 deletions(-) commit f4949fcc3b99cb38d185ab894e1bb0efc37a414d Author: Karel Zak Date: Thu Aug 31 10:36:51 2017 +0200 rfkill: add Sami to authors Signed-off-by: Karel Zak sys-utils/rfkill.8 | 5 +++++ sys-utils/rfkill.c | 1 + 2 files changed, 6 insertions(+) commit fcc3efb40e5b133a54ca8551a6d001ba43c06790 Author: Karel Zak Date: Thu Aug 31 10:31:21 2017 +0200 rfkill: cleanup usage() Signed-off-by: Karel Zak sys-utils/rfkill.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit f1f874bf489831ab6c25c58f98081cbc49c9cb97 Merge: 9001a06eb 11dc93b78 Author: Karel Zak Date: Thu Aug 31 09:56:18 2017 +0200 Merge branch 'rfkill' of git://github.com/kerolasa/lelux-utiliteetit into rfkill * 'rfkill' of git://github.com/kerolasa/lelux-utiliteetit: (57 commits) rfkill: add systemd-rfkill(8) see also segment rfkill: check id number refers to a device that exists rfkill: use back and forward compatible test rfkill: add bash-completion file rfkill: inform in syslog when rfkill is invoked rfkill: use human readable timestamps in event output rfkill: use libsmartcols output rfkill: do not ignore read error rfkill: clarify 'all devices' handling rfkill: update manual page rfkill: make programming style to match util-linux project rfkill: make command to build in util-linux project rfkill: move files to appropriate locations add python module use uapi rfkill.h version 0.5 fix compiler warning Add NFC support version 0.4 Add rfkill type "fm" to the man page. ... commit 11dc93b78ad39a7bc0a6ff50194b4e6f084c9291 Author: Sami Kerola Date: Thu Jul 6 21:57:59 2017 +0100 rfkill: add systemd-rfkill(8) see also segment Signed-off-by: Sami Kerola sys-utils/rfkill.8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit f806a238f7dea936cbc15ad91590c40ac27c2e8d Author: Sami Kerola Date: Tue Jul 4 21:43:56 2017 +0100 rfkill: check id number refers to a device that exists Earlier all commands happily accepted without detecting failure when none-existing id number was used. For example: $ rfkill block 2017; echo $? 0 The same input after this change looks following. $ rfkill block 2017; echo $? rfkill: invalid identifier: 2017 1 Signed-off-by: Sami Kerola sys-utils/rfkill.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 1bee8ec6f873cbb8b569f5c65f998594295fe86e Author: Sami Kerola Date: Sat Jul 1 09:15:12 2017 +0100 rfkill: use back and forward compatible test The rfkill_event struct might grow in future, so ensure the read sizes are at least the minimum, and allow it to be more. Reference: https://github.com/torvalds/linux/blob/master/include/uapi/linux/rfkill.h#L90-L102 Signed-off-by: Sami Kerola sys-utils/rfkill.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 9bf5e08fd359566d556dcbbb4ad1e5dcad5ac548 Author: Sami Kerola Date: Sun Jun 25 13:21:31 2017 +0100 rfkill: add bash-completion file Signed-off-by: Sami Kerola bash-completion/Makemodule.am | 3 +++ bash-completion/rfkill | 47 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) commit fd3d4ec71097451c4d1bdc673dae3dc896520fcb Author: Sami Kerola Date: Sun Jun 25 12:12:40 2017 +0100 rfkill: inform in syslog when rfkill is invoked This should help when trying to explain what or who is flicking wireles on or off. Notice that the change is not perfect - if rfkill command is setting a state that is already set the syslog entry is sent eventhough there was no effective change. Signed-off-by: Sami Kerola sys-utils/rfkill.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 7d0b3acbb4c62ec80325f179d51065d935b83392 Author: Sami Kerola Date: Sun Jun 25 11:33:57 2017 +0100 rfkill: use human readable timestamps in event output The event command appears to be something what primarily a developers will to use when debugging. Signed-off-by: Sami Kerola sys-utils/rfkill.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) commit b3849c66d372a28312dab196df9c9b01b11f107a Author: Sami Kerola Date: Sun Jun 25 09:42:06 2017 +0100 rfkill: use libsmartcols output This also makes the rfkill to output status when executed without arguments. That is believed ot be more useful than usage() output. Signed-off-by: Sami Kerola configure.ac | 1 + sys-utils/Makemodule.am | 3 +- sys-utils/rfkill.8 | 51 +++++----- sys-utils/rfkill.c | 266 ++++++++++++++++++++++++++++++++++++------------ 4 files changed, 234 insertions(+), 87 deletions(-) commit 6955a1d66c26343443a22f488b9f662aa240d010 Author: Sami Kerola Date: Sun Jun 25 01:35:28 2017 +0100 rfkill: do not ignore read error Read error should be impossible, but when one does happen user certainly wants to know about that rather than see even more strange issue caused random data in name variable. Signed-off-by: Sami Kerola sys-utils/rfkill.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit b03378e793c75e3a6a2d939328c0262b69088b03 Author: Sami Kerola Date: Sun Jun 25 01:04:41 2017 +0100 rfkill: clarify 'all devices' handling Stop using RFKILL_IS_INVALID a marker when rfkill is iterating over all devices. Addition of RFKIL_IS_ALL should make this a lot easier to digest, especially if reading code in hurry. Signed-off-by: Sami Kerola sys-utils/rfkill.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) commit a60cbb52e3b057650bab227fd3ecdde8e3e44a6d Author: Sami Kerola Date: Sun Jun 25 00:01:19 2017 +0100 rfkill: update manual page Make the manual page style to match with util-linux project. Signed-off-by: Sami Kerola sys-utils/rfkill.8 | 82 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 19 deletions(-) commit 367f40806e25390b7c1b20ad56f90d0b0bf8e56f Author: Sami Kerola Date: Sat Jun 24 20:42:58 2017 +0100 rfkill: make programming style to match util-linux project Use the usual facilities, add translation strings, move global variables at the beginning of the file, make usage() look as expected, add standard command-line option parsing. Signed-off-by: Sami Kerola configure.ac | 1 + include/pathnames.h | 4 + sys-utils/Makemodule.am | 1 + sys-utils/rfkill.c | 261 ++++++++++++++++++++++++++---------------------- 4 files changed, 148 insertions(+), 119 deletions(-) commit c0d78c90be3628a23d44da9f6cf8e29a6884fe02 Author: Sami Kerola Date: Sat Jun 24 20:19:26 2017 +0100 rfkill: make command to build in util-linux project After this commit the command merely builds, but does not confirm style used in util-linux project. Signed-off-by: Sami Kerola .gitignore | 1 + configure.ac | 3 +++ sys-utils/Makemodule.am | 6 ++++++ sys-utils/rfkill.c | 11 +++++++---- 4 files changed, 17 insertions(+), 4 deletions(-) commit e69263c03bf03f85812eb2a2fdea45d8ef4f8f94 Author: Sami Kerola Date: Sat Jun 24 20:03:38 2017 +0100 rfkill: move files to appropriate locations Also remove unnecessary items. Notice that the licence text from COPYING is moved to top of the command in comment section. Signed-off-by: Sami Kerola AUTHORS | 10 +++ rfkill/README => Documentation/rfkill.readme | 3 + rfkill/.gitignore | 5 -- rfkill/COPYING | 15 ---- rfkill/Makefile | 62 --------------- rfkill/core.h | 8 -- rfkill/rfkill.h | 109 --------------------------- rfkill/version.sh | 32 -------- {rfkill => sys-utils}/rfkill.8 | 0 {rfkill => sys-utils}/rfkill.c | 18 ++++- {rfkill => sys-utils}/rfkill.py | 0 11 files changed, 30 insertions(+), 232 deletions(-) commit d17fb726b562a69e8f174d46fa6cf794abc129cd Merge: 49a3d609e 600eb9de4 Author: Sami Kerola Date: Wed Aug 30 20:29:31 2017 +0100 rfkill: merge rfkill.8 project to util-linux Projet merge discussion in maillists: http://www.spinics.net/lists/util-linux-ng/msg14289.html http://marc.info/?l=linux-wireless&m=149880885914076&w=2 Old-Remote: http://git.sipsolutions.net/rfkill.git/ Old-Remote: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/rfkill.git Signed-off-by: Sami Kerola commit 9001a06ebe59b138660e7ada111c4eb9f09fb1e8 Author: Karel Zak Date: Wed Aug 30 12:01:21 2017 +0200 docs: remove TODO item for fdisk We use libsmartcols so basic escape for terminal should be already done by the library. Signed-off-by: Karel Zak Documentation/TODO | 3 --- 1 file changed, 3 deletions(-) commit 49a3d609ed9a4071761bc228ff3f76dc69f954b0 Author: Karel Zak Date: Wed Aug 30 11:30:41 2017 +0200 build-sys: define dependence between chsh and getusershell configure.ac | 2 ++ 1 file changed, 2 insertions(+) commit a1f5bb9d1fe87122270369b888b413260b02cfa9 Author: Sami Kerola Date: Mon Aug 28 21:38:13 2017 +0100 chsh: remove local /etc/shells parsing in favour of getusershell(3) Less code, less bugs. And if there are bugs at least share them with all other programs that use getusershell(3) from libc. Signed-off-by: Sami Kerola login-utils/chsh.c | 98 ++++++++++-------------------------------------------- 1 file changed, 18 insertions(+), 80 deletions(-) commit 75c5f4a516079cf0ddc1896f80c2d56e211f1f50 Author: Sami Kerola Date: Sat Aug 26 13:45:13 2017 +0100 bash-completion: simplify pid listing Changing directory in subshell does not effect parent process, so this is better and possibly quicker way to list pids. Signed-off-by: Sami Kerola bash-completion/nsenter | 2 +- bash-completion/prlimit | 2 +- bash-completion/renice | 2 +- bash-completion/taskset | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) commit 473ec35974185ad8ab74b6de63fa08f74fdda22e Author: Sami Kerola Date: Sat Aug 26 13:38:07 2017 +0100 hwclock: remove bool type definition Use plain int instead of type defining it to a boolean, and use numbers to signify true or false as we do everywhere else in this source tree. And in hwclock-cmos.c file booleans weren't even needed, to the related code is removed. Signed-off-by: Sami Kerola sys-utils/hwclock-cmos.c | 14 +++++--------- sys-utils/hwclock.c | 35 +++++++++++++++++++---------------- sys-utils/hwclock.h | 2 -- 3 files changed, 24 insertions(+), 27 deletions(-) commit 6c183c283bb7d5aadfa98c8fb218e4a9bb424e45 Author: Vaclav Dolezal Date: Tue Aug 29 14:31:06 2017 +0200 fdisk: use strutils to trim whitespace from input Signed-off-by: Vaclav Dolezal disk-utils/fdisk.c | 7 +------ include/strutils.h | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) commit 1d775aa260bdc20c2e8e618691eabb193d496e05 Author: Vaclav Dolezal Date: Mon Aug 28 13:20:34 2017 +0200 fdisk: fix copy from readline and whitespace stripping Bug fixed: --- 678: fdisk: ASK: asking for number ['Partition number', <1,4>, default=1, range: 1-4] 678: fdisk: ASK: asking for user replay [interactive] Partition number (1-4, default 1): 12345 678: fdisk: ASK: user's reply: >>>12345<<< Value out of range. 678: fdisk: ASK: asking for user replay [interactive] Partition number (1-4, default 1): 1 678: fdisk: ASK: user's reply: >>>12345<<< Value out of range. 678: fdisk: ASK: asking for user replay [interactive] Partition number (1-4, default 1): 678: fdisk: ASK: user's reply: >>>22345<<< Value out of range. --- Signed-off-by: Vaclav Dolezal disk-utils/fdisk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 306367042565c8ff9caeacfc79b6bf35d7ecd55d Author: Vaclav Dolezal Date: Mon Aug 28 12:31:10 2017 +0200 fdisk: minor fixes to make readline work Signed-off-by: Vaclav Dolezal disk-utils/fdisk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit e406be01b450dd7ed5e694bc15a39719d6f86967 Author: J William Piggott Date: Sun Aug 13 13:38:18 2017 -0400 hwclock: for debugging print startup system time Signed-off-by: J William Piggott sys-utils/hwclock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit e5cb8d4dfeee214d8e2e585c6fb625863e0ecd6e Author: J William Piggott Date: Sun Aug 13 13:11:25 2017 -0400 hwclock: refactor set_system_clock() Signed-off-by: J William Piggott sys-utils/hwclock.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) commit c8f64f94f375e3ef7e95da4818b0a975bda56b0f Author: J William Piggott Date: Sat Aug 12 20:13:22 2017 -0400 hwclock: update set_system_clock comments Signed-off-by: J William Piggott sys-utils/hwclock.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) commit b44dd522b4ca603f68f90577755bbd5538c0542f Author: J William Piggott Date: Tue Aug 8 20:50:55 2017 -0400 hwclock: update set_system_clock debugging Update debug messages for a combined --systz and --hctosys in the set_system_clock function. New debug messages: hwclock --test -D --systz --localtime Calling settimeofday(NULL, 240) to warp System time. Test mode: clock was not changed hwclock --test -D --systz --utc Calling settimeofday(NULL, 0) to lock the warp function. Calling settimeofday(NULL, 240) to set the kernel timezone. Test mode: clock was not changed hwclock --test -D --hctosys --utc Calling settimeofday(1502239269.733639, 240) Test mode: clock was not changed hwclock --test -D --hctosys --localtime Calling settimeofday(NULL, 240) to set persistent_clock_is_local. Calling settimeofday(1502253708.200200, 240) Test mode: clock was not changed Signed-off-by: J William Piggott sys-utils/hwclock.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) commit 3a7669aa8ab5c07044aea66c8e2d9e4a1f5ab1cc Author: J William Piggott Date: Sun Aug 6 12:17:10 2017 -0400 hwclock: remove set_system_clock_timezone() Remove set_system_clock_timezone() because the previous patch moved its functionality into set_system_clock(). Signed-off-by: J William Piggott sys-utils/hwclock.c | 89 ----------------------------------------------------- 1 file changed, 89 deletions(-) commit 404fdd2ca44af56e7074ea9324aea550087a1df6 Author: J William Piggott Date: Sun Aug 6 11:39:33 2017 -0400 hwclock: move systz into hctosys The set_system_clock_timezone() function is nearly identical to set_system_clock(). Three additional statements are required to include systz in hctosys. This patch is intentionally incomplete to make reviewing the actual required changes easier. Other patches in this set will: * remove set_system_clock_timezone() * fix messages and debugging * fix comments * and finally refactor set_system_clock() Signed-off-by: J William Piggott sys-utils/hwclock.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit ebfab541cf1266bf80b2b62977cf29ff69c61fe1 Author: Karel Zak Date: Thu Aug 24 19:59:20 2017 +0200 fdisk: add missing include Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 1 + 1 file changed, 1 insertion(+) commit c1154128db5f2359d7825d048134ac262af10b6b Author: Karel Zak Date: Thu Aug 24 15:37:16 2017 +0200 fdisk: fix readline interaction with signals The high-level readline API is crazy to use with signals. Fortunately the library provides low-level rl_callback_* API. In this case we can use poll() to wait for input and control all signals, etc. This patch also a little changes fdisk behavior on CTRL+C and CTRL+D. The signals does not kill fdisk, but forces fdisk to return to the main menu, if already in the main menu then exit. If the disk layout has been modified than ask "Do you really want to exit...". Signed-off-by: Karel Zak Documentation/TODO | 9 -- disk-utils/fdisk-menu.c | 19 +++- disk-utils/fdisk.c | 142 ++++++++++++++++++------------ disk-utils/fdisk.h | 4 +- tests/expected/sfdisk/gpt-attrs | 2 +- tests/expected/sfdisk/gpt-attrs-guid | 2 +- tests/expected/sfdisk/gpt-attrs-space | 2 +- tests/expected/sfdisk/gpt-attrs-with-typo | 2 +- 8 files changed, 106 insertions(+), 76 deletions(-) commit 6c8c429d4997e4d197f95e9aeb42d863c7bd32dd Author: Vaclav Dolezal Date: Tue Aug 15 15:25:32 2017 +0200 fdisk: handle SIGINT in dialogs as cancel [kzak@redhat.com: - use sig_atomic_t] Signed-off-by: Vaclav Dolezal Signed-off-by: Karel Zak disk-utils/fdisk.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) commit 55cf3716098e1c5977940b0508a740a2d133aede Author: Vaclav Dolezal Date: Tue Aug 15 13:08:49 2017 +0200 fdisk: add wrap_fgets() for getting user input make function wrapping rl_fgets() and fputs()&fgets() to remove code duplication in get_user_reply(). Signed-off-by: Vaclav Dolezal disk-utils/fdisk.c | 57 +++++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) commit 504c594777a8e83db48322662f9162aa48a7924b Author: Vaclav Dolezal Date: Tue Aug 15 10:02:45 2017 +0200 libfdisk: fix fdisk_reset_partition() leaking *_chs strings. Signed-off-by: Vaclav Dolezal libfdisk/src/partition.c | 2 ++ 1 file changed, 2 insertions(+) commit 5cebb2ab33e4b5a802e8d711b9001c9d717ec9c3 Author: Vaclav Dolezal Date: Mon Aug 14 12:57:52 2017 +0200 libfdisk: fix two potential memory errors. Fixes one leak and one unchecked allocation error. [kzak@redhat.com: - don't call fdisk_ask_menu_get_result() after failed fdisk_do_ask()] Signed-off-by: Vaclav Dolezal Signed-off-by: Karel Zak libfdisk/src/dos.c | 5 +++-- libfdisk/src/gpt.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) commit b428eb14a8f92afbad388aecf91779a486ba208e Author: Karel Zak Date: Tue Aug 22 15:12:36 2017 +0200 libfdisk: improve alignment debug mesagges Signed-off-by: Karel Zak libfdisk/src/alignment.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 27c284b8482e121d3659d1d6abb640c5ac035e3e Author: Karel Zak Date: Tue Aug 22 14:59:42 2017 +0200 libfdisk: add --grain to mkpart sample Signed-off-by: Karel Zak libfdisk/samples/mkpart.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit adf09b5c380fe616fa28b1975703b83e75d0b32b Author: Karel Zak Date: Tue Aug 22 14:55:51 2017 +0200 libfdisk: add fdisk_save_user_grain() Let's provide API for applications that don't want to use the default 1MiB grain. The new function allow to use "as minimal as possible" if grain is set by fdisk_save_user_grain() to 512. If the phy sector size (or minimal I/O size) is greater than specified grain size than smallest possible setting is used. Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/alignment.c | 41 ++++++++++++++++++++++++++++++++++++- libfdisk/src/fdiskP.h | 1 + libfdisk/src/libfdisk.h.in | 3 +++ libfdisk/src/libfdisk.sym | 1 + 5 files changed, 46 insertions(+), 1 deletion(-) commit 980cc4a18219972ad126beb391f6f25a07730aaa Author: Karel Zak Date: Tue Aug 22 14:54:27 2017 +0200 libfdisk: (dos) use size-=1 when alignment not used later Signed-off-by: Karel Zak libfdisk/src/dos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 1573e9551448050de2e42b254909f3c7554c25fd Author: Karel Zak Date: Tue Aug 22 14:53:18 2017 +0200 libfdisk: improve "add partition" debug message Signed-off-by: Karel Zak libfdisk/src/partition.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 694a407de9ff9ce92f8a620d7161734d207a9f00 Author: Karel Zak Date: Tue Aug 22 14:48:14 2017 +0200 libfdisk: (gpt) fix size-1 error If partition does not require alignment, then don't call LBA align function and don't use size-=1 (fdisk_align_lba_in_range() returns unmodified size and we call size=-1 more than once for the same size). Signed-off-by: Karel Zak libfdisk/src/gpt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 3f30dedd56a68ee625bcd82c13f4745d03cbbeb9 Author: Karel Zak Date: Tue Aug 22 11:22:26 2017 +0200 docs: add CAP_SYS_ADMIN to TODO Signed-off-by: Karel Zak Documentation/TODO | 9 +++++++++ 1 file changed, 9 insertions(+) commit c64376b0516faf38b0e1a84d128cfc95452338d1 Merge: 1da83869c c74833538 Author: Karel Zak Date: Mon Aug 21 11:33:17 2017 +0200 Merge branch 'master' of https://github.com/pali/util-linux * 'master' of https://github.com/pali/util-linux: libblkid: udf: Define magic constants commit 1da83869cf9e0476d760580df63eef441caf31e8 Author: Karel Zak Date: Mon Aug 21 11:16:51 2017 +0200 isosize: usage() and coding style cleanup Signed-off-by: Karel Zak disk-utils/isosize.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) commit c38018028946a45e131e91af68cd8090f74a8c1f Author: Karel Zak Date: Mon Aug 21 11:11:11 2017 +0200 isosize: iterate over all arguments even when something fails Earlier the command exit too early if one of the arguments failed. After this change all arguments are examined, and command return value will have information what happen during processing. Based on patch from Sami Kerola Signed-off-by: Karel Zak disk-utils/isosize.8 | 17 +++++++++++++++++ disk-utils/isosize.c | 41 ++++++++++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 13 deletions(-) commit a653878c45cd533abbd4950b2fb5ea8c6cef6395 Author: Sami Kerola Date: Sat Aug 12 09:31:11 2017 +0100 look: use WORDLIST environment variable to find word list The WORDLIST is the same hunspell(1) and ispell(1) uses to achieve the same. Apparently aspell(1) does not work with files like traditional dict lists. Reference: https://github.com/hunspell/hunspell/blob/master/man/hunspell.1#L388 Reference: http://www.skrenta.com/rt/man/ispell.1.html Reference: http://aspell.net/man-html/Creating-an-Individual-Word-List.html#Creating-an-Individual-Word-List Signed-off-by: Sami Kerola misc-utils/look.1 | 5 +++++ misc-utils/look.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) commit c748335382a110376a0207c6457b15fc7a6e0b0c Author: Pali Rohár Date: Sun Aug 20 14:50:02 2017 +0200 libblkid: udf: Define magic constants libblkid/src/superblocks/udf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit 6047c6db9c261c8048c54279ba1206ad0ca5d61e Author: Karel Zak Date: Fri Aug 18 10:29:54 2017 +0200 lslogins: be more explicit with -g in man page Signed-off-by: Karel Zak login-utils/lslogins.1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit f4513f27c2e2c8919bffcd7a356e364b0647eb29 Author: Karel Zak Date: Fri Aug 18 10:23:38 2017 +0200 lslogins: ignore non-existing users Signed-off-by: Karel Zak login-utils/lslogins.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit e282116f6d5ffa99ed2996f44aa262faa4fe8a1c Author: Ruediger Meier Date: Wed Aug 16 14:50:57 2017 +0200 misc: fix some printf format strings Noticed on xcode/OSX. Signed-off-by: Ruediger Meier lib/randutils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit fcd90d9ac70c34c21386e6c08a38afdbabb6d00e Author: Karel Zak Date: Wed Aug 16 14:15:56 2017 +0200 dmesg: fix delimiter calculation Reported-by: Laszlo Varkonyi Signed-off-by: Karel Zak sys-utils/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit feeeaca9677414ee7627750559e6b5273142ccb5 Author: Karel Zak Date: Wed Aug 16 11:55:57 2017 +0200 libblkid: fix compiler warning [-Wformat-truncation=] The MBR partition pseudo-UUID is generated from table ID and partition partno. The final UUID size limit is 37 bytes. The table ID has to be restricted to keep compiler happy (for MBR the table ID is 8 bytes as string). Signed-off-by: Karel Zak libblkid/src/partitions/partitions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6b1e439a0e0019431fd03c417bd8d8a8ffbb4baf Author: Karel Zak Date: Tue Aug 15 14:03:43 2017 +0200 cfdisk: add missing 0x7F key mapping Addresses: https://github.com/karelzak/util-linux/issues/499 Signed-off-by: Karel Zak disk-utils/cfdisk.c | 1 + 1 file changed, 1 insertion(+) commit 77d03707d943820245b5f1fa5850b6dec13552b6 Author: Karel Zak Date: Mon Aug 14 12:25:07 2017 +0200 docs: add --enable-programs to TODO Signed-off-by: Karel Zak Documentation/TODO | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 9612a41085483308e15ce5132289648aa093c244 Author: Karel Zak Date: Mon Aug 14 12:09:50 2017 +0200 docs: add UUID v3 an v5 to TODO Addresses: https://github.com/karelzak/util-linux/issues/495 Signed-off-by: Karel Zak Documentation/TODO | 7 +++++++ 1 file changed, 7 insertions(+) commit 80701a7acebed7c4ed36b0c9a7396ecdcc142f40 Author: Karel Zak Date: Mon Aug 14 11:30:37 2017 +0200 blockdev: document --setro more properly Addresses: https://github.com/karelzak/util-linux/issues/498 Signed-off-by: Karel Zak disk-utils/blockdev.8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 51013d3efadc47efed76bb2cdf6aa1444dacdb95 Author: Karel Zak Date: Mon Aug 14 10:56:08 2017 +0200 lib/randutils: reset lose counter It's probaly good idea to reset lose counter when we fallback from getrandom() to /dev/urandom. Signed-off-by: Karel Zak lib/randutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5264aebb4f822fa9147ee576562a4961ca97261d Author: Karel Zak Date: Mon Aug 14 10:33:06 2017 +0200 lib/randutils: improve getrandom() usage The getrandom() does not have to return all requested bytes (missing entropy or when interrupted by signal). The current implementation in util-linux stupidly asks for all random data again, rather than only for missing bytes. The current code also does not care if we repeat our requests for ever; that's bad. This patch uses the same way as we already use for reading from /dev/urandom. It means: * repeat getrandom() for only missing bytes * limit number of unsuccessful request (16 times) * fallback to /dev/urandom on ENOSYS (old kernel or so...) Addresses: https://github.com/karelzak/util-linux/issues/496 Signed-off-by: Karel Zak lib/randutils.c | 64 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 18 deletions(-) commit 60eedb0a53f14aa1169713a72325421db8e1c647 Author: Karel Zak Date: Thu Aug 10 12:37:34 2017 +0200 losetup: add info about lazy detach to manpage Signed-off-by: Karel Zak sys-utils/losetup.8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 959b9250d845276f686545f186401f156107bd52 Merge: 6a2c5b572 cc7d1fd16 Author: Karel Zak Date: Thu Aug 10 10:26:21 2017 +0200 Merge branch 'master' of https://github.com/RAOF/util-linux * 'master' of https://github.com/RAOF/util-linux: lib/randutils.c: More paranoia in getrandom() call. lib/randutils.c: Fall back gracefully when kernel doesn't support getrandom(2). commit cc7d1fd16d14acf08a20fbe3a6426d2cb4878768 Author: Christopher James Halse Rogers Date: Mon Aug 7 16:10:51 2017 +1000 lib/randutils.c: More paranoia in getrandom() call. If getrandom() is called with nbytes ≥ 256 then it can return with less than the requested bytes filled. In this case we *could* adjust the buffer by the number of bytes actually read, but it's simpler to just redo the call. lib/randutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a7df0f5f3537d062dcf2f7d85cf2f919bf384b16 Author: Christopher James Halse Rogers Date: Mon Aug 7 16:07:54 2017 +1000 lib/randutils.c: Fall back gracefully when kernel doesn't support getrandom(2). The 3.16 kernel is supported until 2020, and various distros have kernels of the same vintage. It's entirely possible for code built against newer headers to be run against these kernels, so fall-back to the old “read /dev/{u,}random” method if the kernel doesn' support getrandom() lib/randutils.c | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) commit 6a2c5b572c8a16e4205ac06dbfc649684872640c Merge: baf3281e6 1266fcf9c Author: Karel Zak Date: Mon Aug 7 10:00:34 2017 +0200 Merge branch 'blkid-ubi' commit baf3281e6c4a91d0830f6c846cb47a849dba5738 Merge: 7e6f02944 88d2a1a31 Author: Karel Zak Date: Mon Aug 7 09:52:23 2017 +0200 Merge branch '170724' of github.com:jwpi/util-linux * '170724' of github.com:jwpi/util-linux: hwclock: fix hclock_valid test and error messages hwclock: remove busywait tristate return status hwclock: restore select() timeout warning hwclock: update man page hwclock: correlate hclocktime instead of set_time. hwclock: fix RTC read logic hwclock: move drift correction and --predict hwclock: move rtc permissions test hwclock: move systz above init clocks read commit 7e6f029448ed43212154e759df8dc12ee1fbecd1 Author: Karel Zak Date: Mon Aug 7 09:48:51 2017 +0200 agetty: keep returns in main() Don't use list_speeds() as non-return function, it seems better to keep main() code consistent. Signed-off-by: Karel Zak term-utils/agetty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 82214f45e93c1987796621b389555df7920c4fc0 Author: Sami Kerola Date: Sun Jul 30 14:59:24 2017 +0100 agetty: fix invalid usage crash $ agetty agetty: not enough arguments: Success Segmentation fault (core dumped) Reference: 9325dbfd2018b2a3b510617f4aa13777fbbe23c3 Signed-off-by: Sami Kerola term-utils/agetty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 63d94613a887c9a5f741d87bff4c7979293c4baf Author: Sami Kerola Date: Sat Aug 5 16:46:55 2017 +0100 agetty: add compile time features to --version output This command has a lot of compile time #ifdef code. It is time to add feature listing to --version output so understanding command behavior is easier. Proposed-by: Karel Zak Signed-off-by: Sami Kerola term-utils/agetty.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) commit 11841430c9b94d4f0246005a826a1c17a5af972d Author: Sami Kerola Date: Sun Jul 30 14:45:59 2017 +0100 agetty: add --list-speeds option Proposed-by: Karel Zak Signed-off-by: Sami Kerola term-utils/agetty.8 | 3 +++ term-utils/agetty.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) commit 43a1709e3b8f206799fbd1932a61268ac0042ecc Author: Sami Kerola Date: Sun Jul 30 13:44:05 2017 +0100 agetty: remove dead DO_DEVFS_FIDDLING code segment There is no ./configure option to enable this, and it is unlikely any distribution hot patching to enable fiddling when building package. Signed-off-by: Sami Kerola term-utils/agetty.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) commit 09ad914e72338da11b1b6a838f8dc9c210f98152 Author: Sami Kerola Date: Sat Jul 29 22:27:46 2017 +0100 bash-completion: look for look completions The look(1) uses positional arguments, where first one is a word from dictionary. It is reasonable to assume most of the time people search from system word lists so propose completions from there. The second argument is a dictionary file, that might invalidate the first input but that only happens to users who have an idea what the want without bash-completion. Signed-off-by: Sami Kerola bash-completion/look | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 30124e172a8beef96bde3b6c0844d9aaea801ee8 Author: Sami Kerola Date: Sun Jul 30 12:33:12 2017 +0100 libuuid: use access(2) when checking /dev/random availability The access(2) is more lightwight than stat(2), and tells whether random device(s) can be read or not, unlike the earlier stat() call. Signed-off-by: Sami Kerola libuuid/src/gen_uuid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 8cfbd350482cffbfbfbf1edee26226fe00bbc7d7 Author: Sami Kerola Date: Sat Jul 29 22:14:34 2017 +0100 uuidparse: nil uuid have all bits set to zero The nil UUID is special form of UUID that is specified to have all 128 bits set to zero. Reference: https://tools.ietf.org/html/rfc4122#section-4.1.7 Signed-off-by: Sami Kerola misc-utils/uuidparse.c | 5 ++++- tests/expected/uuid/uuidparse | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) commit 46df3aaae801b8d2b52b99356cd737e6e11a4e3c Author: Sami Kerola Date: Sat Jul 29 17:19:47 2017 +0100 vipw: use explicit_bzero() to clear buffer after copy This should make leaking end of /etc/shadow file more unlikely. Notice that there is now way to tell to editors they should ensure none it does not leak any buffers, drop cores, and so on, when editing sensitive data. In short this change is addressing the issue only partially. Signed-off-by: Sami Kerola login-utils/vipw.c | 3 +++ 1 file changed, 3 insertions(+) commit 67663979328054eb9ce4f38166ee34b0dd31db7c Author: Sami Kerola Date: Sun Jul 30 11:32:37 2017 +0100 include: move pamfail.h to auth.c This removes one small header file, and makes inline function to static to only file it is used in. Signed-off-by: Sami Kerola include/Makemodule.am | 1 - include/pamfail.h | 26 -------------------------- login-utils/auth.c | 19 ++++++++++++++++++- 3 files changed, 18 insertions(+), 28 deletions(-) commit 88d2a1a312445ba1cb540b960e2a9578b170e820 Author: J William Piggott Date: Wed Aug 2 16:06:54 2017 -0400 hwclock: fix hclock_valid test and error messages Every hwclock operation that requires reading the RTC, tests hclock_valid and prints a different warning. This redundancy is unnecessary. Move the warning to the RTC read block (the test was moved in a previous patch in this set). This reduces function arguments and is a significant code clean up. It will also benefit the translators. Signed-off-by: J William Piggott sys-utils/hwclock.c | 147 +++++++++++++++++++--------------------------------- 1 file changed, 53 insertions(+), 94 deletions(-) commit 4a6f658cb2a881832a4f38385452c427605057b9 Author: J William Piggott Date: Mon Jul 31 11:57:01 2017 -0400 hwclock: remove busywait tristate return status The select() synchronization branch only returns success or fail. There is no reason for the busywait branch to do more. If synchronization fails for any reason then it must exit, otherwise all drift correction operation will be invalid. Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 11 +++++------ sys-utils/hwclock.h | 6 ------ 2 files changed, 5 insertions(+), 12 deletions(-) commit bbf12e45f8b60a22e081993b4d3612d0e7f1805e Author: J William Piggott Date: Mon Jul 31 09:20:58 2017 -0400 hwclock: restore select() timeout warning hwclock now exits on select(2) timeout so restore the warning. Reverts commit ab8f402952301106ad0bd5c5a51dc8646d1bff64 and commit efc4eaf4229f78f14430d8739ddef2c5101f05cc Except use warnx(), because select() timeout does not set errno. Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit fefc39f965431f7e4dd11715ce8d9176d618152a Author: J William Piggott Date: Sun Jul 30 21:28:36 2017 -0400 hwclock: update man page Add information about setting the Hardware Clock if it has been corrupted. Add information about --update-drift and reduced system shutdown times for --systohc. Signed-off-by: J William Piggott sys-utils/hwclock.8.in | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) commit 1ef6feb533ec7f45e6264189ad7ed93f616564ea Author: J William Piggott Date: Sun Jul 30 16:22:49 2017 -0400 hwclock: correlate hclocktime instead of set_time. Correlate hclocktime with set_time instead of the other way around, because set_time is used for timestamps in the adjtime file so it needs to be unadulterated. Also create var startup_hclocktime for correlated time. Signed-off-by: J William Piggott sys-utils/hwclock.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) commit ee723d23524d8e170aae030bb7579b4fae5599df Author: J William Piggott Date: Sat Jul 29 20:33:41 2017 -0400 hwclock: fix RTC read logic Over the past decade a few commits for a corner case problem have left the RTC read branch in a bad place. The problem was: when a corrupted RTC could not be read, then it also could not be reset, because hwclock would error out due to the RTC read failure. 2.15-rc1 commit 3b96a7a Aug 9 2008 2.19-rc1 commit 5606df5 Dec 29 2010 2.23-rc1 commit ab8f402 Mar 21 2013 The first fix was to ignore a synchronization timeout only for the busywait branch. Two and a half years later a commit describing the same problem took a little more heavy-handed approach by ignoring all synchronization failures and the RTC read after it, for both of the RTC set functions. Because the previous fix also ignored the select() branch timeout it caused a bogus warning. The chosen workaround for that was to only print the select() timeout message in debug mode (this is reverted by another patch). The problem with these fixes is that we cannot just ignore the synchronization timeout like that, because then the drift correction operations will be invalid. The original logic was correct; we must exit when synchronization fails. Another problem is that now there are statements between the timing-critical synchronize-read-timestamp trio (which were also in the wrong order, but that part of the problem goes back further in history). The solution is to skip the RTC read block completely for the RTC set functions when not also using the --update-drift option. If we are updating the drift correction factor during a set function then we must synchronize and read the RTC. Otherwise reading the RTC is not needed. Anyone trying to set a corrupt RTC should not be using --update-drift, because the resulting drift correction factor would be invalid. Using this approach has the added benefit of significantly reducing system shutdown time when not using --update-drift: time ./hwclock --test --systohc; time ./hwclock-master --test --systohc Test mode: clock was not changed real 0m0.072s user 0m0.066s sys 0m0.003s Test mode: clock was not changed real 0m1.000s user 0m0.169s sys 0m0.005s I've see differences as high as 1.518 seconds. Signed-off-by: J William Piggott sys-utils/hwclock.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) commit a218e2a83fb6c64103b0b33e233db019bede44e2 Author: J William Piggott Date: Sat Jul 29 09:21:19 2017 -0400 hwclock: move drift correction and --predict Move the predict branch above the RTC read branch. Move drift correction into the RTC read branch, because it requires an accurate RTC read, and it needs to be skipped for operations that do not require an RTC read. Simplify the RTC read branch test. Signed-off-by: J William Piggott sys-utils/hwclock.c | 57 +++++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 26 deletions(-) commit 551e703401f62553337b47056e144ce88d8179ed Author: J William Piggott Date: Fri Jul 28 20:51:31 2017 -0400 hwclock: move rtc permissions test Move the rtc permissions test below the systz call and simplify it's 'if' test. Signed-off-by: J William Piggott sys-utils/hwclock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 4ba19a2f79dc04d780b6450fbce66d07430ceb37 Author: J William Piggott Date: Fri Jul 28 20:48:01 2017 -0400 hwclock: move systz above init clocks read The systz option is all about speed, so move it to the top and simplify the init clocks read test. Signed-off-by: J William Piggott sys-utils/hwclock.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 1266fcf9cf7597c7dfd21a185bce60133d5883c7 Author: Karel Zak Date: Thu Aug 3 15:09:06 2017 +0200 libblkid: mark UBI as RAID UBI is volume manager rather than filesystem. Note that libblkid has optimized RAIDs probing (don't search for another filesystems is RAID detected). We also don't search for RAIDs on very small devices, but this optimization is ignored for UBI char devices (size=1byte). Signed-off-by: Karel Zak libblkid/src/superblocks/superblocks.c | 2 +- libblkid/src/superblocks/ubi.c | 2 +- tests/expected/blkid/low-probe-ubi | 2 +- tests/ts/blkid/images-fs/ubi.img.xz | Bin 136 -> 380 bytes 4 files changed, 3 insertions(+), 3 deletions(-) commit a6b1ec864a3eb1d27a8781fe99d65e4e6ac05e5b Author: Rafał Miłecki Date: Wed Aug 2 14:14:18 2017 +0200 libblkid: add support for UBI superblock UBI is a volume management system that can be used on a raw flash partition for providing multiple logical volumes. Detecting UBI superblock may be useful for tools wanting to simplify or automate attaching UBI. Please note it's not directly related to the ubifs support which is just a filesystem working on top of UBI volume. In other words: UBI can be used on MTD partition (e.g. /dev/mtdblock0) while ubifs can be used on UBI volume (e.g. /dev/ubi0_0). This patch adds simple code reading UBI version and unique number and setting it in the blkid_probe. Signed-off-by: Rafał Miłecki libblkid/src/Makemodule.am | 1 + libblkid/src/superblocks/superblocks.c | 1 + libblkid/src/superblocks/superblocks.h | 1 + libblkid/src/superblocks/ubi.c | 51 +++++++++++++++++++++++++++++++++ tests/expected/blkid/low-probe-ubi | 5 ++++ tests/ts/blkid/images-fs/ubi.img.xz | Bin 0 -> 136 bytes 6 files changed, 59 insertions(+) commit 87c26ce5b689abe1b52181f98ef3c9eb1b1a5165 Author: Karel Zak Date: Tue Aug 1 14:36:25 2017 +0200 build-sys: support ncursesw without headers in ncursesw/ directory Let's check always for alone ncurses.h and term.h if the preferred variant with ncursesw/ subdirectory is not available. The patch also minimize number of HAVE_...NCURSES_H macros in config.h. We don't need to check for ncurses.h if ncurses/ncurses.h is available. Reported-by: Carlos Santos Signed-off-by: Karel Zak configure.ac | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) commit dd3b72b3e9f8188addc14fe574cd67ecdff43a51 Author: Karel Zak Date: Tue Aug 1 13:51:27 2017 +0200 libfdisk: add --nopartno to mkpart sample * disable dialogs for the mkpart sample * add --nopartno use-case to force libfdisk to use default partno(s) * add test for this feature Signed-off-by: Karel Zak libfdisk/samples/mkpart.c | 20 ++++++++++++++------ tests/expected/libfdisk/mkpart-mbr-nopartno | 26 ++++++++++++++++++++++++++ tests/ts/libfdisk/mkpart | 9 +++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) commit 55b3fe7824c261b6b3d2a8869a8cb509fdd2569f Author: Patrick Steinhardt Date: Thu Jul 20 08:30:04 2017 +0200 setpriv: document accepted formats for naming caps Since commit fbd15c4d4 (setpriv: support setting unnamed capabilities, 2017-07-17), it is possible to name capabilities not only by name, but also by their index. While using the human-readable name is usually recommended, using the index may be required in case new capabilities have been introduced to the kernel for which we have no name yet. The newly introduce format format is not documented inside of setpriv(1), though, which is being fixed in this commit. Signed-off-by: Patrick Steinhardt sys-utils/setpriv.1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit b3e8105837505fc9b4637b4e41cca39eecb48ebf Author: J William Piggott Date: Mon Jul 24 14:59:07 2017 -0400 hwclock: remove custom errno string Custom errno messages are unnecessary and problematic for translators. hwclock --directisa hwclock: iopl() port access failed: Operation not permitted hwclock: root privileges may be required The custom errno message is misleading. We do not know what the system permissions are set to. The default errno string is correct, and enough. Patched: hwclock --directisa hwclock: iopl() port access failed: Operation not permitted root@:~# hwclock --directisa -D Using direct ISA access to the clock 2017-07-24 14:49:17.782716-0400 Signed-off-by: J William Piggott sys-utils/hwclock-cmos.c | 6 +----- sys-utils/hwclock.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) commit 0411a57e25b9554cc81ce5dc183046bbb2c25810 Author: J William Piggott Date: Mon Jul 24 12:11:28 2017 -0400 hwclock: remove custom errno string Custom errno messages are unnecessary and problematic for translators. The current messages are also too long, > 90 columns: /dev/rtc0 does not have interrupt functions. Waiting in loop for time from \ /dev/rtc0 to change Fixed: ioctl(3, RTC_UIE_ON, 0): Inappropriate ioctl for device Waiting in loop for time from /dev/rtc0 to change Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) commit 1d5cffa16a0183175684809cf215294ec20b8fd9 Author: J William Piggott Date: Sun Jul 23 20:16:03 2017 -0400 hwclock: fix unimplemented ioctl test The rtc driver has not returned EINVAL for unimplemented ioctls since v2.5.8 in 2002. However, it does return it for other errors; making the current test potentially problematic. Since 9f3d0fc util-linux assumes kernel >= 2.6.0 so remove EINVAL as an ioctl test. Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cbc36f7903ca0d4ee399ad5865b5237af593bacb Author: J William Piggott Date: Sun Jul 23 14:25:55 2017 -0400 hwclock: squash custom errno strings warn() appends ENOENT as: No such file or directory The custom string is unnecessary and problematic for translators. Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) commit 0d7ffb9c856fe07fe3e5afa6ae563b86dbc0e2f1 Author: J William Piggott Date: Sun Jul 23 13:21:32 2017 -0400 hwclock: squash custom errno strings hwclock previously used printf for custom errno messages. Later they were converted to use warn(), but were not squashed. One of the reasons for warn and errno is to avoid making translators deal with a multitude custom strings. Also the custom strings are incorrect: hwclock --hctosys hwclock: Must be superuser to set system clock. Unable to set system clock. We do not know what the system permissions are set to. The correct response is to simply say permission was denied; as the default errno string does. The second line is redundant and just adds noise the code and to logs. Patched: hwclock --hctosys hwclock: settimeofday() failed: Operation not permitted Signed-off-by: J William Piggott sys-utils/hwclock.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) commit 8df545592d73b67b0bf119732b52a5e4c0662ec4 Author: Andreas Henriksson Date: Thu Jul 27 16:00:42 2017 +0200 build: use --runstatedir instead of --localstatedir The util-linux code was previously aligned to use @localstatedir@ and the util-linux build system was set to override the default to use /run. Current GNU Coding Standards introduced the @runstatedir@ variable for this purpose. Lets use that instead. The GNU default for @runstatedir@ is ${localstatedir}/run so util-linux still override the default to be /run to preserve the status quo from before. The only difference is that you'll now pass --runstatedir to override the location on the command line instead of --localstatedir. (FWIW, Debhelper in compat 11 will automatically start passing --runstatedir=/run to all autotools configured builds. It already passes --localstatedir=/var (to avoid it ending up with the GNU default /usr/local/var) which breaks the util-linux build system code that tries to default it to /run. This change will thus allow util-linux and debhelper to work better together and avoid the need for a package-specific override.) Relevant historic commits: * commit 07a16b9d1e5a48550a0d19abb9a900853433ffa2 "build-sys: change --localstatedir to /run" * commit 80c51185d50f00a2701f9379f10fc48a0f885dfc "uuidd: use run configured state directory" * commit 01c5b787947aeaffc7e56000827e3edefa357c59 "agetty: use configured run state directory" [kzak@redhat.com: - add $runstatedir fallback for autoconf < 2.70 - check for unmodified $localstatedir] CC: Sami Kerola Signed-off-by: Andreas Henriksson Signed-off-by: Karel Zak Makefile.am | 4 ++-- configure.ac | 18 +++++++++++------- include/pathnames.h | 2 +- libuuid/src/uuidd.h | 2 +- misc-utils/test_uuidd.c | 4 ++-- misc-utils/uuidd.8.in | 4 ++-- misc-utils/uuidd.rc.in | 2 +- misc-utils/uuidd.socket.in | 2 +- 8 files changed, 21 insertions(+), 17 deletions(-) commit c9ab7387066940d7599a2e5d79d56405195d5f4e Author: Andreas Henriksson Date: Sun Jul 30 19:52:17 2017 +0200 whereis: include native multiarch path in lib search paths This includes atleast the native multiarch path in the paths to search. (Maybe also other multiarch paths should also be searched? But atleast this is a first step.) Before this change (on Debian): $ whereis libc libc: /usr/share/man/man7/libc.7.gz After this change: $ whereis libc libc: /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libc.a /usr/share/man/man7/libc.7.gz Addresses: https://bugs.debian.org/856968 Signed-off-by: Andreas Henriksson configure.ac | 5 +++++ misc-utils/whereis.c | 5 +++++ 2 files changed, 10 insertions(+) commit d52eb4bd9062081c8420b22c029c694f29d036c7 Author: Sami Kerola Date: Sat Jul 29 16:35:30 2017 +0100 tunelp: use linux header Remove use of LPTRUSTIRQ in same go. The LPTRUSTIRQ provided --trust-irq option, but it has not worked in nearly 20 years. Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/include/linux/lp.h Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/drivers/char/lp.c Signed-off-by: Sami Kerola sys-utils/Makemodule.am | 2 +- sys-utils/lp.h | 83 ------------------------------------------------- sys-utils/tunelp.8 | 24 -------------- sys-utils/tunelp.c | 14 ++------- 4 files changed, 3 insertions(+), 120 deletions(-) commit 6db1b1b1bf06ec3e9ae4cdd2545a55dddba136e9 Author: Andreas Henriksson Date: Thu Jul 27 23:00:15 2017 +0200 fstab(5): mention how tabs are escaped Someone requested explicitly mentioning how tabs are escaped, in addition to the already existing spaces example. Addresses: https://bugs.debian.org/580047 Signed-off-by: Andreas Henriksson sys-utils/fstab.5 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 80cd80172e7dd109026d6a711d7bf7d9b14943c2 Author: J William Piggott Date: Mon Jul 24 19:54:15 2017 -0400 hwclock: remove m68k and alpha cmos from manual m68k removed in commit 846c7d3 alpha cmos removed in commit c47a618 Signed-off-by: J William Piggott sys-utils/hwclock.8.in | 9 --------- 1 file changed, 9 deletions(-) commit 4aaabaa9f4a9ed61afb0b9d16f01e0aaf526e8e0 Author: Sami Kerola Date: Sun Jul 23 22:20:37 2017 +0100 wdctl: do not call fsync(2) when closing watchdog device This removes bogus write failed warning. $ wdctl wdctl: write failed: Invalid argument Device: /dev/watchdog [...] Signed-off-by: Sami Kerola sys-utils/wdctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8e953778e43968afaa2122888165205b24c4c59b Author: J William Piggott Date: Sun Jul 23 10:03:18 2017 -0400 Docs: update howto-usage-function.txt Signed-off-by: J William Piggott Documentation/howto-usage-function.txt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) commit c43874baa6eef17f8c190611a0e4c10082b0066a Author: Karel Zak Date: Mon Jul 31 13:33:11 2017 +0200 libsmartcols: fix comment (to make gtk-docs happy) Signed-off-by: Karel Zak libsmartcols/src/table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 00e8e677e6c72b756da57ad39a8cf026111c2106 Author: Karel Zak Date: Mon Jul 31 11:48:38 2017 +0200 column: (-t) disable encoding for non-printable chars $ echo -e '\033[34mBLUE{1\n\033[31mRED{2\n' | ./column -s '{' -t BLUE 1 RED 2 Addresses: https://github.com/karelzak/util-linux/issues/490 Signed-off-by: Karel Zak text-utils/column.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 28a3cc83c56eca679302d8d51a5056b836e3c86e Author: Karel Zak Date: Mon Jul 31 11:45:23 2017 +0200 libsmartcols: add scols_table_enable_noencoding() Now the library encode all output. It seems too strict and difficult to use the library for some use-cases -- for example if you want to use the library for already colorized output (by esc.sequences). Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 2 ++ libsmartcols/src/libsmartcols.h.in | 2 ++ libsmartcols/src/libsmartcols.sym | 2 ++ libsmartcols/src/smartcolsP.h | 1 + libsmartcols/src/table.c | 33 ++++++++++++++++++ libsmartcols/src/table_print.c | 54 +++++++++++++++++++---------- 6 files changed, 76 insertions(+), 18 deletions(-) commit fe63c8a649a292e3262c764b1635b96d3bc98c65 Author: Karel Zak Date: Mon Jul 31 10:27:20 2017 +0200 agetty: fix --login-pause logic Let's "eat" ENTER key when pressed after login pause prompt. Addresses: https://github.com/karelzak/util-linux/issues/491 Signed-off-by: Karel Zak term-utils/agetty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit aaf133265f9403801931b44c2ea29783f22eb374 Author: Mark Tinguely Date: Fri Jun 30 09:30:39 2017 -0500 libblkid: add HPE extended-XFS to known filesystems The HPE (formerly SGI) enhanced XFS has changed its magic version number to allow the use of EXFS and community XFS filesystems at the same time. This patch adds HPE EXFS support to libblkid. [kzak@redhat.com: - removed EXFS log prober, it uses the same magic string as XFS log] Signed-off-by: Mark Tinguely Signed-off-by: Karel Zak libblkid/src/Makemodule.am | 1 + libblkid/src/superblocks/exfs.c | 187 +++++++++++++++++++++++++++++++++ libblkid/src/superblocks/superblocks.c | 1 + libblkid/src/superblocks/superblocks.h | 1 + 4 files changed, 190 insertions(+) commit fa5b4d45d5dcad56b20500cba166576b0a150626 Author: J William Piggott Date: Tue Jul 18 15:42:55 2017 -0400 hwclock: fix regression from c3ae785 hwclock --get foo hwclock: 3 too many arguments given Fixed: hwclock --get foo hwclock: 1 too many arguments given Signed-off-by: J William Piggott sys-utils/hwclock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 62f22d912de2d2360031bef7e123549b27fb86ad Author: J William Piggott Date: Tue Jul 18 14:37:30 2017 -0400 hwclock: remove unused epoch_option Also one whitespace fix. Signed-off-by: J William Piggott sys-utils/hwclock.c | 2 +- sys-utils/hwclock.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) commit 2d9d3ee294ee68a891fa506f33c3865570425204 Author: Karel Zak Date: Wed Jul 19 15:34:35 2017 +0200 tests: check sfdisk resize on unsorted offsets Signed-off-by: Karel Zak tests/expected/sfdisk/resize-dos-unsorted | 72 +++++++++++++++++++++++++++++++ tests/ts/sfdisk/resize | 28 ++++++++++++ 2 files changed, 100 insertions(+) commit 537b4db151085fadf357bd4e7242798b16daabcd Author: Karel Zak Date: Wed Jul 19 15:09:36 2017 +0200 libfdisk: allow to resize in unsorted partition table The current code assumes that partition offsets (starts) are sorted. This is usual situation, but unsorted partition table is also valid... Signed-off-by: Karel Zak libfdisk/src/partition.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 264ef9875a776bf9c422c83a9611c8df749af8e8 Author: Karel Zak Date: Wed Jul 19 15:09:12 2017 +0200 libfdisk: improve table print debugs Signed-off-by: Karel Zak libfdisk/src/fdiskP.h | 2 ++ libfdisk/src/table.c | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) commit a351f2e50402ae2734864bcfa4b5e73be84c7f3e Author: Karel Zak Date: Wed Jul 19 13:27:50 2017 +0200 cfdisk: add resize function Signed-off-by: Karel Zak disk-utils/cfdisk.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 7 deletions(-) commit ea36907965313ca70ec6d803814aeba02a89667e Author: Karel Zak Date: Wed Jul 19 11:42:50 2017 +0200 libfdisk: support default partno in mkpart-fullspec sample Signed-off-by: Karel Zak libfdisk/samples/mkpart-fullspec.c | 51 +++++++++++++++------- tests/expected/libfdisk/mkpart-full-gpt-nopartno | 30 +++++++++++++ tests/expected/libfdisk/mkpart-full-mbr-nopartno | 33 ++++++++++++++ .../libfdisk/mkpart-full-mbr-primary-nopartno | 21 +++++++++ tests/ts/libfdisk/mkpart-full | 46 +++++++++++++++++++ 5 files changed, 166 insertions(+), 15 deletions(-) commit 992f7cbae420ab1b71fd9f2c2ae10c9804c1d213 Author: Karel Zak Date: Wed Jul 19 11:30:57 2017 +0200 libfdisk: add fdisk_disable_dialogs() The default (for historical reasons) is to use dialog driven partitioning. It's possible to avoid dialogs by fdisk_partition template for fdisk_add_partition(). Unfortunately in some case (mostly DOS driver) it's not enough, because we need to distinguish between logical and primary partitions. If we know that dialogs are unwanted then we can default to primary partition, etc. This function simplify semantic of the library for non-interactive programs. Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 2 ++ libfdisk/src/ask.c | 8 ++++++++ libfdisk/src/context.c | 34 ++++++++++++++++++++++++++++++++++ libfdisk/src/dos.c | 6 ++++-- libfdisk/src/fdiskP.h | 1 + libfdisk/src/libfdisk.h.in | 3 +++ libfdisk/src/libfdisk.sym | 2 ++ libfdisk/src/partition.c | 10 ++++++---- 8 files changed, 60 insertions(+), 6 deletions(-) commit e5e704630f470380000b9a1f51cbca7a1606cb67 Author: Karel Zak Date: Wed Jul 19 10:34:03 2017 +0200 libfdisk: (dos) return EINVAL when delete unused partition Signed-off-by: Karel Zak libfdisk/src/dos.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) commit 78f9ecb990b994e272d9a69670b5c006e7f9fcdc Author: Milan Broz Date: Tue Jul 18 13:08:23 2017 +0200 blkid: Add dm-integrity superblock signature Since the kernel version 4.12 there is a new dm-integrity module that provides an emulated per-sector metadata format for storing data integrity. This patch adds dm-integrity magic signature to blkid to recognize such a block device. Signed-off-by: Milan Broz libblkid/src/superblocks/lvm.c | 38 ++++++++++++++++++++++++++++++++++ libblkid/src/superblocks/superblocks.c | 1 + libblkid/src/superblocks/superblocks.h | 1 + 3 files changed, 40 insertions(+) commit 3cf274c9e99ed64c096b0032cc021f79c4fa5568 Author: Antonio Ospite Date: Tue Jul 18 14:29:07 2017 +0200 script: fix ambiguity about the optional argument of the -t option [kzak@redhat.com: - merge two patches from Antonio to the one, - update the patch] Signed-off-by: Karel Zak Signed-off-by: Antonio Ospite term-utils/script.1 | 2 +- term-utils/script.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) commit fbd15c4d47be22fd88670251b44749287af0f2ff Author: Patrick Steinhardt Date: Mon Jul 17 23:14:09 2017 +0200 setpriv: support setting unnamed capabilities When setting capabilities, we accept human readable names like for example `sys_rawio` or `net_admin`. To do so the translation between the capability name and its in-kernel index, we rely on the function `capng_name_to_capability`. When the function does not know the named capability, it will return an error value and we abort setting the capability. This relies upon the ability of libcap to know all capabilities inside of the kernel. But actually, it is possible that new capabilities are introduced inside of the Linux kernel which are not recognized yet by the library. When dumping these unknown capabilities, libcap will simply return a string like "cap_38", that is it will append the capability's in-kernel index to the prefix "cap_". This may lead a user to also think that "cap_38" may be passed to the switches "--inh-caps" or "--ambient-caps", which is unfortunately not the case. We can do better here by instead accepting strings in the form of "cap_N". To do so, we can simply rely on the fact that capability indices are steadily increasing and that the highest index known to the kernel is stored inside of the kernel's procfs, made readily available by our function `real_cap_last_cap()`. So in case libcap does not know a capability name, we can simply parse the string and, if it is in the correct format, check whether the detected index is between 0 and the highest capability index. If so, we can treat it as a valid capability string and apply it. Signed-off-by: Patrick Steinhardt sys-utils/setpriv.c | 3 +++ 1 file changed, 3 insertions(+) commit 18751601a8a401b0633793f0519449d39e165d54 Author: Ruediger Meier Date: Tue Jul 18 11:07:49 2017 +0200 libfdisk: fix warning -Wunused-function Signed-off-by: Ruediger Meier libfdisk/src/context.c | 2 ++ 1 file changed, 2 insertions(+) commit 21be08ac8cf887d982cf0944714659a3ce92345b Author: Ruediger Meier Date: Thu Apr 27 09:12:28 2017 +0200 build-sys: don't use non-existing UUID_LIBS We've added UUID_LIBS in f77a4d1087 but I don't see what it was good for. Signed-off-by: Ruediger Meier libblkid/src/Makemodule.am | 2 +- libfdisk/src/Makemodule.am | 2 +- libmount/src/Makemodule.am | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit ac6a6b0d3cd34fc99c6575cb4155a83c6ed8b2b7 Author: Ruediger Meier Date: Thu Jul 13 20:00:03 2017 +0200 libfdisk: use fdisk_sector_t consistently and fix printf format strings Signed-off-by: Ruediger Meier libfdisk/samples/mkpart-fullspec.c | 6 +++--- libfdisk/src/libfdisk.h.in | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) commit fc77d25f97043f546eb24f1061817311bd80e8ab Author: Ruediger Meier Date: Wed Jul 12 21:41:50 2017 +0200 parse-date: fix printf format warning on 32bit systems: ../lib/parse-date.y: In function 'parse_date': ../lib/parse-date.y:1509:7: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'intmax_t' [-Wformat=] abs_time_zone_min); ^ Signed-off-by: Ruediger Meier lib/parse-date.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8d7370e01cf5b867dd58e4e941ba65e8c393764c Author: Karel Zak Date: Tue Jul 18 10:01:22 2017 +0200 tests: remove UUIDs with time overflow from uuidparse The time_t used by timeval is "long", it means too small on 32-bits archs to hold large numbers. Reported-by: Ruediger Meier Signed-off-by: Karel Zak tests/expected/uuid/uuidparse | 2 -- tests/ts/uuid/uuidparse | 2 -- 2 files changed, 4 deletions(-) commit b9a5e23fa8c0a1b04b7794bfde3885f83a38fdcd Author: Ivan Delalande Date: Thu Jul 6 18:27:11 2017 -0700 libmount: make mnt_context_is_fs_mounted work for /proc Assume that /proc is not mounted instead of returning an error when we are unable to open the mounts and mountinfo files in /proc. Also set cxt->mtab back to NULL so that it gets properly parsed when we check if the next filesystem is mounted. The goal is to have mount -a work when /proc is not mounted, typically with /proc on the first line of fstab. Signed-off-by: Ivan Delalande libmount/src/context.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) commit e0a88864a7119ff80820357c2031528868392d28 Merge: 54e7726f2 c26ddc568 Author: Karel Zak Date: Mon Jul 17 12:02:24 2017 +0200 Merge branch '170711' of github.com:jwpi/util-linux * '170711' of github.com:jwpi/util-linux: hwclock: improve RTC epoch messages hwclock: improve RTC epoch messages hwclock: remove dead ioctl check hwclock: --epoch presence test fails commit 54e7726f2e48f792b6e6b330395dee9718031543 Merge: 98025dea7 abbcec4fc Author: Karel Zak Date: Mon Jul 17 11:59:35 2017 +0200 Merge branch '2017wk28' of git://github.com/kerolasa/lelux-utiliteetit * '2017wk28' of git://github.com/kerolasa/lelux-utiliteetit: bash-completion: make completions to work when bash set -u is in use uuidparse: add bash-completion file docs: add optional option back to struct option ldattach: simplify debugging function when vwarnx(3) is available reset: remove script from the package commit 98025dea7937eed219ab6da39942aa1a53051427 Author: Karel Zak Date: Mon Jul 17 11:36:28 2017 +0200 test: update PMBR hex dumps The commit 8ffa3b651d7e74acba8f1d831b7f68fdb3c66aae has fixed PMBR CHS addresses initialization to be more close to UEFI standard. -000001c0 01 00 ee fe ff ff 01 00 00 00 ff 8f 01 00 00 00 +000001c0 02 00 ee ff ff ff 01 00 00 00 ff 8f 01 00 00 00 Signed-off-by: Karel Zak tests/expected/sfdisk/gpt-attrs | 2 +- tests/expected/sfdisk/gpt-attrs-guid | 2 +- tests/expected/sfdisk/gpt-attrs-space | 2 +- tests/expected/sfdisk/gpt-attrs-with-typo | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) commit 5ecd61851115a62064dd233c870a76fc26e007d7 Author: Karel Zak Date: Mon Jul 17 09:47:42 2017 +0200 libfdisk: use BLKPG_* ioctls on linux only Signed-off-by: Karel Zak libfdisk/src/context.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit c26ddc568f3fb26b45a22cbf89d3294113e70377 Author: J William Piggott Date: Sat Jul 15 16:01:13 2017 -0400 hwclock: improve RTC epoch messages Signed-off-by: J William Piggott sys-utils/hwclock.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) commit f613c3c2ed1cba062f661b04d0653d6a922f2bcc Author: J William Piggott Date: Sat Jul 15 15:44:20 2017 -0400 hwclock: improve RTC epoch messages Make consistent and improve messages in get_epoch_rtc() and set_epoch_rtc(). Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) commit 1705066af503428104ae09e33b44baaf81a9e879 Author: J William Piggott Date: Sat Jul 15 13:56:01 2017 -0400 hwclock: remove dead ioctl check The epoch ioctls test hasn't been valid for 20 years (v2.1.88). RTC has returned ENOTTY for unimplemented ioctls for 15 years. The check is made for RTC_EPOCH_SET, but not for RTC_EPOCH_READ. They were both implemented at the same time. Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit f7599b4f86f0db5856770fcdaeb599b76ea64b64 Author: J William Piggott Date: Fri Jul 14 15:51:47 2017 -0400 hwclock: --epoch presence test fails hwclock --setepoch --epoch 0 Will warn that the epoch option is required. The --epoch presence test is made on its argument after it is converted to an integer. This means any value it can be tested for, can also be given as an input. So make the conversion after the presence test, like the --date option does. Signed-off-by: J William Piggott sys-utils/hwclock-rtc.c | 19 ++++++++----------- sys-utils/hwclock.8.in | 3 +++ sys-utils/hwclock.c | 10 +++------- sys-utils/hwclock.h | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) commit abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056 Author: Sami Kerola Date: Fri Jun 30 23:13:58 2017 +0100 bash-completion: make completions to work when bash set -u is in use User who want to avoid refering to none-existing variables got earlier the following error. $ set -u $ findmnt --output bash: OUTPUT: unbound variable Here is short explanation of this setting. $ help set -u Treat unset variables as an error when substituting. Signed-off-by: Sami Kerola bash-completion/blkid | 2 +- bash-completion/fdisk | 2 +- bash-completion/fincore | 2 +- bash-completion/findmnt | 2 +- bash-completion/losetup | 2 +- bash-completion/lsipc | 2 +- bash-completion/lslocks | 2 +- bash-completion/lsmem | 2 +- bash-completion/partx | 2 +- bash-completion/prlimit | 2 +- bash-completion/sfdisk | 2 +- bash-completion/swapon | 2 +- bash-completion/wdctl | 2 +- bash-completion/zramctl | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) commit 5d70066c1a8d92d10202f9a1e0ea9eb9feb1c6a5 Author: Sami Kerola Date: Fri Jun 30 23:04:48 2017 +0100 uuidparse: add bash-completion file Signed-off-by: Sami Kerola bash-completion/Makemodule.am | 3 +++ bash-completion/uuidparse | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) commit f636ef1f4174dd4fb70fa8830aaceae9385c927d Author: Sami Kerola Date: Wed Jun 28 23:24:54 2017 +0100 docs: add optional option back to struct option The line was accidentally removed in the reference commit where only the short option had to go. Rest of the change is indentation. Reference: 326c5c93b917a623f346155c8b3438b379d9fd60 Signed-off-by: Sami Kerola Documentation/boilerplate.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 31f85fce55523c1ca3650a227edc0c22f87cab60 Author: Sami Kerola Date: Sat Jun 24 17:01:22 2017 +0100 ldattach: simplify debugging function when vwarnx(3) is available The vwarnx(3) is probably not available in all libc implementations, in such cases use the earlier printout as a fallback. Signed-off-by: Sami Kerola configure.ac | 1 + sys-utils/ldattach.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) commit 8e5888906568b32e0dc11240157fc2248acafa72 Author: Sami Kerola Date: Sat Jun 24 12:09:34 2017 +0100 reset: remove script from the package This script requires ncurses to work, and the ncurses provides reset so there should not be need to keep this script hanging around. Signed-off-by: Sami Kerola Documentation/deprecated.txt | 5 ----- configure.ac | 8 -------- term-utils/Makemodule.am | 6 ------ term-utils/reset | 19 ------------------- term-utils/reset.1 | 45 -------------------------------------------- 5 files changed, 83 deletions(-) commit 8ffa3b651d7e74acba8f1d831b7f68fdb3c66aae Author: Karel Zak Date: Fri Jul 14 12:48:18 2017 +0200 libfdisk: make fdisk compliant to UEFI/GPT specification on PMBR The PMBR partition record should be StartingCHS=0x002000 (0/0/2) and EndingCHS=0xFFFFFF (1023/255/63) Addresses: https://github.com/karelzak/util-linux/issues/485 Signed-off-by: Karel Zak libfdisk/src/gpt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit c0eabc53824ba6a429278a400985277ad1764a5f Author: Karel Zak Date: Fri Jul 14 11:36:22 2017 +0200 libfdisk: remove whitespaces Signed-off-by: Karel Zak libfdisk/src/context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 044ebc0c93dba68b0063df4875e6fa2ce8e9e8e1 Author: Karel Zak Date: Fri Jul 14 11:08:54 2017 +0200 cfdisk: use fdisk_reread_changes() Let's make cfdisk usable for disks where some partitions are mounted. Signed-off-by: Karel Zak disk-utils/cfdisk.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit fadd8e08774f872779690fa126b091d068f61d4d Author: Karel Zak Date: Fri Jul 14 11:08:54 2017 +0200 fdisk: use fdisk_reread_changes() Let's make fdisk usable for disks where some partitions are mounted. Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 6 +++++- disk-utils/fdisk.c | 8 ++++++++ disk-utils/fdisk.h | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) commit 1dd63a3b05acd7640c688f9535508417fac950d1 Author: Karel Zak Date: Fri Jul 14 10:51:14 2017 +0200 libfdisk: use BLKPG ioctls to inform kernel about changes This patch introduces fdisk_reread_changes(). The function is less invasive alternative to fdisk_reread_partition_table(). The new function uses BLKPG ioctls for modified partitions. The another partitions are not affected. This solution allows to successfully use fdisks on disk where some partitions are still use (mounted). For example if you want to resize the last partition on the device. Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/context.c | 102 ++++++++++++++++++++++++++++++++++++ libfdisk/src/fdiskP.h | 11 ++++ libfdisk/src/libfdisk.h.in | 2 + libfdisk/src/libfdisk.sym | 1 + libfdisk/src/table.c | 69 ++++++++++++++++++++++++ 6 files changed, 186 insertions(+) commit 87d04a3339252c023bf9025c38c0ec7d3f5ee817 Author: Karel Zak Date: Thu Jul 13 13:46:52 2017 +0200 partx: move partx.h to include/ Let's make the ioctls usable also for libfdisk. Signed-off-by: Karel Zak disk-utils/Makemodule.am | 16 ++++------------ include/Makemodule.am | 1 + {disk-utils => include}/partx.h | 0 3 files changed, 5 insertions(+), 12 deletions(-) commit 0d034857f28910638b549ed2040eae86957fd679 Author: Karel Zak Date: Mon Jul 3 10:23:16 2017 +0200 libfdisk: add comment Signed-off-by: Karel Zak libfdisk/src/partition.c | 3 +++ 1 file changed, 3 insertions(+) commit ea0acfc3358aa6ce2d3733ab6ac9cbbc7aec1535 Author: Karel Zak Date: Fri Jun 30 11:49:29 2017 +0200 sfdisk: use fdisk_device_is_used() Signed-off-by: Karel Zak disk-utils/sfdisk.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) commit b9da1532546630cda5d9dd9863ba2e6477a60bba Author: Karel Zak Date: Fri Jun 30 11:49:12 2017 +0200 libfdisk: add fdisk_device_is_used() Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/context.c | 34 ++++++++++++++++++++++++++++++++++ libfdisk/src/libfdisk.h.in | 1 + libfdisk/src/libfdisk.sym | 1 + 4 files changed, 37 insertions(+) commit 2db3cc4cf3245a3522911dfa2a0e569a249d11df Author: Karel Zak Date: Fri Jun 30 11:29:47 2017 +0200 libfdisk: remove unnecessary fstat() call Signed-off-by: Karel Zak libfdisk/src/context.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 6a1889b03ba2f1b8de456c5f59d5a5722b83b295 Author: Karel Zak Date: Fri Jun 30 11:24:36 2017 +0200 libfdisk: move fdisk_reread_partition_table() to another file Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 2 +- libfdisk/src/alignment.c | 40 ------------------------------------ libfdisk/src/context.c | 41 +++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 41 deletions(-) commit 884659b32a8c632658e00700264570fb027a44d9 Author: Karel Zak Date: Wed Jul 12 14:35:53 2017 +0200 libblkid: don't use CDROM_GET_CAPABILITY ioctl for DM devices For some reason kernel commit e980f62353c697cbf0c4325e43df6e44399aeb64 add extra warning when the ioctl is used for DM devices. It seems we can avoid this ioctl when the device has dm/uuid. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1469532 Signed-off-by: Karel Zak disk-utils/fdisk-list.c | 2 +- include/sysfs.h | 2 +- lib/sysfs.c | 18 +++++++++++------- libblkid/src/probe.c | 6 +++++- libblkid/src/verify.c | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) commit 288acb4eee57846634e0e9a63edce10126579563 Author: Karel Zak Date: Wed Jul 12 12:34:22 2017 +0200 tests: don't use errno in output Signed-off-by: Karel Zak libfdisk/samples/mkpart-fullspec.c | 2 +- libfdisk/samples/mkpart.c | 2 +- tests/expected/libfdisk/mkpart-full-gpt-err-overlap | 2 +- tests/expected/libfdisk/mkpart-full-mbr-err-logical | 2 +- tests/expected/libfdisk/mkpart-full-mbr-err-nospace | 2 +- tests/expected/libfdisk/mkpart-full-mbr-err-primary | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) commit 10bba184bb232edaeecd34eddc0a2e4221e234db Merge: 4a61c960c b704c644c Author: Karel Zak Date: Tue Jul 11 14:31:23 2017 +0200 Merge branch 'master' of https://github.com/pali/util-linux * 'master' of https://github.com/pali/util-linux: tests: update UDF test, add ID_FS_VERSION libblkid: udf: Add support for ID_FS_VERSION libblkid: udf: Fix types libblkid: udf: De-duplicate code for dstring decoding commit 4a61c960cedf861a08f6966688ba6adfc7974f6c Author: Karel Zak Date: Tue Jul 11 14:26:33 2017 +0200 tests: use sample-fdisk-mkpart-fullspec Signed-off-by: Karel Zak tests/commands.sh | 1 + tests/expected/libfdisk/mkpart-full | 0 tests/expected/libfdisk/mkpart-full-gpt | 30 ++++ .../expected/libfdisk/mkpart-full-gpt-err-overlap | 14 ++ tests/expected/libfdisk/mkpart-full-gpt-partno-gap | 30 ++++ tests/expected/libfdisk/mkpart-full-gpt-space-gap | 24 +++ .../expected/libfdisk/mkpart-full-mbr-err-logical | 18 ++ .../expected/libfdisk/mkpart-full-mbr-err-nospace | 12 ++ .../expected/libfdisk/mkpart-full-mbr-err-primary | 12 ++ tests/expected/libfdisk/mkpart-full-mbr-logical | 33 ++++ tests/expected/libfdisk/mkpart-full-mbr-partno-gap | 26 +++ tests/expected/libfdisk/mkpart-full-mbr-primary | 21 +++ tests/expected/libfdisk/mkpart-full-mbr-space-gap | 18 ++ tests/ts/libfdisk/mkpart-full | 181 +++++++++++++++++++++ 14 files changed, 420 insertions(+) commit 167d7e95375405bd94d95e7c95b00c8f619ea0d5 Author: Karel Zak Date: Tue Jul 11 14:24:32 2017 +0200 libfdisk: (dos) accept start for log.partitions on template Signed-off-by: Karel Zak libfdisk/src/dos.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit c25a3ecaba34242143cbddeabf9fe9f211bdc255 Author: Karel Zak Date: Tue Jul 11 13:41:22 2017 +0200 tests: check for missing programs in last(1) test Signed-off-by: Karel Zak tests/ts/utmp/last | 3 +++ 1 file changed, 3 insertions(+) commit 9e9b1afd397b8a0fce306adc3c226ceacee47f71 Author: Karel Zak Date: Tue Jul 11 13:33:52 2017 +0200 tests: use sample-fdisk-mkpart Signed-off-by: Karel Zak tests/commands.sh | 1 + tests/expected/libfdisk/mkpart | 0 tests/expected/libfdisk/mkpart-gpt | 23 +++++++++++++ tests/expected/libfdisk/mkpart-mbr | 17 ++++++++++ tests/expected/libfdisk/mkpart-mbr-logic | 26 +++++++++++++++ tests/ts/libfdisk/mkpart | 57 ++++++++++++++++++++++++++++++++ 6 files changed, 124 insertions(+) commit f2b6a0c0f55cb90425998aba3f53e360768c66f2 Author: Karel Zak Date: Tue Jul 11 13:27:01 2017 +0200 libfdisk: don't hardcode label type in samples Signed-off-by: Karel Zak libfdisk/samples/mkpart-fullspec.c | 2 +- libfdisk/samples/mkpart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 5fb427c8d28eaa2bef2e81c8554b271b5ebc1749 Author: Karel Zak Date: Tue Jul 11 13:00:46 2017 +0200 libfdisk: add sample-fdisk-mkpart-fullspec Signed-off-by: Karel Zak libfdisk/samples/Makemodule.am | 7 +- libfdisk/samples/mkpart-fullspec.c | 171 +++++++++++++++++++++++++++++++++++++ libfdisk/samples/mkpart.c | 19 ++++- 3 files changed, 195 insertions(+), 2 deletions(-) commit 2cb47542761f28caaea5a7e681646140f871b1c5 Author: Karel Zak Date: Tue Jul 11 12:25:02 2017 +0200 libfdisk: (dos) cleanup template based partitioning Signed-off-by: Karel Zak libfdisk/src/dos.c | 58 +++++++++++++++++++++++++++--------------------- libfdisk/src/partition.c | 12 ++++++++++ 2 files changed, 45 insertions(+), 25 deletions(-) commit 4360f56cf6e40b10ab6ace4cf74073de2381c192 Author: Karel Zak Date: Tue Jul 11 12:17:40 2017 +0200 libblkid: don't check for size on UBI (char dev) Signed-off-by: Karel Zak libblkid/src/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2b1aa087340f315f076565bb2eab6c8277d6a742 Author: J William Piggott Date: Sun Jul 2 14:09:41 2017 -0400 hwclock: sync one-liner descriptions Make whatisdb/manpage and usage() one-line descriptions match. Also update the description; hwclock has evolved into much more than reading and setting the Hardware Clock. It also sets the System Clock, warps the System Clock, sets the kernel time configurations, and more. Signed-off-by: J William Piggott sys-utils/hwclock.8.in | 4 ++-- sys-utils/hwclock.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit dc05716f3aba99acdc127b4a0d7c0b227ec75983 Author: J William Piggott Date: Sat Jul 1 20:44:46 2017 -0400 docs: update boilerplate.c usage() Signed-off-by: J William Piggott Documentation/boilerplate.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) commit cb8e26cc5973b51eafc87addceedceed42aa7b27 Author: J William Piggott Date: Sat Jul 1 20:16:48 2017 -0400 hwclock: final usage() strings slice Signed-off-by: J William Piggott sys-utils/hwclock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 57c45481fcd97b48ae956699d7c39a23d24bc298 Author: J William Piggott Date: Sat Jul 1 20:05:56 2017 -0400 hwclock: usage() use program_invocation_short_name Signed-off-by: J William Piggott sys-utils/hwclock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 02777914d58e15cd8f369360a58dbb98c51636b4 Author: J William Piggott Date: Sat Jul 1 14:07:14 2017 -0400 hwclock: remove from usage() FILE *out = stdout Signed-off-by: J William Piggott sys-utils/hwclock.c | 63 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) commit c5f75490975411b77891f0a9c2eef84aeb2f9284 Author: Karel Zak Date: Mon Jul 10 12:51:53 2017 +0200 mount: remove extN from mount.8 man page The e2fsprogs package contains ext4(5) man page with all necessary information. We do not have to duplicate effort and maintain copy of the extN mount options in our mount.8. (We already do the same for XFS.) Signed-off-by: Karel Zak sys-utils/mount.8 | 350 +----------------------------------------------------- 1 file changed, 2 insertions(+), 348 deletions(-) commit dda4743b45e6284967a165dc2e023c165b2c1ec6 Author: Karel Zak Date: Mon Jul 10 12:32:43 2017 +0200 fdisk: reset context after failed script Addresses: https://github.com/karelzak/util-linux/issues/481 Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 2469ba36774f1cc982fe3bace2e8c21aa26701d6 Author: Karel Zak Date: Mon Jul 10 12:32:26 2017 +0200 libfdisk: add fdisk_reassign_device() Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/context.c | 36 ++++++++++++++++++++++++++++++++++++ libfdisk/src/libfdisk.h.in | 2 ++ libfdisk/src/libfdisk.sym | 4 ++++ libfdisk/src/script.c | 1 + 5 files changed, 44 insertions(+) commit a273d83db9be88d77d54f723a261a61b9b06f7b8 Author: Karel Zak Date: Mon Jul 10 10:42:49 2017 +0200 agetty: print /etc/issue on --skip-login The current --skip-login implementation disables also issue file printing. This is unexpected behavior as /etc/issue may contains important information and we have --noissue for admins who don't want it. This patch forces /etc/issue printing if --noissue no specified. Addresses: https://github.com/karelzak/util-linux/issues/480 Signed-off-by: Karel Zak term-utils/agetty.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 6d53d1f99ab3405374e0ebe6c7e9d10d13074dcc Merge: 62f3e7159 d14bcd09e Author: Karel Zak Date: Mon Jul 10 10:15:22 2017 +0200 Merge branch 'help' of https://github.com/rudimeier/util-linux * 'help' of https://github.com/rudimeier/util-linux: setpriv: silence compiler warning misc: consolidate macro style USAGE_HELP_OPTIONS blockdev: correct man page name in --help commit 62f3e715972686670df030c1b0770c4527e40d9d Author: coastal-hiker Date: Tue Jun 27 14:14:49 2017 +0200 last: condition (secs == 0) - now handled correctly Changed comparison "if (secs > 0)" to "if (secs >= 0)" to handle condition (secs == 0) correctly. Suggestions to improve the less-than-elegant if-else chain are welcome. Signed-off-by: Karel Zak login-utils/last.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e1787b1a85f25b97f9ea81ab40112a6257b3ab19 Author: coastal-hiker Date: Mon Jun 26 18:40:28 2017 +0200 last: don't show negative time Under strange circumstances, the output of command 'last reboot' showed the last time as a negative time, with both the hours and the mins value having a minus sign. Example, taken from my workstation: $last reboot [...] reboot system boot 4.4.0-79-generic Wed Jun 14 09:20 - 07:33 (-1:-47) [...] I am aware this should happen only infrequently. Nevertheless, I propose a more robust behaviour: show a minus sign only for the most significant value (days or hours) and show the rest always as positive. In the special case of ((secs < 0) && (secs >= -59)), print mins as "-00". Signed-off-by: Karel Zak login-utils/last.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) commit b704c644cb4df9c802785bf48a03c1105520c948 Author: Pali Rohár Date: Wed Jul 5 13:56:05 2017 +0200 tests: update UDF test, add ID_FS_VERSION tests/expected/blkid/low-probe-udf | 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-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 + 13 files changed, 13 insertions(+) commit db316767434c2c451ec1732861256d5729143e89 Author: Pali Rohár Date: Wed Jul 5 13:50:52 2017 +0200 libblkid: udf: Add support for ID_FS_VERSION Set ID_FS_VERSION to Minimum UDF Read Revision. libblkid/src/superblocks/udf.c | 67 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) commit 35b1ec3c4be3ef5c38b30d10c63237fa5220c276 Author: Pali Rohár Date: Wed Jul 5 13:46:12 2017 +0200 libblkid: udf: Fix types libblkid/src/superblocks/udf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 7afa432a0729f27c3105b30e73e281e663c296dd Author: Pali Rohár Date: Wed Jul 5 12:15:00 2017 +0200 libblkid: udf: De-duplicate code for dstring decoding libblkid/src/superblocks/udf.c | 52 +++++++++++++----------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) commit 1c8792f1ae7fa38cf1d4418ad99c207f65dfdb1a Author: Karel Zak Date: Tue Jul 4 12:50:39 2017 +0200 login: use IPv4 on IPv4-mapping-to-IPv6 It seems that on some systems (e.g. RHEL7) the libc function getaddrinfo() is not able to translate ::ffff: address to IPv4. The result is 0.0.0.0 host address in the last(1) and utmpdump(1) output. /sbin/login -h "::ffff:192.168.1.7" utmpdump: [7] [03926] [1 ] [user1 ] [pts/1 ] [::ffff:192.168.1.7 ] [0.0.0.0 ] [Thu May 12 17:49:50 2016 ] Not sure if this is about order of the getaddrinfo() results, system configuration or libc version. It's irrelevant for login(1). We have to be robust enough to write usable address to log files everywhere. The solution is to detect IPv4-mapping-to-IPv6 and use IPv4 for utmp. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1296233 Signed-off-by: Karel Zak login-utils/login.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit d14bcd09e8beb8258e1dba8450ab7406a5278b55 Author: Ruediger Meier Date: Thu Jun 29 17:28:01 2017 +0200 setpriv: silence compiler warning This got lost in 30129e2f sys-utils/setpriv.c:182:32: warning: implicit conversion from enumeration type 'enum cap_type' to different enumeration type 'capng_type_t' [-Wenum-conversion] return capng_have_capability(which, i); ~~~~~~~~~~~~~~~~~~~~~ ^~~~~ Signed-off-by: Ruediger Meier sys-utils/setpriv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f45f3ec34a37e2779d09625b93be5eb91174f8fc Author: Ruediger Meier Date: Thu Jun 29 15:52:16 2017 +0200 misc: consolidate macro style USAGE_HELP_OPTIONS changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier Documentation/boilerplate.c | 4 ++-- disk-utils/addpart.c | 4 ++-- disk-utils/blockdev.c | 2 +- disk-utils/cfdisk.c | 4 ++-- disk-utils/delpart.c | 4 ++-- disk-utils/fdformat.c | 4 ++-- disk-utils/fdisk.c | 4 ++-- disk-utils/fsck.c | 2 +- disk-utils/fsck.cramfs.c | 2 +- disk-utils/fsck.minix.c | 4 ++-- disk-utils/isosize.c | 4 ++-- disk-utils/mkfs.bfs.c | 4 ++-- disk-utils/mkfs.c | 4 ++-- disk-utils/mkfs.cramfs.c | 2 +- disk-utils/mkfs.minix.c | 4 ++-- disk-utils/mkswap.c | 2 +- disk-utils/partx.c | 4 ++-- disk-utils/raw.c | 4 ++-- disk-utils/resizepart.c | 4 ++-- disk-utils/sfdisk.c | 2 +- disk-utils/swaplabel.c | 4 ++-- include/c.h | 6 ++---- login-utils/chfn.c | 2 +- login-utils/chsh.c | 2 +- login-utils/last.c | 4 ++-- login-utils/lslogins.c | 4 ++-- login-utils/newgrp.c | 4 ++-- login-utils/nologin.c | 4 ++-- login-utils/su-common.c | 2 +- login-utils/sulogin.c | 4 ++-- login-utils/utmpdump.c | 4 ++-- login-utils/vipw.c | 4 ++-- misc-utils/blkid.c | 4 ++-- misc-utils/cal.c | 4 ++-- misc-utils/fincore.c | 4 ++-- misc-utils/findfs.c | 4 ++-- misc-utils/findmnt.c | 4 ++-- misc-utils/getopt.c | 2 +- misc-utils/kill.c | 4 ++-- misc-utils/logger.c | 4 ++-- misc-utils/look.c | 4 ++-- misc-utils/lsblk.c | 4 ++-- misc-utils/lslocks.c | 4 ++-- misc-utils/mcookie.c | 4 ++-- misc-utils/namei.c | 4 ++-- misc-utils/rename.c | 4 ++-- misc-utils/uuidd.c | 4 ++-- misc-utils/uuidgen.c | 4 ++-- misc-utils/uuidparse.c | 4 ++-- misc-utils/whereis.c | 4 ++-- misc-utils/wipefs.c | 4 ++-- schedutils/chrt.c | 4 ++-- schedutils/ionice.c | 4 ++-- schedutils/taskset.c | 4 ++-- sys-utils/blkdiscard.c | 4 ++-- sys-utils/blkzone.c | 4 ++-- sys-utils/chcpu.c | 2 +- sys-utils/chmem.c | 4 ++-- sys-utils/ctrlaltdel.c | 4 ++-- sys-utils/dmesg.c | 4 ++-- sys-utils/eject.c | 4 ++-- sys-utils/fallocate.c | 4 ++-- sys-utils/flock.c | 2 +- sys-utils/fsfreeze.c | 4 ++-- sys-utils/fstrim.c | 4 ++-- sys-utils/hwclock.c | 4 ++-- sys-utils/ipcmk.c | 4 ++-- sys-utils/ipcrm.c | 4 ++-- sys-utils/ipcs.c | 4 ++-- sys-utils/ldattach.c | 4 ++-- sys-utils/losetup.c | 4 ++-- sys-utils/lscpu.c | 4 ++-- sys-utils/lsipc.c | 4 ++-- sys-utils/lsmem.c | 4 ++-- sys-utils/lsns.c | 4 ++-- sys-utils/mount.c | 4 ++-- sys-utils/mountpoint.c | 4 ++-- sys-utils/nsenter.c | 4 ++-- sys-utils/pivot_root.c | 4 ++-- sys-utils/prlimit.c | 4 ++-- sys-utils/readprofile.c | 4 ++-- sys-utils/renice.c | 4 ++-- sys-utils/rtcwake.c | 2 +- sys-utils/setarch.c | 2 +- sys-utils/setpriv.c | 4 ++-- sys-utils/setsid.c | 4 ++-- sys-utils/swapoff.c | 4 ++-- sys-utils/swapon.c | 4 ++-- sys-utils/switch_root.c | 4 ++-- sys-utils/tunelp.c | 4 ++-- sys-utils/umount.c | 4 ++-- sys-utils/unshare.c | 4 ++-- sys-utils/wdctl.c | 4 ++-- sys-utils/zramctl.c | 4 ++-- term-utils/agetty.c | 2 +- term-utils/mesg.c | 4 ++-- term-utils/script.c | 4 ++-- term-utils/scriptreplay.c | 4 ++-- term-utils/setterm.c | 2 +- term-utils/wall.c | 4 ++-- term-utils/write.c | 4 ++-- text-utils/col.c | 2 +- text-utils/colcrt.c | 4 ++-- text-utils/colrm.c | 4 ++-- text-utils/column.c | 4 ++-- text-utils/hexdump.c | 4 ++-- text-utils/line.c | 4 ++-- text-utils/more.c | 2 +- text-utils/pg.c | 4 ++-- text-utils/rev.c | 4 ++-- text-utils/ul.c | 4 ++-- 111 files changed, 204 insertions(+), 206 deletions(-) commit 43c960c8fa280866fd93dbeef06750d9d954a6ed Author: Ruediger Meier Date: Thu Jun 29 15:03:23 2017 +0200 blockdev: correct man page name in --help Signed-off-by: Ruediger Meier disk-utils/blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 07fd6640c80ffd7a2067844aadcb6162431b3525 Merge: afeb1a825 3eeaef995 Author: Karel Zak Date: Thu Jun 29 15:29:33 2017 +0200 Merge branch 'path-fixes' of https://github.com/rudimeier/util-linux * 'path-fixes' of https://github.com/rudimeier/util-linux: hwclock: don't ifdef printf arguments setpriv: align --help tools: add segfault detection for checkusage.sh misc: avoid some dead initialization warnings lscpu: make clang analyzer happy lsmem: fix, using freed memory lib/path: add error handling to path_vcreate() lib/path: fix crash, pathbuf overflow commit 3eeaef995bced0b44c23ae1dcd6c808667667986 Author: Ruediger Meier Date: Wed Jun 28 18:37:44 2017 +0200 hwclock: don't ifdef printf arguments This may fails if printf() is macro, introduced in cc7cb070. clang compiler warnings: CC sys-utils/hwclock.o ../sys-utils/hwclock.c:1228:2: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive] #ifdef __linux__ ^ ../sys-utils/hwclock.c:1230:2: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive] #endif ^ 2 warnings generated. CC: J William Piggott Signed-off-by: Ruediger Meier sys-utils/hwclock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit a4dc44337dcf81357c14ca148f947a6de7cc7894 Author: Ruediger Meier Date: Tue Jun 27 20:36:11 2017 +0200 setpriv: align --help This was forgotton during my last cleanup because the build was auto-disabled on my system. Signed-off-by: Ruediger Meier sys-utils/setpriv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 66b7469960bc97c05a22498d11117ef2d60b54cd Author: Ruediger Meier Date: Tue Jun 27 20:34:29 2017 +0200 tools: add segfault detection for checkusage.sh Signed-off-by: Ruediger Meier tools/checkusage.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit c3ae7854337be9f49540f4b0fb465ee4bd77a5ee Author: Ruediger Meier Date: Sat Jun 17 22:40:41 2017 +0200 misc: avoid some dead initialization warnings Clang analyzer warnings: Dead store, Dead initialization: lib/mbsedit.c:154:8: warning: Value stored to 'in' during its initialization is never read char *in = (char *) &c; ^~ ~~~~~~~~~~~ misc-utils/findmnt-verify.c:129:14: warning: Value stored to 'cn' during its initialization is never read const char *cn = tgt; ^~ ~~~ Dead store, Dead increment: sys-utils/hwclock.c:1461:2: warning: Value stored to 'argv' is never read argv += optind; ^ ~~~~~~ Signed-off-by: Ruediger Meier lib/mbsedit.c | 3 ++- misc-utils/findmnt-verify.c | 3 +-- sys-utils/hwclock.c | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) commit a25fb9e8ec534589bcc9f2fb45b4dfdc4d1084f7 Author: Ruediger Meier Date: Tue Jun 27 20:33:28 2017 +0200 lscpu: make clang analyzer happy Let read_nodes() work on uninitialized structs to silence these two warnings: CC sys-utils/lscpu-lscpu.o warning: Path diagnostic report is not generated. Current output format does not support diagnostics that cross file boundaries. Refer to --analyzer-output for valid output formats In file included from sys-utils/lscpu.c:63: ./include/xalloc.h:32:21: warning: Call to 'malloc' has an allocation size of 0 bytes void *ret = malloc(size); ^~~~~~~~~~~~ sys-utils/lscpu.c:1468:23: warning: Function call argument is an uninitialized value desc->nodemaps[i] = path_read_cpuset(maxcpus, ^~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. Signed-off-by: Ruediger Meier sys-utils/lscpu.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) commit 81435af3be9de47fd74dff0c5e0a6add7c66ae9b Author: Ruediger Meier Date: Tue Jun 27 20:33:18 2017 +0200 lsmem: fix, using freed memory Simply avoiding strdup(). Error handling improved. This was the Clang Analyzer warning: Memory Error, Use-after-free sys-utils/lsmem.c:259:3: warning: Use of memory after it is freed err(EXIT_FAILURE, _("Failed to open %s"), path); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ruediger Meier include/path.h | 5 ++++- lib/path.c | 6 +++--- sys-utils/lscpu.c | 6 +++--- sys-utils/lsmem.c | 19 ++++++++++--------- 4 files changed, 20 insertions(+), 16 deletions(-) commit f567220b716ee096cf6c094ab27dcdabaaa192f6 Author: Ruediger Meier Date: Tue Jun 27 20:33:08 2017 +0200 lib/path: add error handling to path_vcreate() Do not operate on truncated/random paths. Note, path_strdup() can now really return NULL, to be handled in next commit. Signed-off-by: Ruediger Meier lib/path.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) commit afeb1a8255638ee28c2f32f23b91c32890ef48dc Author: Karel Zak Date: Thu Jun 29 13:31:35 2017 +0200 tests: explicitly define wipefs outpuit columns Signed-off-by: Karel Zak tests/expected/sfdisk/wipe-fs-to-dos | 4 ++-- tests/expected/sfdisk/wipe-gpt-to-dos | 4 ++-- tests/expected/sfdisk/wipe-gpt-to-dos-auto | 4 ++-- tests/expected/sfdisk/wipe-partition | 8 ++++---- tests/ts/sfdisk/wipe | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) commit 050f8e357bd8cbfb84b2d0dcdb824e813694e849 Author: Karel Zak Date: Thu Jun 29 13:07:10 2017 +0200 tests: update wipefs outputs Signed-off-by: Karel Zak tests/expected/sfdisk/wipe-fs-to-dos | 6 ++---- tests/expected/sfdisk/wipe-gpt-to-dos | 6 ++---- tests/expected/sfdisk/wipe-gpt-to-dos-auto | 6 ++---- tests/expected/sfdisk/wipe-partition | 8 ++++---- 4 files changed, 10 insertions(+), 16 deletions(-) commit ccedd0d7b12df2382dc223d3325fe52a2981bb59 Author: Carlos Santos Date: Thu Jun 29 07:55:42 2017 -0300 column: fix compilation when libc lacks wide-character support Commit 4762ae9d removed mtsafe_strtok() but left behind calls to wcstok and wcspbrk. This leads to build failures when libc does not have the wide-character functions, like some uClibc builds. Solve the problem by using strtok_r and strpbrk when HAVE_WIDECHAR is not defined. Fixes: http://autobuild.buildroot.net/results/fd8a1a8e0cef3aeed9588540e8e663664f6b43aa http://autobuild.buildroot.net/results/5ad73ea8b471321988c50d80a5e50d4504151dd6 http://autobuild.buildroot.net/results/04411b7280dc51ecd51236967981a42352bbeb3e Signed-off-by: Carlos Santos text-utils/column.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 41d758f82d2e5e0a3f5c87c58cb3ca4eacc80d9b Author: Karel Zak Date: Thu Jun 29 12:58:57 2017 +0200 libmount: use _exit() in handlers The originally used exit() is bad idea for the shared library. Reported-by: Ruediger Meier Signed-off-by: Karel Zak libmount/src/context_mount.c | 8 ++++---- libmount/src/context_umount.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) commit 1626ce113e8df280607895401645591b6d48014f Author: Ruediger Meier Date: Thu Jun 29 04:09:08 2017 +0200 docs: correct line(1) deprecation comment Signed-off-by: Ruediger Meier Documentation/deprecated.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ad553030fbaa2654e3ec8e9524b096eae6b57b21 Author: Ruediger Meier Date: Thu Jun 29 04:09:07 2017 +0200 lib/blkdev: remove support for Linux < 2.6 Remove a hack for kernels between 2.4.15 and 2.4.17 Signed-off-by: Ruediger Meier lib/blkdev.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) commit 9f3d0fce66279ea5f2b8ea694d3bf6a46682c8cd Author: Ruediger Meier Date: Thu Jun 29 04:09:06 2017 +0200 docs: remove some old history from manpages We assume that users will have a kernel >= 2.6.0 and removel references to earlier kernels. There are still a few ones left. Signed-off-by: Ruediger Meier disk-utils/mkfs.cramfs.8 | 2 +- disk-utils/mkfs.cramfs.c | 5 ++- include/pt-mbr-partnames.h | 2 +- include/pt-mbr.h | 2 +- sys-utils/eject.1 | 6 ++-- sys-utils/mount.8 | 88 +++++++++------------------------------------- sys-utils/readprofile.8 | 6 ++-- sys-utils/swapon.8 | 2 +- sys-utils/umount.8 | 5 ++- 9 files changed, 30 insertions(+), 88 deletions(-) commit 4c2af1684590be38c4c3195c138cd13100f13f2b Author: Karel Zak Date: Thu Jun 29 12:40:22 2017 +0200 uuidgen: improve --help Signed-off-by: Karel Zak misc-utils/uuidparse.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 42d2a8b30d5d626d7c23bc4bdfc04f5ebe540d2c Author: Karel Zak Date: Thu Jun 29 12:38:40 2017 +0200 wipefs: improve --help Signed-off-by: Karel Zak misc-utils/wipefs.c | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) commit d9921b2a128f17aa9a9a110444d5faa43e1b371c Author: Karel Zak Date: Thu Jun 29 11:57:22 2017 +0200 wipefs: use libsmartcols The old output is horrible and useless when more devices specified. The old format is also too tricky if more signatures detected. The new output uses one line for each signature, prefixed by device name. For example my workstation: # wipefs /dev/sda* /dev/sdb* DEVICE OFFSET TYPE UUID LABEL sda 0x1fe PMBR sda 0x37e4895e00 gpt sda 0x200 gpt sda1 0x1fe vfat F2BC-BFEC EFI sda1 0x0 vfat F2BC-BFEC EFI sda1 0x36 vfat F2BC-BFEC EFI sda2 0x438 ext4 c5490147-2a6c-4c8a-aa1b-33492034f927 BOOT sda3 0x438 ext4 196972ad-3b13-4bba-ac54-4cb3f7b409a4 HOME sda4 0x438 ext4 d834bc84-0089-4be1-9013-cd8bf35d5ffa ROOT sda5 0x438 ext4 e8ce5375-29d4-4e2f-a688-d3bae4b8d162 WINE sda6 0xff6 swap 210337c6-f8b5-4d65-aab5-a0f343fa9ad4 SWAP sdb 0x200 gpt sdb 0x1fe dos sdb1 0x438 ext4 6467a684-0d10-4f61-a301-67bb26934d90 This patch add --noheadings, --json and --output. Signed-off-by: Karel Zak configure.ac | 1 + misc-utils/Makemodule.am | 4 +- misc-utils/wipefs.8 | 37 ++++++- misc-utils/wipefs.c | 257 +++++++++++++++++++++++++++++++++++++++-------- 4 files changed, 251 insertions(+), 48 deletions(-) commit e8fd8c6b9bf53e646b84ae28b123379752fbd3c2 Author: Karel Zak Date: Thu Jun 29 11:07:54 2017 +0200 uuidparse: se JSON table name on -J Signed-off-by: Karel Zak misc-utils/uuidparse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 2cd417ea71127e5fbaf43e9c27bd2fa86b3c5100 Author: Karel Zak Date: Wed Jun 28 12:08:25 2017 +0200 wipefs: try another magic strings on -o and -t The commit 92296e9ba2bf95259520fa7537ff8edc2aa9edbc introduces "try all permutations for the same superblock". This feature has to be also available if -o and -t is specified. Signed-off-by: Karel Zak misc-utils/wipefs.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) commit 4e60928139e4d522bcb4d97e3cd6f42433c554a0 Author: Karel Zak Date: Wed Jun 28 11:51:12 2017 +0200 wipefs: add control struct Signed-off-by: Karel Zak misc-utils/wipefs.c | 130 ++++++++++++++++++++++++++-------------------------- 1 file changed, 64 insertions(+), 66 deletions(-) commit 193d6f27fb37497669ed429e70b19b11f2b6d4fa Author: Karel Zak Date: Fri Jun 16 11:36:41 2017 +0200 wipefs: don't do step-back if does not match Signed-off-by: Karel Zak misc-utils/wipefs.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) commit 92296e9ba2bf95259520fa7537ff8edc2aa9edbc Author: Karel Zak Date: Fri May 26 13:11:37 2017 +0200 wipefs: print all signature permutations The same FS/RAID/PT signature may be detected by more ways and on more places on the device. The libblkid returns only the first detected signature by default. This patch use blkid_probe_hide_range() to re-scan device for all possible permutations of the same signature. For example the default wipefs(8) output as well as --no-act output will contains primary as well as backup GPT signature now. Reported-by: Ruediger Meier Signed-off-by: Karel Zak misc-utils/wipefs.8 | 12 ++++-------- misc-utils/wipefs.c | 4 ++++ 2 files changed, 8 insertions(+), 8 deletions(-) commit d2b0c6587d729a8e838821cb70d4de18c6969868 Author: Karel Zak Date: Fri May 26 12:58:09 2017 +0200 libblkid: allow to hide already detected signatures The libblkid probing functions returns the first successful result of the filesystem/RAID/PT. Unfortunately, some signatures is possible to detect by more ways or device may contains more copies (e.g. GPT). This is no problem when we wipe signatures from the device. In this case we zeroize on-device signature and re-scan for the signature (by blkid_probe_step_back()). The problem is if we want to read all permutations without the device modification (for example wipefs(8) dry run). This patch add blkid_probe_hide_range(). The function remove (zeroize) specified signature from in-memory cached buffers. If the buffer is later re-used by probing functions then the signature is invisible and we can try detect another variant of the magic string. Signed-off-by: Karel Zak libblkid/docs/libblkid-sections.txt | 2 + libblkid/src/blkid.h.in | 2 + libblkid/src/blkidP.h | 1 + libblkid/src/libblkid.sym | 5 ++ libblkid/src/probe.c | 148 ++++++++++++++++++++++++++++++------ 5 files changed, 133 insertions(+), 25 deletions(-) commit e230ae7b68814a2ea560e5138188a58128e34417 Author: Ruediger Meier Date: Tue Jun 27 20:32:52 2017 +0200 lib/path: fix crash, pathbuf overflow Before: $ lscpu -s "$(tr '\0' 'x' < /dev/zero | head -c 10000)" Segmentation fault (core dumped) After: $ lscpu -s "$(tr '\0' 'x' < /dev/zero | head -c 10000)" lscpu: invalid argument to --sysroot: File name too long Signed-off-by: Ruediger Meier include/path.h | 6 +++++- lib/path.c | 14 ++++++++++---- sys-utils/lscpu.c | 3 ++- sys-utils/lsmem.c | 3 ++- 4 files changed, 19 insertions(+), 7 deletions(-) commit 4fb515f90079739771b64dcb6beeb384e3be7cf5 Author: Karel Zak Date: Tue Jun 27 15:10:09 2017 +0200 setpriv: add --ambient-caps to usage() Signed-off-by: Karel Zak sys-utils/setpriv.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) commit 0c92194eeee9c1fd58580ef852c11eb1861d6dee Author: Patrick Steinhardt Date: Sat Jun 24 16:04:34 2017 +0200 setpriv: support modifying the set of ambient capabilities Right now, we do not support modifying the set of ambient capabilities, which has been introduced quite recently with Linux 4.3. As libcap-ng does not yet provide any ability to modify this set, we do have to roll our own support via `prctl`, which is now easy to do due to the indirections introduced in the preceding commits. We add a new command line argument "--ambient-caps", which uses the same syntax as both "--inh-caps" and "--bounding-set" to specify either adding or dropping capabilities. This commit also adjusts documentation to mention the newly introduced ability to modify the ambient capability set. Based on a patch by Andy Lutomirski. Reviewed-by: Andy Lutomirski Signed-off-by: Patrick Steinhardt sys-utils/setpriv.1 | 8 +++++--- sys-utils/setpriv.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) commit 05a22eac65c3d7756c08ddc14ece2918517bc8ee Author: Patrick Steinhardt Date: Sat Jun 24 16:04:33 2017 +0200 setpriv: support dumping ambient capabilities Our code dumping owned capabilities does not yet handle ambient capabilities, which were only recently introduced with Linux 4.3. This commit implements printing ambient capabilities if they're supported by the system. Based on a patch by Andy Lutomirski. Reviewed-by: Andy Lutomirski Signed-off-by: Patrick Steinhardt sys-utils/setpriv.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) commit 8a5af72c22fa3e06f8d449ccec3da24d08624bbf Author: Patrick Steinhardt Date: Sat Jun 24 16:04:32 2017 +0200 setpriv: proxy function to update capabilities libcap-ng provides a function to update capabilities with `capng_update`. As libcap-ng has not yet been updated to enable modification of ambient capabilities, we cannot use it to update this set, though. In order to allow easily extending the logic to also handle ambient capability sets, we create a new function `cap_update`. Right now, it simply calls out to `capng_update` for all supported capability types. Reviewed-by: Andy Lutomirski Signed-off-by: Patrick Steinhardt sys-utils/setpriv.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) commit 30129e2f5824b6c8f77c792c31298912678cd66f Author: Patrick Steinhardt Date: Sat Jun 24 16:04:31 2017 +0200 setpriv: proxy function checking whether a capability is set The loop in `print_caps` iterates over every capability, checks whether it is set and, if so, prints out its name. Currently, the checking and printing is rather intertwined, making it harder to extend the check whether we own a capability. Prepare code for the introduction of ambient capabilities by disentangling the code checking for a capability and printing code. A new function `has_cap` is introduced and `print_caps` will now simply call out to it and only handle printing itself. This easily allows to extend the capability check based on which capability set is queried. Reviewed-by: Andy Lutomirski Signed-off-by: Patrick Steinhardt sys-utils/setpriv.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) commit 9e5dd89da670879c2463ae24934772032fd4ee26 Author: Patrick Steinhardt Date: Sat Jun 24 16:04:30 2017 +0200 setpriv: introduce indirection for `capng_type` enum The capng_type is used to distinguish the different types of capability sets, that is the effective, inheratibale, permitted capabilities as well as the capability bounding set. In Linux 4.3, a new set of capabilities was introduced with ambient capabilities. Unfortunately, libcap-ng does not provide any support for these kind of capabilities and as such, we will have to roll our own support. As a first step, we introduce an indirection for the `capng_type` enum, allowing us to add the ambient capability type later on. Right now, no functional change is expected from this change and in fact, each of the newly introduce enums should have the same value as respective enum of libcap-ng. Reviewed-by: Andy Lutomirski Signed-off-by: Patrick Steinhardt sys-utils/setpriv.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) commit d0983208a8e08b0286251f6aa762285e23fcdbc0 Merge: b899fd87b d1a7c00ea Author: Karel Zak Date: Tue Jun 27 14:14:57 2017 +0200 Merge branch 'travis-checkusage' of https://github.com/rudimeier/util-linux commit b899fd87bdc0e09a6d14cf7a0ca3f561609c33a0 Merge: 08029093b 551b9cd3f Author: Karel Zak Date: Tue Jun 27 14:14:14 2017 +0200 Merge branch 'help-description' of https://github.com/rudimeier/util-linux * 'help-description' of https://github.com/rudimeier/util-linux: misc: update --help content again login: add --help text blockdev: improve --help and man page misc: consolidate all --help option descriptions misc: introduce print_usage_help_options() misc: revert to the old USAGE_HELP strings commit 551b9cd3f9ca3a84c2a8a4aec0c22bb82cbf8abf Author: Ruediger Meier Date: Sun Jun 25 22:01:12 2017 +0200 misc: update --help content again We change -h, --help display this help and exit -V, --version output version information and exit to -h, --help display this help -V, --version print version Some thoughts about this: * use "display" for --help because it matches better if we would add pager support (like git --help) * "print" for --version to be different * "this" for --help is important to make clear that running --help would not give you any better information than the one you see already * remove "information and exit" because it's bloat for the short-help, everybody knows what it does if it exists In the manpages we should use the old, longer but more correct descriptions, inclusive a reminder if --help/--version are only working when used as the only option. Note the term "version information" indicates that we don't only print a single version number. CC: J William Piggott Signed-off-by: Ruediger Meier include/c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 62cd916f1e43812cb66e614ddcad7ebbc0713639 Author: Ruediger Meier Date: Sun Jun 25 21:58:12 2017 +0200 login: add --help text Signed-off-by: Ruediger Meier login-utils/login.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit a861538cc8d93245f13d43f51f1365533b76be51 Author: Ruediger Meier Date: Sun Jun 25 20:43:44 2017 +0200 blockdev: improve --help and man page Signed-off-by: Ruediger Meier disk-utils/blockdev.8 | 9 +++++++-- disk-utils/blockdev.c | 34 +++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 13 deletions(-) commit b30544549505019f5fc092c5d99fcb1cae1a44b1 Author: Ruediger Meier Date: Sun Jun 25 14:49:47 2017 +0200 misc: consolidate all --help option descriptions Now we are always using the same text also for commands which had still hardcoded descriptions or where we can't use the standard print_usage_help_options macro. Signed-off-by: Ruediger Meier disk-utils/fsck.c | 4 ++-- disk-utils/fsck.cramfs.c | 4 ++-- disk-utils/mkfs.bfs.c | 5 ++--- disk-utils/mkfs.c | 5 +---- disk-utils/mkswap.c | 5 +++-- login-utils/chfn.c | 4 ++-- login-utils/chsh.c | 4 ++-- misc-utils/findmnt.c | 1 - misc-utils/namei.c | 4 ++-- misc-utils/wipefs.c | 5 ++--- schedutils/taskset.c | 5 +++-- sys-utils/chcpu.c | 22 ++++++++++++---------- sys-utils/dmesg.c | 2 +- sys-utils/prlimit.c | 4 ++-- term-utils/agetty.c | 4 ++-- term-utils/script.c | 4 ++-- term-utils/scriptreplay.c | 4 ++-- term-utils/setterm.c | 5 +++-- text-utils/col.c | 6 ++++-- text-utils/more.c | 4 ++-- 20 files changed, 51 insertions(+), 50 deletions(-) commit b1a294c448582c5571fbf7c0d363357c88154016 Author: Ruediger Meier Date: Sun Jun 25 00:19:50 2017 +0200 misc: introduce print_usage_help_options() Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier Documentation/boilerplate.c | 3 +-- disk-utils/addpart.c | 3 +-- disk-utils/cfdisk.c | 3 +-- disk-utils/delpart.c | 3 +-- disk-utils/fdformat.c | 3 +-- disk-utils/fdisk.c | 3 +-- disk-utils/fsck.cramfs.c | 3 +-- disk-utils/fsck.minix.c | 3 +-- disk-utils/isosize.c | 3 +-- disk-utils/mkfs.cramfs.c | 3 +-- disk-utils/mkfs.minix.c | 3 +-- disk-utils/partx.c | 3 +-- disk-utils/raw.c | 3 +-- disk-utils/resizepart.c | 3 +-- disk-utils/sfdisk.c | 4 ++-- disk-utils/swaplabel.c | 3 +-- include/c.h | 14 ++++++++++++-- login-utils/last.c | 3 +-- login-utils/lslogins.c | 3 +-- login-utils/newgrp.c | 3 +-- login-utils/nologin.c | 3 +-- login-utils/su-common.c | 3 +-- login-utils/sulogin.c | 3 +-- login-utils/utmpdump.c | 3 +-- login-utils/vipw.c | 3 +-- misc-utils/blkid.c | 3 +-- misc-utils/cal.c | 3 +-- misc-utils/fincore.c | 3 +-- misc-utils/findfs.c | 3 +-- misc-utils/findmnt.c | 3 +-- misc-utils/getopt.c | 3 +-- misc-utils/kill.c | 3 +-- misc-utils/logger.c | 3 +-- misc-utils/look.c | 3 +-- misc-utils/lsblk.c | 3 +-- misc-utils/lslocks.c | 3 +-- misc-utils/mcookie.c | 3 +-- misc-utils/rename.c | 3 +-- misc-utils/uuidd.c | 3 +-- misc-utils/uuidgen.c | 3 +-- misc-utils/uuidparse.c | 3 +-- misc-utils/whereis.c | 3 +-- schedutils/chrt.c | 3 +-- schedutils/ionice.c | 3 +-- schedutils/taskset.c | 1 - sys-utils/blkdiscard.c | 3 +-- sys-utils/blkzone.c | 3 +-- sys-utils/chmem.c | 3 +-- sys-utils/ctrlaltdel.c | 3 +-- sys-utils/dmesg.c | 3 +-- sys-utils/eject.c | 3 +-- sys-utils/fallocate.c | 3 +-- sys-utils/flock.c | 3 +-- sys-utils/fsfreeze.c | 3 +-- sys-utils/fstrim.c | 3 +-- sys-utils/hwclock.c | 3 +-- sys-utils/ipcmk.c | 3 +-- sys-utils/ipcrm.c | 3 +-- sys-utils/ipcs.c | 3 +-- sys-utils/ldattach.c | 3 +-- sys-utils/losetup.c | 3 +-- sys-utils/lscpu.c | 3 +-- sys-utils/lsipc.c | 3 +-- sys-utils/lsmem.c | 3 +-- sys-utils/lsns.c | 3 +-- sys-utils/mount.c | 3 +-- sys-utils/mountpoint.c | 3 +-- sys-utils/nsenter.c | 3 +-- sys-utils/pivot_root.c | 3 +-- sys-utils/readprofile.c | 3 +-- sys-utils/renice.c | 3 +-- sys-utils/rtcwake.c | 3 +-- sys-utils/setarch.c | 3 +-- sys-utils/setpriv.c | 3 +-- sys-utils/setsid.c | 3 +-- sys-utils/swapoff.c | 3 +-- sys-utils/swapon.c | 3 +-- sys-utils/switch_root.c | 3 +-- sys-utils/tunelp.c | 3 +-- sys-utils/umount.c | 3 +-- sys-utils/unshare.c | 3 +-- sys-utils/wdctl.c | 3 +-- sys-utils/zramctl.c | 3 +-- term-utils/mesg.c | 3 +-- term-utils/wall.c | 3 +-- term-utils/write.c | 3 +-- text-utils/colcrt.c | 3 +-- text-utils/colrm.c | 3 +-- text-utils/column.c | 3 +-- text-utils/hexdump.c | 3 +-- text-utils/line.c | 3 +-- text-utils/pg.c | 3 +-- text-utils/rev.c | 3 +-- text-utils/ul.c | 3 +-- 94 files changed, 105 insertions(+), 187 deletions(-) commit 08029093b09d39f6d01ec7aaee9e9be84be17259 Author: Karel Zak Date: Tue Jun 27 11:26:41 2017 +0200 libblkid: remove dead code and blkid_probe_new_value() The function blkid_probe_new_value() is unnecessary. Signed-off-by: Karel Zak libblkid/src/probe.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) commit d1a7c00eaed1b37bae81c67b038c40bd49384eb3 Author: Ruediger Meier Date: Tue Jun 27 08:25:30 2017 +0200 travis: add make checkusage We will run all built programs with 3 different options on Linux and OSX. Signed-off-by: Ruediger Meier .travis-functions.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 99267518a6f2293eee7352b72e88cac1d985ecbe Author: Ruediger Meier Date: Tue Jun 27 08:25:22 2017 +0200 tools: checkusage can dump all command output use $ make CU_DUMP=1 checkusage for easily reviewing and comparing all output in /tmp/checkusage--help /tmp/checkusage--version /tmp/checkusage--unknownopt This was a big help when doing all my last usage cleanup. Actually I used it to dump the original output, edited it how I would like it, and then changed our programs to match the wanted output. Signed-off-by: Ruediger Meier tools/checkusage.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) commit e8e9267f5deed3a2b071590256244aafe2af7075 Author: Ruediger Meier Date: Tue Jun 27 08:25:10 2017 +0200 tools: ignore unsafe commands in checkusage.sh These commands behave unusual with --unknownopt. Signed-off-by: Ruediger Meier tools/checkusage.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) commit b768ac6b60a87226812d60267a9df6577be7a4a4 Merge: f2bd68815 22174021f Author: Karel Zak Date: Mon Jun 26 22:42:24 2017 +0200 Merge branch 'travis-fix' of https://github.com/rudimeier/util-linux * 'travis-fix' of https://github.com/rudimeier/util-linux: build-sys: fix chown mistake, add checkusage.sh to the dist commit f2bd68815769b50c6e91127099611b091705ada6 Author: Ruediger Meier Date: Mon Jun 26 18:20:06 2017 +0200 uuidparse: fix getopt crash $ ./uuidparse --unknownopt Segmentation fault (core dumped) Hehe, this is the first real bug found by 'make checkusage'. Signed-off-by: Ruediger Meier misc-utils/uuidparse.c | 1 + 1 file changed, 1 insertion(+) commit 789ac55e4fb7fd134aeeb65a24e7af643a94d18a Author: Ruediger Meier Date: Sat Jun 24 16:47:30 2017 +0200 misc: revert to the old USAGE_HELP strings This reverts the include/c.h part of cc7cb070. As discussed on ml. Our current strings are imported from coreutils and not too bad. Also the old strings are still hardcoded at many places. So let's revert the change, then consolidate these strings really everywhere and then think again whether and how we should change them. Signed-off-by: Ruediger Meier include/c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 22174021f8255c4b06d528b93db31dc4d2a4a73c Author: Ruediger Meier Date: Mon Jun 26 16:54:57 2017 +0200 build-sys: fix chown mistake, add checkusage.sh to the dist Sorry, don't know why I reverted fad561b0. But for travis we need it only in check_nonroot(). check_root() *can* do chown and the check_dist() is handled by Makefile. Signed-off-by: Ruediger Meier .travis-functions.sh | 3 +-- Makefile.am | 1 + tools/Makemodule.am | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) commit 47ccf06b4728130beb19b05a5c13a87e2807ad3e Merge: 7fb65db12 86be6a32d Author: Karel Zak Date: Mon Jun 26 15:58:37 2017 +0200 Merge branch 'usage-part2' of https://github.com/rudimeier/util-linux * 'usage-part2' of https://github.com/rudimeier/util-linux: misc: cosmetics, remove argument from usage(FILE*) misc: cosmetics, remove argument from usage(int) misc: never use usage(stderr) misc: never use usage(ERROR) misc: cleanup and fix --unknownopt issues flock, getopt: write --help to stdout and return 0 tools: add checkusage.sh commit 7fb65db12443da09d9a0f3be0c48021236333e28 Author: Karel Zak Date: Mon Jun 26 15:30:12 2017 +0200 script: rename fixtty() to enable_rawmode_tty() Signed-off-by: Karel Zak term-utils/script.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) commit 8198052c9e8ee685c9405fae5f37e2a9e7572c0f Author: Sami Kerola Date: Sat Jun 24 11:48:08 2017 +0100 script: ensure typescript and timing errors do not break terminal Earlier when typescript file failed new line after the error did not cause carriage return. Here is an example how prompt> travels to wrong place: prompt> script 0500-perms/typescript Script started, file is 0500-perms/typescript script: cannot open 0500-perms/typescript: Permission denied prompt> But that wasn't quite as bad as what happen with timing file, that at failure left terminal to state where a reset(1) run was needed. [kzak@redhat.com: - move code to restore_tty()] Signed-off-by: Sami Kerola Signed-off-by: Karel Zak term-utils/script.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) commit 83893f26789d4ffe11146a7c0ee9d34a92a0aaf7 Author: Sami Kerola Date: Sun Jun 18 17:16:35 2017 +0000 uuidparse: add new command This command will analyze and print information about UUID's. The command is based on libuuid/src/uuid_time.c but modified to use libsmartcol. [kzak@redhat.com: - minor coding style changes] Reference: http://marc.info/?l=util-linux-ng&m=149735980715600&w=2 Signed-off-by: Sami Kerola Signed-off-by: Karel Zak .gitignore | 1 + configure.ac | 5 + misc-utils/Makemodule.am | 8 + misc-utils/uuidparse.1 | 69 ++++++++ misc-utils/uuidparse.c | 354 ++++++++++++++++++++++++++++++++++++++++++ tests/commands.sh | 1 + tests/expected/uuid/uuidparse | 33 ++++ tests/ts/uuid/uuidparse | 63 ++++++++ 8 files changed, 534 insertions(+) commit 86be6a32d3fd229dbb17bf5e3348a01e6e6e855a Author: Ruediger Meier Date: Tue Jun 20 20:20:29 2017 +0200 misc: cosmetics, remove argument from usage(FILE*) This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier Documentation/boilerplate.c | 7 ++++--- disk-utils/cfdisk.c | 7 ++++--- disk-utils/sfdisk.c | 7 ++++--- login-utils/last.c | 5 +++-- login-utils/lslogins.c | 7 ++++--- login-utils/newgrp.c | 15 ++++++++------- login-utils/nologin.c | 5 +++-- login-utils/utmpdump.c | 7 ++++--- login-utils/vipw.c | 7 ++++--- misc-utils/fincore.c | 7 ++++--- misc-utils/findmnt.c | 7 ++++--- misc-utils/kill.c | 7 ++++--- misc-utils/logger.c | 7 ++++--- misc-utils/lsblk.c | 7 ++++--- misc-utils/lslocks.c | 7 ++++--- misc-utils/mcookie.c | 7 ++++--- misc-utils/uuidd.c | 7 ++++--- misc-utils/uuidgen.c | 7 ++++--- sys-utils/blkzone.c | 7 ++++--- sys-utils/ctrlaltdel.c | 17 +++++++++-------- sys-utils/eject.c | 7 ++++--- sys-utils/fallocate.c | 7 ++++--- sys-utils/hwclock.c | 5 +++-- sys-utils/ipcs.c | 7 ++++--- sys-utils/lsns.c | 7 ++++--- sys-utils/prlimit.c | 7 ++++--- sys-utils/readprofile.c | 8 ++++---- sys-utils/setpriv.c | 7 ++++--- sys-utils/wdctl.c | 7 ++++--- sys-utils/zramctl.c | 7 ++++--- term-utils/script.c | 7 ++++--- term-utils/scriptreplay.c | 7 ++++--- term-utils/wall.c | 7 ++++--- text-utils/colcrt.c | 7 ++++--- text-utils/colrm.c | 7 ++++--- text-utils/hexdump.c | 7 ++++--- text-utils/hexdump.h | 2 +- text-utils/line.c | 7 ++++--- text-utils/rev.c | 7 ++++--- text-utils/ul.c | 8 ++++---- 40 files changed, 163 insertions(+), 126 deletions(-) commit fa2cd89aca82d14943133c76763c04ae430d5dc7 Author: Ruediger Meier Date: Tue Jun 20 20:30:29 2017 +0200 misc: cosmetics, remove argument from usage(int) This patch is trivial and changes nothing, because we were always using usage(0). Signed-off-by: Ruediger Meier misc-utils/blkid.c | 8 ++++---- sys-utils/nsenter.c | 8 ++++---- sys-utils/unshare.c | 8 ++++---- text-utils/column.c | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) commit 6e1eda6f229f87b77471ce6eb7cbf0ede7c8029e Author: Ruediger Meier Date: Mon Jun 19 20:52:50 2017 +0200 misc: never use usage(stderr) Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier disk-utils/addpart.c | 13 ++++++++----- disk-utils/delpart.c | 13 ++++++++----- disk-utils/fdformat.c | 13 ++++++++----- disk-utils/fdisk.c | 31 +++++++++++++++++-------------- disk-utils/fsck.minix.c | 14 ++++++++------ disk-utils/isosize.c | 13 ++++++++----- disk-utils/mkfs.bfs.c | 26 ++++++++++++++++---------- disk-utils/mkfs.c | 13 ++++++++----- disk-utils/mkfs.minix.c | 10 ++++++---- disk-utils/mkswap.c | 11 ++++++----- disk-utils/partx.c | 14 ++++++++------ disk-utils/resizepart.c | 13 ++++++++----- disk-utils/swaplabel.c | 14 ++++++++------ libsmartcols/samples/fromfile.c | 9 +++++---- login-utils/chfn.c | 13 ++++++++----- login-utils/chsh.c | 12 +++++++----- misc-utils/cal.c | 12 +++++++----- misc-utils/look.c | 12 +++++++----- misc-utils/rename.c | 9 +++++---- misc-utils/wipefs.c | 14 +++++++++----- schedutils/ionice.c | 14 ++++++++------ schedutils/taskset.c | 13 ++++++++----- sys-utils/blkdiscard.c | 9 +++++---- sys-utils/chcpu.c | 13 ++++++++----- sys-utils/chmem.c | 13 ++++++++----- sys-utils/dmesg.c | 13 ++++++++----- sys-utils/fsfreeze.c | 17 +++++++++-------- sys-utils/fstrim.c | 9 +++++---- sys-utils/ipcmk.c | 14 ++++++++------ sys-utils/ipcrm.c | 9 +++++---- sys-utils/losetup.c | 10 ++++++---- sys-utils/lscpu.c | 13 ++++++++----- sys-utils/lsmem.c | 11 +++++++---- sys-utils/mount.c | 25 ++++++++++++++++--------- sys-utils/mountpoint.c | 13 ++++++++----- sys-utils/pivot_root.c | 22 ++++++++++++---------- sys-utils/setsid.c | 13 ++++++++----- sys-utils/swapoff.c | 13 ++++++++----- sys-utils/swapon.c | 14 +++++++++----- sys-utils/switch_root.c | 19 ++++++++++++------- sys-utils/tunelp.c | 21 +++++++++++++-------- sys-utils/umount.c | 10 ++++++---- term-utils/mesg.c | 9 +++++---- term-utils/setterm.c | 14 ++++++++------ text-utils/col.c | 13 ++++++++----- 45 files changed, 371 insertions(+), 252 deletions(-) commit 5118d1be2ade514079f5506bafdf028389ff362e Author: Ruediger Meier Date: Mon Jun 19 20:51:50 2017 +0200 misc: never use usage(ERROR) We are using better/shorter error messages and somtimes also errtryhelp(). Here we fix all cases where the usage function took an int argument for exit_code. Signed-off-by: Ruediger Meier disk-utils/fsck.cramfs.c | 16 ++++++++-------- disk-utils/raw.c | 31 ++++++++++++++++++------------- login-utils/su-common.c | 12 +++++++----- misc-utils/findfs.c | 14 ++++++++------ misc-utils/namei.c | 10 +++++----- schedutils/chrt.c | 14 ++++++++------ sys-utils/ldattach.c | 18 ++++++++++-------- 7 files changed, 64 insertions(+), 51 deletions(-) commit 9325dbfd2018b2a3b510617f4aa13777fbbe23c3 Author: Ruediger Meier Date: Mon Jun 19 09:24:10 2017 +0200 misc: cleanup and fix --unknownopt issues Fixed checkusage.sh warnings: rtcwake: --unknownopt, non-empty stdout rtcwake: --unknownopt, stderr too long: 21 blockdev: --unknownopt, stderr too long: 28 lsipc: --unknownopt, stderr too long: 77 pg: --unknownopt, stderr too long: 23 renice: --unknownopt, stderr too long: 18 sulogin: --unknownopt, stderr too long: 17 write: --unknownopt, stderr too long: 12 Signed-off-by: Ruediger Meier disk-utils/blockdev.c | 27 +++++++++++++++++---------- login-utils/sulogin.c | 8 ++++---- sys-utils/lsipc.c | 9 +++++---- sys-utils/renice.c | 20 ++++++++++++-------- sys-utils/rtcwake.c | 17 ++++++++--------- term-utils/agetty.c | 16 +++++++++------- term-utils/write.c | 10 +++++----- text-utils/pg.c | 13 +++++++------ 8 files changed, 67 insertions(+), 53 deletions(-) commit 6d7bee26bc4f5586b073f9b539453a7499403ea7 Author: Ruediger Meier Date: Mon Jun 19 00:02:44 2017 +0200 flock, getopt: write --help to stdout and return 0 ... and use errtryhelp() instead of usage(). Note in past "getopt --help" returned 2. But it is otherwise documented and was just a mistake IMO. See the unreachable exit(0) which was removed here: d1d03b54 Signed-off-by: Ruediger Meier misc-utils/getopt.c | 48 ++++++++++---------- sys-utils/flock.c | 52 +++++++++++----------- tests/expected/getopt/options-compatible | 2 +- .../expected/getopt/options-invalid_getopt_option | 2 +- .../getopt/options-invocation_without_parameters | 2 +- tests/expected/getopt/options-no-arguments | 2 +- 6 files changed, 54 insertions(+), 54 deletions(-) commit a3c29314f1d93e367a204bddf93c2e355a3bd070 Author: Ruediger Meier Date: Sun Jun 18 15:19:39 2017 +0200 tools: add checkusage.sh Just some simple generic tests for our UL commands, regarding options --help, --version and --unknownopt. The script looks still a bit weired but could be polished to be used in tests/. It would be the first time testing at least "something" for *all* built binaries (currently 109! commands). For the record here are the current candidates with possible problems: $ make checkusage agetty: --unknownopt, stderr too long: 45 blockdev: --unknownopt, stderr too long: 28 flock: --help, no stdout flock: --help, non-empty stderr getopt: --help, returns error kill: --unknownopt, stderr too short: 1 lsipc: --unknownopt, stderr too long: 77 pg: --unknownopt, stderr too long: 23 renice: --unknownopt, stderr too long: 18 rtcwake: --unknownopt, non-empty stdout rtcwake: --unknownopt, stderr too long: 21 sulogin: --unknownopt, stderr too long: 17 write: --unknownopt, stderr too long: 12 Signed-off-by: Ruediger Meier Makefile.am | 6 ++- tools/checkusage.sh | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+), 1 deletion(-) commit c3a4cfc5795da0a5f7eb2753aef3f543d12c8341 Author: Karel Zak Date: Mon Jun 26 14:09:53 2017 +0200 misc: consolidate usage() "Available columns" Signed-off-by: Karel Zak disk-utils/fdisk-list.c | 2 +- disk-utils/partx.c | 3 +-- include/c.h | 2 +- misc-utils/fincore.c | 2 +- misc-utils/lsblk.c | 2 +- misc-utils/lslocks.c | 2 +- sys-utils/losetup.c | 2 +- sys-utils/lsns.c | 3 +-- sys-utils/prlimit.c | 3 +-- sys-utils/swapon.c | 2 +- sys-utils/zramctl.c | 2 +- 11 files changed, 11 insertions(+), 14 deletions(-) commit d6ec64e824cac821fd21f457d9cf37fd663a045f Merge: dfdb1ca81 7948117da Author: Karel Zak Date: Mon Jun 26 13:56:45 2017 +0200 Merge branch '170622' of github.com:jwpi/util-linux * '170622' of github.com:jwpi/util-linux: Docs: move option naming to howto-contribute.txt Docs: update howto-usage-function.txt Docs: add a comment for constants to boilerplate.c include/c.h: add USAGE_COMMANDS and USAGE_COLUMNS commit dfdb1ca8186cfc84ad95d5e356334ce8633a28f7 Merge: c52526029 39aa4e397 Author: Karel Zak Date: Mon Jun 26 13:47:04 2017 +0200 Merge branch 'fix-exit-codes' of https://github.com/rudimeier/util-linux * 'fix-exit-codes' of https://github.com/rudimeier/util-linux: misc: fix optutils.h related exit codes misc: fix xalloc.h related exit codes misc: fix more strutils related exit codes lib: fix strutils.h, remove STRTOXX_EXIT_CODE misc: fix some broken exit codes commit c525260293279acf7ebf116d0b402e47f7a6a17c Merge: 2a14beb4e a2248466e Author: Karel Zak Date: Mon Jun 26 13:42:25 2017 +0200 Merge branch 'usage-part1' of https://github.com/rudimeier/util-linux * 'usage-part1' of https://github.com/rudimeier/util-linux: misc: no more errtryh() mkfs.cramfs: add --help and --version more: add --help and --version whereis: add --help and --version login: add --help and --version fsck: add --help and --version setarch: use errtryhelp() dmesg: do not accept any non-option arguments blkid: use errtryhelp instead of errtryh misc: remove superfluous null pointer checks for optarg uuidd: remove unused define commit a2248466e4aa8d696725a0961663440726a7e40a Author: Ruediger Meier Date: Thu Jun 22 02:27:23 2017 +0200 misc: no more errtryh() Nowadays all our regular commands have --help options. test_uuidd does not use translations anyways. Signed-off-by: Ruediger Meier include/c.h | 6 ------ misc-utils/test_uuidd.c | 25 ++++++++++++++----------- 2 files changed, 14 insertions(+), 17 deletions(-) commit 300d702540224d1b739e06f0b4efda0bc428807c Author: Ruediger Meier Date: Wed Jun 21 22:37:37 2017 +0200 mkfs.cramfs: add --help and --version Note, we were already using errtryhelp() without providing a --help option. Signed-off-by: Ruediger Meier disk-utils/mkfs.cramfs.8 | 8 ++++---- disk-utils/mkfs.cramfs.c | 34 +++++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 15 deletions(-) commit 7948117da5654311dba59b256d9a017d56877592 Author: J William Piggott Date: Sat Jun 24 15:22:49 2017 -0400 Docs: move option naming to howto-contribute.txt Creating and naming options is not done when writing usage(). A contributor may not even read howto-usage-function.txt, but they should read howto-contribute.txt. So move option naming and change information there. Signed-off-by: J William Piggott Documentation/howto-contribute.txt | 25 +++++++++++++++++++++++++ Documentation/howto-usage-function.txt | 28 ---------------------------- 2 files changed, 25 insertions(+), 28 deletions(-) commit 72727e28a1bffb2c2c33627cd477fff34c6ded8f Author: J William Piggott Date: Fri Jun 23 19:57:46 2017 -0400 Docs: update howto-usage-function.txt Signed-off-by: J William Piggott Documentation/howto-usage-function.txt | 75 ++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 36 deletions(-) commit 610d0fbc770e148e243ff843e0c699528686f3c2 Author: J William Piggott Date: Fri Jun 23 19:24:38 2017 -0400 Docs: add a comment for constants to boilerplate.c Signed-off-by: J William Piggott Documentation/boilerplate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 6e2d5a4460da45cb120fa198a8102aa6c7a97378 Author: J William Piggott Date: Thu Jun 22 20:32:27 2017 -0400 include/c.h: add USAGE_COMMANDS and USAGE_COLUMNS * login-utils/lslogins.c: all uses changed * misc-utils/findmnt.c: likewise * sys-utils/blkzone.c: likewise * disk-utils/sfdisk.c: likewise * sys-utils/lscpu.c: likewise * sys-utils/lsmem.c: likewise * sys-utils/wdctl.c: likewise Signed-off-by: J William Piggott disk-utils/sfdisk.c | 2 +- include/c.h | 4 +++- login-utils/lslogins.c | 6 ++---- misc-utils/findmnt.c | 3 +-- sys-utils/blkzone.c | 2 +- sys-utils/lscpu.c | 3 +-- sys-utils/lsmem.c | 5 ++--- sys-utils/wdctl.c | 3 +-- 8 files changed, 12 insertions(+), 16 deletions(-) commit 2a14beb4e9c6cdf4466993741d86e45dd57ddef3 Author: Karel Zak Date: Fri Jun 23 14:26:47 2017 +0200 agetty: fix login name DEL/CTRL^U issue agetty refresh prompt (/etc/issue file etc.) when requested by inotify or netlink. For this purpose we monitor some file descriptors by select(). The terminal input file descriptor is switched to non-canonical mode before select(). The goal is to be informed about user activity before new-line. The FD is immediately switched back to canonical mode when activity is detected. The side effect is that all not-read-yet chars in the input buffer are lost ... so we need to call read() before switch to canonical mode to save the chars. The original implementation has been based on TIOCSTI ioctl. It returns already read chars back to the terminal input buffer to make them useful for canonical mode. The problem was race (agetty writes to input buffer in the same time as user) and result was reordered chars in login name... so useless. This issue has been later fixed by extra buffer (commit 790119b8850ae13bb4254c5096a54b2aeb355b20) for already read data. And TIOCSTI ioctl has been removed. Unfortunately this solution is also wrong, because the buffer is maintained only by agetty and inaccessible for terminal when user edit (by DEL/CTRL^U) login name in canonical mode. The solution is simple -- just don't try to be smart and keep terminal in canonical mode all time (so terminal controls DEL, CTRL^U, etc) and flush input buffer (=discard unread data) and ask user for login name again after prompt reload. The agetty reload is very rarely situation and for user it's pretty obvious that he has to type login name again (as all terminal has been clear+redraw). Addresses: https://github.com/karelzak/util-linux/issues/454 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1464148 Signed-off-by: Karel Zak term-utils/agetty.c | 70 ++++++++++++----------------------------------------- 1 file changed, 15 insertions(+), 55 deletions(-) commit 39aa4e3978ba38d8729cdd098e104b2ccc07ce3a Author: Ruediger Meier Date: Thu Jun 22 22:18:14 2017 +0200 misc: fix optutils.h related exit codes Found by: grep -L "OPTUTILS_EXIT_CODE" $(grep -l "err_exclusive_options" \ $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) Signed-off-by: Ruediger Meier sys-utils/umount.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 778ca2a0d49dc6110a18214c56dd8ae9993983de Author: Ruediger Meier Date: Thu Jun 22 22:17:14 2017 +0200 misc: fix xalloc.h related exit codes Found by: grep -L "XALLOC_EXIT_CODE" $(grep -l "xalloc\.h" \ $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) Signed-off-by: Ruediger Meier disk-utils/mkfs.minix.c | 2 ++ misc-utils/blkid.c | 2 ++ sys-utils/hwclock.c | 1 + sys-utils/mount.c | 4 +++- sys-utils/umount.c | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) commit 0b2b32e8a7a6aed1e3ff1cfc3f63cf33361a67b8 Author: Ruediger Meier Date: Thu Jun 22 22:16:14 2017 +0200 misc: fix more strutils related exit codes Found by grep: grep -l "\bEXIT_\|exit *( *[0-9][0-9] *)\|strutils\.h" $(grep -L \ strutils_set_exitcode $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) The Command shows also some false positives (fstrim.c, context_mount.c, ...) Signed-off-by: Ruediger Meier disk-utils/fsck.cramfs.c | 2 ++ disk-utils/fsck.minix.c | 2 ++ disk-utils/mkfs.cramfs.c | 2 ++ disk-utils/mkfs.minix.c | 2 ++ sys-utils/flock.c | 2 ++ sys-utils/hwclock.c | 2 ++ sys-utils/mount.c | 2 ++ 7 files changed, 14 insertions(+) commit 9c8b9fbacc043164c5ac8adc2b5bdc25402e912c Author: Ruediger Meier Date: Thu Jun 22 22:15:14 2017 +0200 lib: fix strutils.h, remove STRTOXX_EXIT_CODE As discussed on the mailing list. We fix all places where the non-working define STRTOXX_EXIT_CODE was used. Regarding tunelp, also see 7e3c80a7. Signed-off-by: Ruediger Meier disk-utils/fsck.c | 3 +-- include/strutils.h | 7 ++----- lib/strutils.c | 6 ++++++ misc-utils/blkid.c | 3 ++- sys-utils/tunelp.c | 7 ++++--- 5 files changed, 15 insertions(+), 11 deletions(-) commit 05691d9e8857de4e83b343f042e9f4590f15425d Author: Ruediger Meier Date: Tue Jun 20 20:01:32 2017 +0200 misc: fix some broken exit codes These tools have special exit codes. They got changed mistakenly. See: findfs 0e1fa6b6 fsck 658c0891 fsck.cramfs 922ec175 mkfs.cramfs 16154b1f tunelp 2ab428f6 FIXME: STRTOXX_EXIT_CODE doesn't work as it should. Signed-off-by: Ruediger Meier disk-utils/fsck.c | 2 +- disk-utils/fsck.cramfs.c | 2 +- disk-utils/mkfs.cramfs.c | 2 +- misc-utils/findfs.c | 4 ++-- sys-utils/tunelp.c | 5 ++++- 5 files changed, 9 insertions(+), 6 deletions(-) commit c1da6d1eec6210b3bfbd3d8710178e2fcc0f0d5e Author: Ruediger Meier Date: Wed Jun 21 22:37:37 2017 +0200 more: add --help and --version Signed-off-by: Ruediger Meier text-utils/more.1 | 6 ++++++ text-utils/more.c | 29 ++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) commit 5aaa966dcd907bef0fcebabf8be06178cc7e5dce Author: Ruediger Meier Date: Wed Jun 21 22:17:36 2017 +0200 whereis: add --help and --version We can use errtryhelp() now and never print usage to stderr. One may improve all these "bad usage" messages. Signed-off-by: Ruediger Meier misc-utils/whereis.1 | 6 ++++++ misc-utils/whereis.c | 48 +++++++++++++++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 13 deletions(-) commit 7491906df6869e5251ab96ee1de078d0ffc7d3a8 Author: Ruediger Meier Date: Wed Jun 21 04:14:58 2017 +0200 login: add --help and --version Also we don't print the usage text on stderr anymore. Note, the usage text could be improved, currently it does not describe any options. I have only added a pointer to the man page. Signed-off-by: Ruediger Meier login-utils/login.1 | 5 ++++- login-utils/login.c | 28 ++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) commit 58745f35996cb70b51a7e25a2398ee5cbe9295c3 Author: Ruediger Meier Date: Wed Jun 21 15:33:57 2017 +0200 fsck: add --help and --version Also cleanup usage() function, never write usage to stderr. FIXME: - currently strtou32_or_err() exits with wrong exit code. - option -C does not use a safe strto*_err function Signed-off-by: Ruediger Meier disk-utils/fsck.8 | 6 ++++++ disk-utils/fsck.c | 27 ++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) commit 7a87a774afb156ede5d64ca00420d48a9a2248dc Author: Ruediger Meier Date: Wed Jun 21 20:23:09 2017 +0200 setarch: use errtryhelp() Signed-off-by: Ruediger Meier sys-utils/setarch.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) commit 488a21686f0d8a614f0dfe3f8884ace61bf2eccd Author: Ruediger Meier Date: Tue Jun 20 11:50:20 2017 +0200 dmesg: do not accept any non-option arguments 'dmesg foo' is no valid syntax and gives an error now. BTW we avoid the "dead increment of argc and argv. Signed-off-by: Ruediger Meier sys-utils/dmesg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 3b7693cadac203133ad3a13013d507dbc6c1b6b7 Author: Ruediger Meier Date: Tue Jun 20 20:07:01 2017 +0200 blkid: use errtryhelp instead of errtryh We have a --help option and this is preferred. Signed-off-by: Ruediger Meier misc-utils/blkid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit ee8bc16e564d20c4628a5706925edcb8cbb4e96c Merge: a00af97c0 56dce6b7f Author: Karel Zak Date: Thu Jun 22 10:51:58 2017 +0200 Merge branch 'master' of https://github.com/pali/util-linux * 'master' of https://github.com/pali/util-linux: tests: Add UDF hdd image which label has length 30 characters libblkid: udf: Fix parsing of UDF dstring structures commit a00af97c0dcad05a4cff4656433112b6ba04952a Merge: 2e45524d9 2cb89055c Author: Karel Zak Date: Thu Jun 22 10:45:22 2017 +0200 Merge branch '170618' of github.com:jwpi/util-linux * '170618' of github.com:jwpi/util-linux: hwclock: add audit for --systz hwclock: remove unused optstring characters commit 2e45524d969440501c83af3c39d5cab41c573e2f Author: Ivan Delalande Date: Wed Jun 21 16:43:05 2017 -0700 dmesg: print only 2 hex digits for each hex-escaped byte As buf is passed as a signed char buffer in fwrite_hex, fprintf will print every byte from 0x80 as a signed-extended int causing each of these bytes to be printed as "\xffffff80" and such, which can be pretty confusing. Force fprintf to use the argument as a char to make it print only 2 digits, e.g. "\x80". Signed-off-by: Ivan Delalande sys-utils/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 56dce6b7fc60e837e4a64fd9091cc28f22c089c4 Author: Pali Rohár Date: Thu Jun 22 10:38:24 2017 +0200 tests: Add UDF hdd image which label has length 30 characters Structure dstring for label has 32 bytes, first byte is 8 (Compression ID), last byte is 30 (count of 8bit characters in label). Therefore label is not nul terminated and dstring parser needs to handle it (fixed in previous commit). $ dd if=/dev/zero of=udf-hdd-mkudffs-1.3-6.img bs=1M count=10 $ mkudffs -l AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -b 512 udf-hdd-mkudffs-1.3-6.img tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-6 | 9 +++++++++ tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-6.img.xz | Bin 0 -> 2360 bytes 2 files changed, 9 insertions(+) commit f0fcfdc30f529d670b966e40c026a07bb0c2a65c Author: Pali Rohár Date: Thu Jun 22 10:38:08 2017 +0200 libblkid: udf: Fix parsing of UDF dstring structures First byte of dstring is OSTA Compression ID and the last byte is length of recorded bytes (including first byte). Last byte is not a part of recorded characters, therefore it should not be treated as data to decode. libblkid/src/superblocks/udf.c | 66 ++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 21 deletions(-) commit 0caad87fdb87789f40942e14f81539af84c2a55b Author: Ruediger Meier Date: Wed Jun 21 03:01:30 2017 +0200 misc: remove superfluous null pointer checks for optarg This is only needed for optional arguments. Signed-off-by: Ruediger Meier login-utils/chsh.c | 2 -- login-utils/lslogins.c | 15 ++++++--------- text-utils/hexdump.c | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) commit 619081cdab293b0091bf67ee7711c1fd5c23837b Author: Ruediger Meier Date: Mon Jun 19 16:49:50 2017 +0200 uuidd: remove unused define Signed-off-by: Ruediger Meier misc-utils/uuidd.c | 6 ------ 1 file changed, 6 deletions(-) commit 2cb89055c57143f120a404e1c00757eb1b7d41b0 Author: J William Piggott Date: Mon Jun 19 20:30:58 2017 -0400 hwclock: add audit for --systz Signed-off-by: J William Piggott sys-utils/hwclock.c | 1 + 1 file changed, 1 insertion(+) commit 32adac4c9e07ea10c31bf371c7eacfc87902dc4f Author: J William Piggott Date: Mon Jun 19 20:04:21 2017 -0400 hwclock: remove unused optstring characters getopt_long() opstring contained obsolete entries. Signed-off-by: J William Piggott sys-utils/hwclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fad561b0e4b862e320b3c7b72527b09bc1b04860 Author: Karel Zak Date: Wed Jun 21 15:41:21 2017 +0200 build-sys: update DISTCHECK_CONFIGURE_FLAGS Signed-off-by: Karel Zak Makefile.am | 1 + 1 file changed, 1 insertion(+) commit 4ccea6699625e829ff62bf7ebf4bc159e24f9868 Author: Karel Zak Date: Wed Jun 21 13:41:08 2017 +0200 travis: fix another chown issue Signed-off-by: Karel Zak .travis-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 258e74626d19863d41818eff753215ff052be37b Merge: 4a679468c dd3856ffe Author: Karel Zak Date: Wed Jun 21 11:54:51 2017 +0200 Merge branch 'master' of https://github.com/pali/util-linux * 'master' of https://github.com/pali/util-linux: tests: Add UDF hdd images with blocksize 1024 and 4096 created by Linux mkudffs 1.3 libblkid: udf: Fix detection of UDF images with block size 1024 and 4096 commit 4a679468ca2818c0dc1430ea53090009d454301f Author: Karel Zak Date: Wed Jun 21 11:51:39 2017 +0200 travis: use --disable-makeinstall-chown everywhere Signed-off-by: Karel Zak .travis-functions.sh | 1 + 1 file changed, 1 insertion(+) commit 9e258f388a92817aeaef9ec42909bf63470d0454 Author: Karel Zak Date: Wed Jun 21 11:25:55 2017 +0200 docs: add program-desc to howto-usage-function.txt and boilerplate.c Signed-off-by: Karel Zak Documentation/boilerplate.c | 4 ++++ Documentation/howto-usage-function.txt | 2 ++ 2 files changed, 6 insertions(+) commit 3d27fdba59a24760de36441231b367b39e296e77 Author: Karel Zak Date: Wed Jun 21 11:25:16 2017 +0200 hwclock: remove unwanted space before description Signed-off-by: Karel Zak sys-utils/hwclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8ad750bc3c717c3c82a984eac8067a6b2f281956 Merge: a65041b5a ba2cdc0c6 Author: Karel Zak Date: Wed Jun 21 11:16:23 2017 +0200 Merge branch '170427' of github.com:jwpi/util-linux * '170427' of github.com:jwpi/util-linux: hwclock: remove unused stdarg.h Docs: update howto-usage-function.txt hwclock: add --update-drift check hwclock: slice up the usage text hwclock: update --help content and grammar hwclock: use RTC in help output include: update pathnames.h hwclock: add usage() functions heading hwclock: update usage() FILE name hwclock: update usage() to util-linux style hwclock: remove dead code in usage() commit a65041b5ae9de5dc52d37a43367d64ab554964c0 Author: Karel Zak Date: Wed Jun 21 11:12:04 2017 +0200 build-sys: make chown usage more robust * add --disable-makeinstall-chown to travis non-root mode * use "if MAKEINSTALL_DO_SETUID" for chown root:root Signed-off-by: Karel Zak .travis-functions.sh | 1 + login-utils/Makemodule.am | 4 +++- sys-utils/Makemodule.am | 10 ++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) commit 6f1507f135bce5ba7f318c44e05327ca14a0505a Author: Karel Zak Date: Wed Jun 21 10:53:28 2017 +0200 wipefs: exit on failed erase The current behavior is to report error and continue, it seems strange: # blockdev --setro /dev/sdc # wipefs -a /dev/sdc wipefs: /dev/sdc: failed to erase xfs magic string at offset 0x00000000: Operation not permitted /dev/sdc: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42 ^^^^^^^^^^^ not true The patch calls err() to exit. Reported-by: Vratislav Podzimek Signed-off-by: Karel Zak misc-utils/wipefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ba2cdc0c664f5d24d3ef52f82d06029bf0c6ae7f Author: J William Piggott Date: Sun Jun 18 20:21:27 2017 -0400 hwclock: remove unused stdarg.h Signed-off-by: J William Piggott sys-utils/hwclock.c | 1 - 1 file changed, 1 deletion(-) commit 2671bcd6546b16845e69776cb8bde1f6aa61bf7a Author: J William Piggott Date: Sun Jun 18 13:31:36 2017 -0400 Docs: update howto-usage-function.txt Signed-off-by: J William Piggott Documentation/howto-usage-function.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 891b43432fb78722fcc03af2be36cbd340716178 Author: J William Piggott Date: Sun Jun 18 13:14:40 2017 -0400 hwclock: add --update-drift check Only allow --update-drift for --set or --systohc Signed-off-by: J William Piggott sys-utils/hwclock.8.in | 3 +-- sys-utils/hwclock.c | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) commit d4affe81bb271d4a767beb5264f9dbcd2cc73fe3 Author: J William Piggott Date: Sun Jun 18 11:47:18 2017 -0400 hwclock: slice up the usage text Signed-off-by: J William Piggott sys-utils/hwclock.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) commit cc7cb070d92a16eba6d3370739ccc16ff1e53042 Author: J William Piggott Date: Sun Jun 18 10:32:42 2017 -0400 hwclock: update --help content and grammar Reviewed-by: Karel Zak Signed-off-by: J William Piggott include/c.h | 4 ++-- sys-utils/hwclock.c | 48 +++++++++++++++++++++--------------------------- 2 files changed, 23 insertions(+), 29 deletions(-) commit 36b2645405e3408f9fc89026d271c62e8d237d8c Author: J William Piggott Date: Sat Jun 17 19:21:13 2017 -0400 hwclock: use RTC in help output Switching between 'hardware clock' and 'RTC' is ambiguous. RTC is used due to space constraints, so use it consistently. Signed-off-by: J William Piggott sys-utils/hwclock.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit 8493eedd155e5194ff1358fd7e063c84257802b0 Author: J William Piggott Date: Sat Jun 17 16:32:19 2017 -0400 include: update pathnames.h * use /dev/rtc0 (/dev/rtc was for the 'old' driver) * remove hwclock Award workaround and alpha cmos paths * relocate _PATH_BTMP from hwclock to login-utils * add a comment for _PATH_BTMP and fix other login-utils comments * add a comment for proc/cpuinfo * remove empty shutdown.c comment from 4d43977f Review changes * remove 'used in' comments * white space fixes Reviewed-by: Karel Zak Signed-off-by: J William Piggott include/pathnames.h | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) commit 513bfbefa29d28b086087e2c7b7b13dd37128ae0 Author: J William Piggott Date: Sat Jun 17 15:32:28 2017 -0400 hwclock: add usage() functions heading Make a functions heading, similar to the existing options heading. * include/c.h: define USAGE_FUNCTIONS * Documentation/boilerplate.c: add USAGE_FUNCTIONS * sys-utils/hwclock.c add functions header to usage() Reviewed-by: Karel Zak Signed-off-by: J William Piggott Documentation/boilerplate.c | 3 +++ include/c.h | 1 + sys-utils/hwclock.c | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) commit 7d9a866d1ba65e14d53b4f67bf8488800df5ac7b Author: J William Piggott Date: Thu Apr 20 20:53:23 2017 -0400 hwclock: update usage() FILE name Use the util-linux standard file name instead of 'usageto'. Signed-off-by: J William Piggott sys-utils/hwclock.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) commit 064f776c37d203582687ff80751d8cafca276afd Author: J William Piggott Date: Thu Apr 20 20:44:13 2017 -0400 hwclock: update usage() to util-linux style Update usage() according to: Documentation/howto-usage-function.txt Documentation/boilerplate.c Signed-off-by: J William Piggott sys-utils/hwclock.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit ea298febb879b7c8db59bb9026480caf6713259d Author: J William Piggott Date: Thu Apr 20 20:29:15 2017 -0400 hwclock: remove dead code in usage() Commit 677ec86 caused usage() to be called only by --help. So remove the now dead code from usage(). Signed-off-by: J William Piggott sys-utils/hwclock.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) commit 8c1979948c6a616d5e53ef693b4b123ec879441d Author: Karel Zak Date: Tue Jun 20 13:12:43 2017 +0200 build-sys: chown before chmod for SUIDs Make sure SUIDs are really owned by root. Reported-by: L A Walsh Signed-off-by: Karel Zak login-utils/Makemodule.am | 1 + sys-utils/Makemodule.am | 2 ++ 2 files changed, 3 insertions(+) commit 9b76b0e98b7f9e8a7ea1c2b89cf9a73b89fd6bcb Author: Karel Zak Date: Tue Jun 20 12:46:02 2017 +0200 libmount: ignore "bind" from fstab on command line "remount" The current code always apply all flags from /etc/fstab on remount. Unfortunately remount+bind has special semantic and it's impossible from command line to avoid interaction with the "bind" from fstab. Example, fstab: /dev/sda1 /bar ext4 defaults 0 1 /bar /foo none bind 0 0 Command line: # mount /foo -o remount,rw produces: mount(... MS_REMOUNT|MS_BIND ) syscall This changes the per-mountpoint (VFS) ro flag to rw, but doesn't change the filesystem itself. This patch forces libmount to ignore "bind" from fstab when "-o remount" specified on command line. If you need remount+bind semantic you have to specify the "bind" flag on command line. This allow to differentiate between # mount /foo -o remount,bind,rw --> mount(MS_REMOUNT|MS_BIND) and # mount /foo -o remount,rw --> mount(MS_REMOUNT) Suggested-by: NeilBrown Signed-off-by: Karel Zak libmount/src/context.c | 14 +++++++++++--- sys-utils/mount.8 | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) commit 22eb2f0190d8a9850da750641439ccd284ac0bfe Author: Vinnie Magro Date: Mon Jun 19 14:45:02 2017 -0700 dmesg: fragment concatenation When extended console is enabled, the kernel doesn't internally concatenate message fragments, this change adds log fragment concatenation to dmesg: instead of being printed as separate messages, fragments are combined onto one line and printed with the timestamp of the first line. This doesn't work in all cases - such as if another message is logged in between two fragment lines, but in this case the behavior matches the previous output format (printed on the separate lines). [kzak@redhat.com: - rename kmsg_read_buf to kmsg_saved_size, - minor coding style fixes] Signed-off-by: Vinnie Magro Signed-off-by: Karel Zak sys-utils/dmesg.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 110 insertions(+), 7 deletions(-) commit eba71dd06cfa32b53151bb6808e2f4d330bf062a Merge: e0bb63d84 480d6bd80 Author: Karel Zak Date: Tue Jun 20 10:20:49 2017 +0200 Merge branch '170424' of github.com:jwpi/util-linux * '170424' of github.com:jwpi/util-linux: parse-date: time_zone_hhmm() bug fixes parse-date: remove unused ordinal_day_seen parse-date: remove unused year_seen parse-date: refactor tm_diff() parse-date: use to_uchar() instead of assignment. parse-date: use uintmax_t where appropriate parse-date: use int where appropriate parse-date: use intmax_t where appropriate parse-date: remove unused EPOCH_YEAR parse-date: replace ISDIGIT with c_isdigit commit e0bb63d84c0fd4cd10ddb46c228d8a775665cdd1 Author: Karel Zak Date: Mon Jun 19 16:10:33 2017 +0200 tests: add MBR resize tests Signed-off-by: Karel Zak tests/expected/sfdisk/dos-reduce-empty-extended | 25 +++++++++ tests/expected/sfdisk/dos-resize-empty-extended | 25 +++++++++ tests/expected/sfdisk/dos-resize-extended | 33 ++++++++++++ tests/expected/sfdisk/dos-resize-logical | 33 ++++++++++++ tests/ts/sfdisk/dos | 67 +++++++++++++++++++++++++ 5 files changed, 183 insertions(+) commit c134c8b10192f138aeecdcd4b977e9c0b653e8c5 Author: Karel Zak Date: Mon Jun 19 16:03:41 2017 +0200 libfdisk: support logical partition resize Signed-off-by: Karel Zak libfdisk/src/partition.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 5ec4400dec75864b475a8099ba31807fd1272af4 Author: Karel Zak Date: Mon Jun 19 15:32:02 2017 +0200 libfdisk: allow to resize container Signed-off-by: Karel Zak libfdisk/src/partition.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 22f4c4641aca2388d46041c9548ac21dc8cc2a08 Author: Karel Zak Date: Mon Jun 19 15:27:05 2017 +0200 libfdisk: add more debug messages to get-last-possible resize space Signed-off-by: Karel Zak libfdisk/src/partition.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) commit 53625d1ae9944b638f72ff43f6142f4e95a4aeda Author: Karel Zak Date: Mon Jun 19 14:32:59 2017 +0200 libfdisk: (dos) be more verbose on partno -ERANGE error Signed-off-by: Karel Zak libfdisk/src/dos.c | 3 +++ libfdisk/src/partition.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) commit 417234cb93503db625258c64a495da418f6dfd20 Author: Karel Zak Date: Mon Jun 19 11:49:51 2017 +0200 mount: fix man page typo (--bind,ro) Addresses: https://github.com/karelzak/util-linux/issues/464 Signed-off-by: Karel Zak sys-utils/mount.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ee9ba4fa5ec8b51fa300e9369d5993b2eab3182d Author: Karel Zak Date: Mon Jun 19 11:41:02 2017 +0200 libfdisk: (dos) fix primary/logical logic when follow template This stupid bug has been introduced by e1cfb304 (v2.30) and it disables to create extended partition by cfdisk :-( Signed-off-by: Karel Zak libfdisk/src/dos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 998ae28704281303b9131c717ec30e39ca8d62f8 Merge: c0b074854 cf76bbae4 Author: Karel Zak Date: Fri Jun 16 10:50:24 2017 +0200 Merge branch 'some-fixes' of https://github.com/rudimeier/util-linux * 'some-fixes' of https://github.com/rudimeier/util-linux: travis: minor cosmetics lib: style cosmetics plymouth-ctrl.c libmount: fix warning "set but not used" more: remove unused variable tests: split partx in root and non-root tests: fix and refactor partx commit 480d6bd80af3f32737400bc57a277a2210ef1797 Author: J William Piggott Date: Wed Jun 14 19:51:30 2017 -0400 parse-date: time_zone_hhmm() bug fixes * fix incorrect arg type used for abs(). * prevent integer arithmetic overflow by limiting offset to 4 digits. * don't accept malformed offset values like: -4:3 +12:719 +0000001:23 -9:00000001 +0000001123 Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 68 +++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 35 deletions(-) commit dc65dd64aeaf662b82efa37134c2af27470b3293 Author: J William Piggott Date: Fri Jun 9 20:22:23 2017 -0400 parse-date: remove unused ordinal_day_seen Signed-off-by: J William Piggott lib/parse-date.y | 6 ------ 1 file changed, 6 deletions(-) commit cf4b385c357179e918f253db97ffd650c5e2e532 Author: J William Piggott Date: Fri Jun 9 19:56:41 2017 -0400 parse-date: remove unused year_seen Signed-off-by: J William Piggott lib/parse-date.y | 3 --- 1 file changed, 3 deletions(-) commit 1d6702edfd7fd16d326fae7d8207d17d93d336ee Author: J William Piggott Date: Wed Jun 7 13:25:43 2017 -0400 parse-date: refactor tm_diff() Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit bfbace763cd044d95a865038849e0b2895c6e4d5 Author: J William Piggott Date: Mon Jun 5 20:28:26 2017 -0400 parse-date: use to_uchar() instead of assignment. Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 07668cd1fa04d6e185cd71d11c010faea4486897 Author: J William Piggott Date: Tue May 16 15:05:55 2017 -0400 parse-date: use uintmax_t where appropriate Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 75f8be9eb60e124f9326219cbcc0c18b70483491 Author: J William Piggott Date: Mon May 8 13:47:00 2017 -0400 parse-date: use int where appropriate Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 960f98c97aaea56c4bb2f7262c7bca01edc2f933 Author: J William Piggott Date: Mon May 8 13:36:55 2017 -0400 parse-date: use intmax_t where appropriate Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) commit 36a5afd8e890545e77f122dc8e7a97cb9772ebd4 Author: J William Piggott Date: Mon May 8 10:40:15 2017 -0400 parse-date: remove unused EPOCH_YEAR Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 1 - 1 file changed, 1 deletion(-) commit 6fc1d48d3d7a346bcb761fce2c21c80826a21b6e Author: J William Piggott Date: Mon May 8 10:36:11 2017 -0400 parse-date: replace ISDIGIT with c_isdigit Reported-by: Ruediger Meier Influenced-by: gnulib 30784c4 Paul Eggert Signed-off-by: J William Piggott lib/parse-date.y | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) commit c0b0748544ae85b8ff42fb4dbd63ddd7aed4de7d Author: Karel Zak Date: Thu Jun 15 11:49:09 2017 +0200 fstrim: remove obsolete comment We do not de-duplicate by FS root (since afa382f2e087b71c9e626144f2f313abc42ad594). Signed-off-by: Karel Zak sys-utils/fstrim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 155d48f590a50bb5dc265162ff2f9a971daed543 Author: Alex Ivanov Date: Thu Jun 15 11:26:25 2017 +0300 fstrim: prefer earlier mounted filesystems fstrim --all is broken in a way that if there is a bind mount for some filesystem, that filesystem will not be trimmed. This is especially critical for e.g. NixOS distribution, which needs bind mount within root fs: https://github.com/NixOS/nixos/blob/master/modules/system/boot/stage-2-init.sh#L55 Currently for a given filesystem during "de-duplication by source and root" phase, an early mounted fs path is filtered (e.g. "/"), while later mounted fs path is kept (e.g. "/nix/store") though anyway discarded later (since it's an overlaying mount). This leads to skipped trimming. So flip this behaviour. Should also help for other types of overlaying mounts. Reference: https://github.com/karelzak/util-linux/blob/stable/v2.29/libmount/src/tab.c#L715 Signed-off-by: Alex Ivanov sys-utils/fstrim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cf76bbae48f3fe4d00d416a9b91d09672fe2173a Author: Ruediger Meier Date: Thu Jun 15 08:56:43 2017 +0200 travis: minor cosmetics This is just to make the diff to my private travis script a bit smaller. Now we always use $CC _after_ the install script which makes it possible to install/update the compiler in the install section. Signed-off-by: Ruediger Meier .travis-functions.sh | 14 +++++++++++--- .travis.yml | 8 ++------ 2 files changed, 13 insertions(+), 9 deletions(-) commit db981e3e0da2b872071f5299e0b4dc4067553040 Author: Ruediger Meier Date: Thu Jun 8 22:29:32 2017 +0200 lib: style cosmetics plymouth-ctrl.c Signed-off-by: Ruediger Meier lib/plymouth-ctrl.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) commit 0b5f75e412ac613478b44a7c02680d1578a48c0f Author: Ruediger Meier Date: Thu Jun 15 08:56:01 2017 +0200 libmount: fix warning "set but not used" Signed-off-by: Ruediger Meier libmount/src/tab.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit d0c5e5c2417ffc15070cc3485b6a1a9881c099a8 Author: Ruediger Meier Date: Thu Jun 15 08:55:40 2017 +0200 more: remove unused variable slow_tty is at least unused since util-linux 2.2. FYI here is another derived more.c where slow_tty is still used: https://github.com/sergev/LiteBSD/blob/master/old/more/more.c Signed-off-by: Ruediger Meier text-utils/more.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit fd3c28059432620fc7a893fe3b305ce1284810b3 Author: Ruediger Meier Date: Thu Jun 15 02:40:57 2017 +0200 tests: split partx in root and non-root Signed-off-by: Ruediger Meier .../expected/partx/{partx-bsd => partx-image-bsd} | 0 .../partx/{partx-dos+bsd => partx-image-dos+bsd} | 0 .../expected/partx/{partx-gpt => partx-image-gpt} | 0 .../expected/partx/{partx-sgi => partx-image-sgi} | 0 .../expected/partx/{partx-sun => partx-image-sun} | 0 tests/ts/partx/partx | 16 -------- tests/ts/partx/partx-image | 43 ++++++++++++++++++++++ 7 files changed, 43 insertions(+), 16 deletions(-) commit 3a951379a75d64fe418d679e51d9646144a23efb Author: Ruediger Meier Date: Thu Jun 15 02:24:40 2017 +0200 tests: fix and refactor partx Subtest delete-non-existent was broken because since 2d47fa39 option --nr was missing. It wasn't noticed because we did not check stderr. Now we check all return values and output. Signed-off-by: Ruediger Meier tests/expected/partx/partx-detect-parts | 1 + tests/ts/partx/partx | 120 +++++++++++++++++++++++--------- 2 files changed, 87 insertions(+), 34 deletions(-) commit dd3856ffecdd982125a8e8f373398677d6916028 Author: Pali Rohár Date: Wed Jun 14 23:29:03 2017 +0200 tests: Add UDF hdd images with blocksize 1024 and 4096 created by Linux mkudffs 1.3 $ dd if=/dev/zero of=udf-hdd-mkudffs-1.3-4.img bs=1M count=10 $ mkudffs -l Label -b 1024 udf-hdd-mkudffs-1.3-4.img $ dd if=/dev/zero of=udf-hdd-mkudffs-1.3-5.img bs=1M count=10 $ mkudffs -l Label -b 4096 udf-hdd-mkudffs-1.3-5.img tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 | 9 +++++++++ tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 | 9 +++++++++ tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz | Bin 0 -> 2380 bytes tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz | Bin 0 -> 2396 bytes 4 files changed, 18 insertions(+) commit 501aeb60a4914d8e4b273eb1529d70bc6ffaa077 Author: Pali Rohár Date: Wed Jun 14 23:15:14 2017 +0200 libblkid: udf: Fix detection of UDF images with block size 1024 and 4096 When detecting block size of UDF filesystem, try to use also block size 512, 1024, 2048 and 4096. This would allow blkid to detect UDF filesystem in image file created from 4K hard disk (which should have UDF block size 4096). Before this patch only UDF images with block size of 512 and 2048 were detected as only block size from blkid_probe_get_sectorsize() and 2048 were used (blkid_probe_get_sectorsize() returns for disk images 512). libblkid/src/superblocks/udf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit 2a67d912c642765b63cdc41b07515e30e77839ff Author: Karel Zak Date: Wed Jun 14 21:45:56 2017 +0200 wall: don't use gid_t when allocate grounps array Reported-by: Ruediger Meier Signed-off-by: Karel Zak term-utils/wall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 143ea06851104ffaa9d3fe8de09c721d2364de64 Author: Sami Kerola Date: Mon May 29 18:52:17 2017 +0100 lib: remove _RLD_ from forbid environment variable list The RLD environment variables are related to runtime linker vulnerability in TELNET on systems running Silicon Graphics IRIX. It is extremely unlikely current util-linux would be compiled on such system. Reference: http://www.cert.org/historical/advisories/CA-1995-14.cfm Reference: http://signatures.juniper.net/documentation/signatures/TELNET%3AEXPLOIT%3ASGI-RLD.html Refefence: http://www.polarhome.com/service/man/?qf=rld&tf=2&of=IRIX&sf=1 Signed-off-by: Sami Kerola lib/env.c | 1 - 1 file changed, 1 deletion(-) commit 35e82b2926537c0e7264f84b38045b522fa82003 Author: Sami Kerola Date: Mon May 29 18:39:22 2017 +0100 lib: simplify cpuset if clauses that return There is no need for 'else' when 'if' will return. In same go move call of tolower() to last possible moment in char_to_val(), a lot of time hex values should hit 0-9 range, and it can be omitted. Signed-off-by: Sami Kerola lib/cpuset.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit f4d37838673f022c8c05c4beb5057bdb683a76ca Author: Sami Kerola Date: Sun May 28 10:37:06 2017 +0100 misc: remove stray semicolons Signed-off-by: Sami Kerola lib/mbsalign.c | 2 +- libblkid/src/superblocks/adaptec_raid.c | 2 +- libmount/src/btrfs.c | 4 ++-- libmount/src/context_mount.c | 2 +- libmount/src/context_umount.c | 2 +- libsmartcols/src/column.c | 2 +- misc-utils/test_uuidd.c | 2 +- sys-utils/unshare.c | 2 +- term-utils/wall.c | 2 +- text-utils/column.c | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) commit a9e3ec19898aaed0997e778490db711d11b7366f Author: Sami Kerola Date: Sun May 28 19:06:08 2017 +0100 losetup: add missing initializer [clang] sys-utils/losetup.c:290:12: warning: variable 'rc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] sys-utils/losetup.c:293:7: note: uninitialized use occurs here sys-utils/losetup.c:290:8: note: remove the 'if' if its condition is always true sys-utils/losetup.c:228:9: note: initialize the variable 'rc' to silence this warning Signed-off-by: Sami Kerola sys-utils/losetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1b5042636fa92c977d9a033f685ceb7f3c4c5fc9 Author: Sami Kerola Date: Sun May 28 10:21:48 2017 +0100 misc: fix reassigned values before old ones has been used [cppcheck] Signed-off-by: Sami Kerola disk-utils/cfdisk.c | 2 +- libblkid/src/devno.c | 2 +- libblkid/src/probe.c | 2 +- libfdisk/src/gpt.c | 2 +- libfdisk/src/script.c | 2 +- libmount/src/btrfs.c | 2 +- libmount/src/cache.c | 6 +++--- libmount/src/context.c | 2 +- libmount/src/context_umount.c | 2 +- libmount/src/optstr.c | 2 +- libmount/src/tab_diff.c | 4 ++-- libmount/src/tab_update.c | 2 +- libsmartcols/src/column.c | 2 +- misc-utils/findmnt-verify.c | 2 +- misc-utils/findmnt.c | 8 ++++---- sys-utils/losetup.c | 2 +- sys-utils/swapon.c | 2 +- 17 files changed, 23 insertions(+), 23 deletions(-) commit e3e0054f5a2daa8ef8b8fd9b04bc9c0dbddec740 Author: Sami Kerola Date: Sat May 27 21:18:57 2017 +0100 isosize: avoid reading more data than what is needed In same go fix error reporting when input file is not long enough. $ touch empty $ isosize empty isosize: empty: might not be an ISO filesystem isosize: read error on empty: Success Signed-off-by: Sami Kerola disk-utils/isosize.c | 57 +++++++++------------------------------------------- 1 file changed, 10 insertions(+), 47 deletions(-) commit 504c03ecf8d5f205e740cd698a1c3b6d3303cb12 Author: Sami Kerola Date: Sun May 21 17:47:39 2017 +0100 uuidgen: slice up the usage text Signed-off-by: Sami Kerola misc-utils/uuidgen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 9f430c8a5ba842465ac72b3a101cb66ba3848959 Author: Sami Kerola Date: Sat May 20 10:41:23 2017 +0100 rename: notice when expression and replacement are the same string The rename(1) can exit early when replace expression and replacement are identical string. It is also appropriate to change return value in this case to 'nothing was renamed'. Signed-off-by: Sami Kerola misc-utils/rename.c | 3 +++ 1 file changed, 3 insertions(+) commit e228735e18cd92f005d8343225867faf7d5cc7b8 Merge: 098a75a18 2a3843335 Author: Karel Zak Date: Wed Jun 14 11:56:57 2017 +0200 Merge branch 'master' of ra.kernel.org:/pub/scm/utils/util-linux/util-linux commit 098a75a18b3a8e2c6adc72a5e574b796435ee6cd Author: Karel Zak Date: Wed Jun 14 11:53:43 2017 +0200 wall: fix OSX getgrouplist, gid_t* vs int* This was the compiler warning: term-utils/wall.c:156:39: warning: passing 'gid_t *const' (aka 'unsigned int *const') to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign] rc = getgrouplist(login, pw->pw_gid, buf->groups, &ngroups); ^~~~~~~~~~~ /usr/include/unistd.h:653:43: note: passing argument to parameter here int getgrouplist(const char *, int, int *, int *); ^ Reported-by: Ruediger Meier Signed-off-by: Karel Zak term-utils/wall.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit bda267627e47081e7eed769e9cb437cefb54188b Author: Ruediger Meier Date: Wed Jun 14 00:14:13 2017 +0200 misc: POSIX usage dd, regarding unit suffixes In POSIX we have only 'b' and 'k' (case-sensitive). In the real work, OSX was the only system I've found which does not understand capital 'K'. Signed-off-by: Ruediger Meier sys-utils/losetup.8 | 2 +- tests/ts/fincore/count | 2 +- tests/ts/libmount/loop-overlay | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit 5abaf5b035e00b877ad125cbe7f0770b216459df Author: Ruediger Meier Date: Tue Jun 13 15:33:58 2017 +0200 tests: add more tests for line(1) Signed-off-by: Ruediger Meier tests/expected/misc/line | 18 ++++++++++++++++++ tests/ts/misc/line | 29 +++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 4 deletions(-) commit b1557fe98120132e6671924af4ed69f4e21d3de4 Author: Sami Kerola Date: Tue May 16 09:18:24 2017 +0100 misc: fix ggc-7 fallthrough warnings (Original patch and commit message edited by Rudi.) gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra. This warning can be silenced by using comment /* fallthrough */ which is also recognized by other tools like coverity. There are also other valid comments (see man gcc-7) but we consolidate this style now. We could have also used __attribute__((fallthrough)) but the comment looks nice and does not need to be ifdef'ed for compatibility. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ Reviewed-by: Ruediger Meier Suggested-by: Karel Zak Signed-off-by: Sami Kerola disk-utils/mkfs.cramfs.c | 2 +- login-utils/last.c | 2 +- login-utils/su-common.c | 1 + login-utils/sulogin.c | 7 +++---- misc-utils/cal.c | 4 ++-- misc-utils/rename.c | 1 - sys-utils/flock.c | 2 +- sys-utils/hwclock.c | 3 ++- sys-utils/ipcrm.c | 3 +++ sys-utils/nsenter.c | 2 +- sys-utils/unshare.c | 2 +- term-utils/agetty.c | 4 ++-- text-utils/hexdump-parse.c | 2 +- text-utils/more.c | 5 +++-- text-utils/pg.c | 4 ++-- text-utils/ul.c | 4 ++-- 16 files changed, 26 insertions(+), 22 deletions(-) commit 11e904f02cb1ec4e17e71b9925f35d5f7786e5fe Author: Ruediger Meier Date: Mon Jun 12 01:59:36 2017 +0200 libblkid: fix gcc-7 warning -Wint-in-bool-context BLOCK_SIZE(sb) should be unsigned so that the left shift is defined. This was the warning: ../libblkid/src/superblocks/exfat.c: In function 'probe_exfat': ../libblkid/src/superblocks/exfat.c:40:42: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] #define CLUSTER_SIZE(sb) (BLOCK_SIZE(sb) << (sb)->bpc_bits) ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ../libblkid/src/superblocks/exfat.c:122:14: note: in expansion of macro 'CLUSTER_SIZE' if (!sb || !CLUSTER_SIZE(sb)) ^~~~~~~~~~~~ Signed-off-by: Ruediger Meier libblkid/src/superblocks/exfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit acecab61e575d0729356f1ae2d78642d0c0bccc3 Author: Ruediger Meier Date: Sun Jun 11 23:18:21 2017 +0200 misc: fix gcc-7 snprintf warnings -Wformat-truncation ../lib/loopdev.c: In function 'loopcxt_next_from_sysfs': ../lib/loopdev.c:545:32: warning: '/loop/backing_file' directive output may be truncated writing 18 bytes into a region of size between 1 and 256 [-Wformat-truncation=] snprintf(name, sizeof(name), "%s/loop/backing_file", d->d_name); ^~~~~~~~~~~~~~~~~~~~~~ ../lib/loopdev.c:545:3: note: 'snprintf' output between 19 and 274 bytes into a destination of size 256 snprintf(name, sizeof(name), "%s/loop/backing_file", d->d_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/sysfs.c: In function 'sysfs_is_partition_dirent': ../lib/sysfs.c:343:31: warning: '/start' directive output may be truncated writing 6 bytes into a region of size between 1 and 256 [-Wformat-truncation=] snprintf(path, sizeof(path), "%s/start", d->d_name); ^~~~~~~~~~ ../lib/sysfs.c:343:2: note: 'snprintf' output between 7 and 262 bytes into a destination of size 256 snprintf(path, sizeof(path), "%s/start", d->d_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/sysfs.c: In function 'sysfs_partno_to_devno': ../lib/sysfs.c:372:32: warning: '/partition' directive output may be truncated writing 10 bytes into a region of size between 1 and 256 [-Wformat-truncation=] snprintf(path, sizeof(path), "%s/partition", d->d_name); ^~~~~~~~~~~~~~ ../lib/sysfs.c:372:3: note: 'snprintf' output between 11 and 266 bytes into a destination of size 256 snprintf(path, sizeof(path), "%s/partition", d->d_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/sysfs.c:377:33: warning: '/dev' directive output may be truncated writing 4 bytes into a region of size between 1 and 256 [-Wformat-truncation=] snprintf(path, sizeof(path), "%s/dev", d->d_name); ^~~~~~~~ ../lib/sysfs.c:377:4: note: 'snprintf' output between 5 and 260 bytes into a destination of size 256 snprintf(path, sizeof(path), "%s/dev", d->d_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ruediger Meier lib/loopdev.c | 2 +- lib/sysfs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit f64ddc95f39f2cb5cc5b41748754ecbe81cfa7dd Author: Ruediger Meier Date: Sun Jun 11 22:20:24 2017 +0200 misc: fix gcc-7 sprintf warnings -Wformat-overflow ../login-utils/last.c: In function ‘main’: ../login-utils/last.c:624:23: warning: ‘%s’ directive writing up to 31 bytes into a region of size 27 [-Wformat-overflow=] sprintf(path, "/dev/%s", ut->ut_line); ^~ ~~ ../login-utils/last.c:624:3: note: ‘sprintf’ output between 6 and 37 bytes into a destination of size 32 sprintf(path, "/dev/%s", ut->ut_line); ../libblkid/src/devname.c: In function 'probe_one': ../libblkid/src/devname.c:166:29: warning: '%s' directive writing up to 255 bytes into a region of size 245 [-Wformat-overflow=] sprintf(path, "/sys/block/%s/slaves", de->d_name); ^~ ../libblkid/src/devname.c:166:3: note: 'sprintf' output between 19 and 274 bytes into a destination of size 256 sprintf(path, "/sys/block/%s/slaves", de->d_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ruediger Meier libblkid/src/devname.c | 2 +- login-utils/last.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 39ff5b34d3274a02526a1226fdd8845c95bbc823 Author: Ruediger Meier Date: Sun Jun 11 22:00:49 2017 +0200 hwclock: fix warning [-Winvalid-noreturn] clang warned: CC sys-utils/hwclock.o ../sys-utils/hwclock.c:1274:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn] We have to move the noreturn attribute from the function definition to the declaration. Signed-off-by: Ruediger Meier sys-utils/hwclock.c | 2 +- sys-utils/hwclock.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) commit b68d953e62bd6132e2e610a264122cc762e979a2 Author: Ruediger Meier Date: Sun Jun 11 21:48:08 2017 +0200 libmount: btrfs, remove unused setter functions We have never used them since introduced in 2cd28fc8. clang compiler warned about it. Signed-off-by: Ruediger Meier libmount/src/btrfs.c | 4 ---- 1 file changed, 4 deletions(-) commit b017648ad357f9d0223909d27be533472685b807 Author: Ruediger Meier Date: Sun Jun 11 20:45:14 2017 +0200 tests: fix fincore, don't use variable COLUMNS COLUMNS is automatically set by bash and may result in stupid errors like fincore: unknown column: 160 Signed-off-by: Ruediger Meier tests/ts/fincore/count | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 59879322e629b7b929c4643d84ec3e372633c693 Author: Ruediger Meier Date: Tue Jun 13 11:08:10 2017 +0200 libsmartcols: fix warning "unused parameter" Noticed on OSX. Signed-off-by: Ruediger Meier libsmartcols/src/table_print.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 92e486f80ef8ebc5afc23ae1df0fc526e6817d13 Author: Ruediger Meier Date: Tue Jun 13 10:09:45 2017 +0200 libfdisk: fix guid usage of packed struct gpt_entry clang issued warnings like this: ../libfdisk/src/gpt.c:371:18: warning: taking address of packed member 'type' of class or structure 'gpt_entry' may result in an unaligned pointer value [-Waddress-of-packed-member] guid_to_string(&e->type, str); ^~~~~~~ Signed-off-by: Ruediger Meier libfdisk/src/gpt.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) commit 2a38433356abbfa245bb70685ab9361ad8e023a5 Merge: c972852b2 3a5ce6e7e Author: Karel Zak Date: Tue Jun 13 23:01:23 2017 +0200 Merge branch 'sami-fallthrough' of https://github.com/rudimeier/util-linux * 'sami-fallthrough' of https://github.com/rudimeier/util-linux: misc: fix ggc-7 fallthrough warnings commit 3a5ce6e7efe62e1f583c090f907bf8518ce2f4ba Author: Sami Kerola Date: Tue May 16 09:18:24 2017 +0100 misc: fix ggc-7 fallthrough warnings (Original patch and commit message edited by Rudi.) gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra. This warning can be silenced by using comment /* fallthrough */ which is also recognized by other tools like coverity. There are also other valid comments (see man gcc-7) but we consolidate this style now. We could have also used __attribute__((fallthrough)) but the comment looks nice and does not need to be ifdef'ed for compatibility. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ Reviewed-by: Ruediger Meier Suggested-by: Karel Zak Signed-off-by: Sami Kerola disk-utils/mkfs.cramfs.c | 2 +- login-utils/last.c | 2 +- login-utils/su-common.c | 1 + login-utils/sulogin.c | 7 +++---- misc-utils/cal.c | 4 ++-- misc-utils/rename.c | 1 - sys-utils/flock.c | 2 +- sys-utils/hwclock.c | 3 ++- sys-utils/ipcrm.c | 3 +++ sys-utils/nsenter.c | 2 +- sys-utils/unshare.c | 2 +- term-utils/agetty.c | 4 ++-- text-utils/hexdump-parse.c | 2 +- text-utils/more.c | 5 +++-- text-utils/pg.c | 4 ++-- text-utils/ul.c | 4 ++-- 16 files changed, 26 insertions(+), 22 deletions(-) commit 7f387c5c215e7208a7217d528878fb5d3b2a7b5b Author: Ruediger Meier Date: Tue Jun 13 03:16:02 2017 +0200 libfdisk: cleanup sun label checksum usuage We are using now the formerly unused function sun_pt_checksum(). This cleanup was motivated by clang compiler warning, see below. Also nice that we are now always using uint16_t instead of short. Warning was: ../libfdisk/src/sun.c:177:35: warning: taking address of packed member 'csum' of class or structure 'sun_disklabel' may result in an unaligned pointer value [-Waddress-of-packed-member] while(ush < (unsigned short *)(&sunlabel->csum)) Signed-off-by: Ruediger Meier include/pt-sun.h | 2 +- libfdisk/src/sun.c | 33 +++++++-------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) commit c972852b29391c35b1d5c7d3e1e6413e0cc86908 Author: Karel Zak Date: Tue Jun 13 12:15:11 2017 +0200 lscpu: cleanup DMI detection return codes Michal wrote: There is weird mix of logic in lscpu-dmi.c which sometimes returns 0 and sometimes -1 on error. Since most checks are if (rc) goto done; this bails out early on error skipping some detection methods. Further, in lscpu.c all following detections are guarder by if(hyper) so returning -1 causes all following methods to be skipped. Reported-by: Michal Suchanek Signed-off-by: Karel Zak sys-utils/lscpu-dmi.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) commit f12e4374368056a5af0b2f9d91ee36de40644239 Author: Karel Zak Date: Tue Jun 13 11:17:06 2017 +0200 libsmartcols: (docs) add new functions Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 4 ++++ 1 file changed, 4 insertions(+) commit d9eddf72a35e8e122de1135e5731198842fa2cac Author: Karel Zak Date: Tue Jun 13 11:14:46 2017 +0200 column: add --table-header-repeat Signed-off-by: Karel Zak text-utils/column.1 | 3 +++ text-utils/column.c | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) commit 36e07cebf1323098b2854b3571563abda01f0323 Author: Karel Zak Date: Tue Jun 13 11:11:17 2017 +0200 libsmartcols: add header-repeat feature Signed-off-by: Karel Zak libsmartcols/src/libsmartcols.h.in | 2 ++ libsmartcols/src/libsmartcols.sym | 2 ++ libsmartcols/src/smartcolsP.h | 4 ++++ libsmartcols/src/table.c | 35 +++++++++++++++++++++++++++++++++++ libsmartcols/src/table_print.c | 27 ++++++++++++++++++++++++--- 5 files changed, 67 insertions(+), 3 deletions(-) commit 5df8f14c3014dfba317f32023674354277a2c7de Author: Karel Zak Date: Mon Jun 12 16:35:58 2017 +0200 libsmartcols: add missing symbols Signed-off-by: Karel Zak libsmartcols/src/libsmartcols.sym | 6 ++++++ 1 file changed, 6 insertions(+) commit 26cd36a6361977c362886595e1dc37e163966ead Merge: e33b38748 29b721bc9 Author: Karel Zak Date: Mon Jun 12 15:39:59 2017 +0200 Merge branch 'pylibmount-NULL-terminate-kwlist-in-Context_init' of https://github.com/zmedico/util-linux * 'pylibmount-NULL-terminate-kwlist-in-Context_init' of https://github.com/zmedico/util-linux: pylibmount: NULL terminate kwlist in Context_init commit e33b387483494711439578f209e0ce245410047c Author: Karel Zak Date: Mon Jun 12 11:51:36 2017 +0200 libsmartcols: add scols_table_{set,get}_termheight() Signed-off-by: Karel Zak libsmartcols/src/libsmartcols.h.in | 2 ++ libsmartcols/src/smartcolsP.h | 3 ++- libsmartcols/src/table.c | 40 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) commit f46a8d7e6636b7cc1e56bd0010c3950e2a11cbd2 Author: Karel Zak Date: Mon Jun 12 11:38:38 2017 +0200 lib/ttyutils: return terminal lines too Signed-off-by: Karel Zak include/ttyutils.h | 1 + lib/ttyutils.c | 68 ++++++++++++++++++++++++++++++++++-------------- libsmartcols/src/table.c | 4 +++ 3 files changed, 54 insertions(+), 19 deletions(-) commit b35ca0ab377bc45f92119688cc0016b6ca81fdd7 Author: Karel Zak Date: Mon Jun 12 10:44:37 2017 +0200 docs: update TODO, remove auto,noauto It seems good enough to use the current semantic and check for "noauto" string rather than evaluate "auto/noauto" as a bit flag. We use flags for mount options, but in this case (mount --all) it's overkill to convert all options on all fstab entries to flags just to be sure that somewhere is no "auto,noauto" obscure setting. Signed-off-by: Karel Zak Documentation/TODO | 5 ----- 1 file changed, 5 deletions(-) commit 1d9e35cc1e22f20184daff74ae131453c917d44c Author: Karel Zak Date: Fri Jun 9 11:33:18 2017 +0200 lsblk: add option --tree Now lsblk uses --list when --sort is specified. This patch allows to specify --tree to overwrite this default behavior add to force tree-like output. In this case tree branches are sorted by the . $ lsblk --sort SIZE NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda2 8:2 0 200M 0 part /boot sda1 8:1 0 200M 0 part /boot/efi sda6 8:6 0 7.8G 0 part [SWAP] sda5 8:5 0 35.1G 0 part /home/misc sda4 8:4 0 50G 0 part / sdb1 8:17 0 74.5G 0 part /home/archive sdb 8:16 0 74.5G 0 disk sda3 8:3 0 130.3G 0 part /home sda 8:0 0 223.6G 0 disk $ lsblk --sort SIZE --tree NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 74.5G 0 disk └─sdb1 8:17 0 74.5G 0 part /home/archive sda 8:0 0 223.6G 0 disk ├─sda2 8:2 0 200M 0 part /boot ├─sda1 8:1 0 200M 0 part /boot/efi ├─sda6 8:6 0 7.8G 0 part [SWAP] ├─sda5 8:5 0 35.1G 0 part /home/misc ├─sda4 8:4 0 50G 0 part / └─sda3 8:3 0 130.3G 0 part /home Signed-off-by: Karel Zak Documentation/TODO | 3 --- misc-utils/lsblk.8 | 4 +++- misc-utils/lsblk.c | 13 +++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) commit bff78d701d73dcd77d1631433d0d377917c2bfba Author: Karel Zak Date: Fri Jun 9 11:11:38 2017 +0200 libblkid: (vfat) add more debug messages Signed-off-by: Karel Zak libblkid/src/superblocks/vfat.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 29b721bc9d20ed44858017689ce1745c220bd0d4 Author: Zac Medico Date: Wed Jun 7 17:21:33 2017 -0700 pylibmount: NULL terminate kwlist in Context_init Fixes a segfault observed with python3.6. libmount/python/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 11573ac0c840e5189873fcd897a14356942172cf Author: Karel Zak Date: Wed Jun 7 12:40:17 2017 +0200 libmount: (umount) use mount table filter on -c only The path canonicalization is the worst use-case, it's better to read all mount table than try canonicalize. Signed-off-by: Karel Zak libmount/src/context_umount.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit f8416301c195d50a21cb54d9ea9abeccc40f9ee7 Author: Karel Zak Date: Wed Jun 7 11:35:26 2017 +0200 libmount: use mount table filter on --no-canonicalize The umount command option --no-canonicalize means that the path is already canonical. So, we can use mount table filter in this case too. Signed-off-by: Karel Zak libmount/src/context.c | 13 +++++++------ libmount/src/context_umount.c | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) commit f60d62afa16b807761ba6b04be250315f4844390 Author: Karel Zak Date: Tue Jun 6 12:09:34 2017 +0200 rename: add -o to the man page Signed-off-by: Karel Zak misc-utils/rename.1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 5fba8b758cf4d64c21dba81ea30bcc11f2e1d3ee Merge: 4d670b2e4 9a838c3c5 Author: Karel Zak Date: Tue Jun 6 12:07:26 2017 +0200 Merge branch 'rename-nooverride' of https://github.com/dov/util-linux * 'rename-nooverride' of https://github.com/dov/util-linux: Changed "override" to "overwrite" rename option. Added --no-override option to rename. commit 4d670b2e44dc9c6d039500d1cefad7e54c1c2b00 Merge: 9f1af3314 375269429 Author: Karel Zak Date: Tue Jun 6 12:06:28 2017 +0200 Merge branch 'hwclock-localtime' of https://github.com/Villemoes/util-linux commit 9f1af33141556df9f0fa75e6c357499952fcb880 Author: Karel Zak Date: Tue Jun 6 12:05:14 2017 +0200 umount: add note about NFS and -c to umount.8 Signed-off-by: Karel Zak sys-utils/umount.8 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit ce6e269447ce86b0c303ec2febbf4264d318c713 Author: NeilBrown Date: Mon Jun 5 12:32:58 2017 +1000 umount: never 'stat' the path when "-c" is given. It is currently not possible to reliably and automatically unmount an NFS filesystem. If the server is not available, the umount command will hang. The hang can be avoided by using "-l" or "-f", but neither of these are appropriate for automatic use such as by an automounter (e.g automountd or systemd). "-l" will unmount even if the filesystem is in use, which an automounter generally doesn't want. If the filesystem is in use, then the umount should fail. "-f" can cause the filesystem to abort pending transactions which might break filesystem semantics. This can be useful in the hands of a sysadmin, but not when used by an automatic tool. umount has another option, "-c" aka "--no-canonicalize" which avoids some "stat" calls. Currently this doesn't avoid all calls to canonicalize_path() as mnt_context_prepare_umount() -> lookup_umount_fs() -> mnt_context_find_umount_fs() -> mnt_context_get_mtab_for_target() -> mnt_resolve_path() -> canonicalize_path_and_cache() -> canonicalize_path() leads to that function being called. The "-c" option could be taken to mean "I know what I'm doing, this really is the path to a mount point, I just want you to unmount it". Given that, it seems suitable to extend this to avoid all 'stat' calls on the mountpoint. It is already appropriate for any automount program to pass "-c" to "umount", so they can be changed to do so at any time. With the patch below, "-c" will result in the mountpoint never being "stat"ed, so umount won't hang on an inaccessible server. This isn't quite sufficient, for NFS at least, as the usage of libmount in umount.nfs still calls 'stat' on the mount point. "-c" isn't passed to the umount helper, but it is reasonable for such helpers to assume "-c" because "umount" will have canonicalized the path when that is appropriate. So, this patch treats "-c" much like "-l" and "-f" when deciding whether it is safe to 'stat' the path. Signed-off-by: NeilBrown libmount/src/context_umount.c | 2 ++ 1 file changed, 2 insertions(+) commit daef243facf82f3aca712ee1d6f2a9b10c2fb59f Merge: 94826d0de fc747ee72 Author: Karel Zak Date: Mon Jun 5 15:27:39 2017 +0200 Merge branch 'fdformat-done1' of https://github.com/jwilk-forks/util-linux * 'fdformat-done1' of https://github.com/jwilk-forks/util-linux: fdformat: clear progress message before printing "done" commit 94826d0dec68455aa4c311d71d50a6ecf8c82a06 Author: Sebastian Schrader Date: Thu Jun 1 16:52:10 2017 +0200 setpriv: Add --init-groups option Add an --init-groups option which initializes the supplementary groups from the system's group database (e.g /etc/group) using initgroups(3). sys-utils/setpriv.1 | 8 ++++++ sys-utils/setpriv.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 5 deletions(-) commit 5f032ae4bb6a5ec832289f77727d34cb73cba602 Author: Karel Zak Date: Mon Jun 5 13:29:20 2017 +0200 chsh: cleanup global_shells usage * global variables are always initialized by NULL * it seems we need it as global variable due to libreadline, then use it as global everywhere in the same .c file. Signed-off-by: Karel Zak login-utils/chsh.c | 65 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 26 deletions(-) commit 54373fb9b910f5fe64f1d14a6db36437063b4983 Author: Karel Zak Date: Mon Jun 5 13:15:59 2017 +0200 chsh: split get_shell_list() Let's use two functions is_known_shell() and print_shells() to make the code more readable and to avoid complex semantic of the original get_shell_list(). Signed-off-by: Karel Zak login-utils/chsh.c | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) commit d1818b9e123c7e93dc99cc5e8a528e1ee215fe90 Author: Sami Kerola Date: Thu May 18 22:19:36 2017 +0100 chsh: make readline completion to propose valid shells This is better than default readline completion, that gives paths from current directory onwards. Signed-off-by: Sami Kerola login-utils/chsh.c | 117 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 90 insertions(+), 27 deletions(-) commit 9a838c3c55fb80df930a4656af747e2eb6d3ab70 Author: Dov Grobgeld Date: Sat Jun 3 23:40:47 2017 +0300 Changed "override" to "overwrite" rename option. misc-utils/rename.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) commit fc747ee72ae5cf0f792462c044a0cc333d862411 Author: Jakub Wilk Date: Fri Jun 2 23:54:10 2017 +0200 fdformat: clear progress message before printing "done" Before: Formatting ... done1 After: Formatting ... done Signed-off-by: Jakub Wilk disk-utils/fdformat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3752694299815a5253dc9f0589d284ed43cf370b Author: Rasmus Villemoes Date: Wed May 31 20:25:16 2017 +0200 hwclock: allow -l as alias for --localtime For symmetry with --utc where a short form is already allowed, and to make it easier to write scripts that will work with both util-linux' and busybox' hwclock, make -l another spelling of --localtime. (Busybox also understands --localtime, but only if it has been compiled with long option support.) sys-utils/hwclock.8.in | 2 +- sys-utils/hwclock.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) commit fabb90676af89bcb5f429793746f141c0c71e014 Author: Dov Grobgeld Date: Sat May 27 23:07:13 2017 +0300 Added --no-override option to rename. misc-utils/rename.c | 53 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 16 deletions(-) commit 600eb9de4d769c67bb7c93d6d2f07bd2646d0498 Author: Johannes Berg Date: Thu Jan 8 11:12:05 2015 +0100 add python module rfkill.py | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) commit fd06998396d631f028fd8f8d7bcb2b442c578292 Author: Johannes Berg Date: Thu Jan 8 09:02:42 2015 +0100 use uapi rfkill.h rfkill.h | 295 ++------------------------------------------------------------- 1 file changed, 6 insertions(+), 289 deletions(-) commit 203718ec7b2b6c5d43701dd3ea4f9ea357f38f0d Author: Johannes Berg Date: Fri May 3 13:24:22 2013 +0200 version 0.5 now with nfc support version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dac08a7c92ce48c2f1325af6f498a8de9ab9377e Author: Johannes Berg Date: Fri May 3 13:22:45 2013 +0200 fix compiler warning rfkill.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 3e8b4b29132cd939646b851eaf1a5f8ebcaa8649 Author: Samuel Ortiz Date: Fri May 3 11:57:50 2013 +0200 Add NFC support rfkill.h is synced with the kernel header, man page is updated and RFKILL_TYPE_NFC is mapped to "nfc". rfkill.8 | 2 +- rfkill.c | 3 +++ rfkill.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) commit 7d7ccc0a2651136a6b9f56ef9331cf3eb07aaf3f Author: Johannes Berg Date: Sat Feb 6 15:33:26 2010 +0100 version 0.4 version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 79049d4a9a10d261cff74b22a199d5b25d49561d Author: Darren Salt Date: Mon Jan 25 22:33:31 2010 +0000 Add rfkill type "fm" to the man page. rfkill.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 47eaa8708a95298a6ed8b2ce147a2fd2eeb1eaac Author: Darren Salt Date: Mon Jan 25 22:33:30 2010 +0000 Help text: output rfkill type names from an array instead of a static string. rfkill.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit a9594ee92a095a5f27beed66c2c10fb910ad2dbd Author: Darren Salt Date: Mon Jan 25 22:57:02 2010 +0000 Tweak version handling to allow vendor-specific suffixes without patching. This overrides the "git describe" suffix for when the packaging is in git. Makefile | 4 ++++ version.sh | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) commit 726eb6422e81ba22a8bb9c5a20abcd2759ffa790 Author: Johannes Berg Date: Sat Jan 23 13:52:01 2010 +0100 change manpage for new rfkill list behaviour rfkill.8 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit a9405c24271ae03efece66d8811d778967918797 Author: Darren Salt Date: Fri Jan 22 23:35:30 2010 +0000 Add filtering to "rfkill list". rfkill.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) commit fafd91211afe7ce90ea1090b9c7651dc5e8bd498 Author: Darren Salt Date: Fri Jan 22 23:35:29 2010 +0000 Refactor rfkill index/type lookup: move it below rfkill_block. rfkill.c | 130 +++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 73 insertions(+), 57 deletions(-) commit d9cacf4d2abcf2f28acbf22ea296adfee904ed17 Author: Darren Salt Date: Fri Jan 22 23:35:28 2010 +0000 Return error codes instead of exiting. rfkill.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) commit be3cdf9393668bf6a26848eaddc3f893fe28b8d8 Author: Darren Salt Date: Fri Jan 22 23:35:27 2010 +0000 Constification. rfkill.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 0b84cefad9bceb8d548eb6ff88813e84b836d40f Author: Darren Salt Date: Fri Jan 22 23:35:26 2010 +0000 Rearrange the help text for block & unblock. rfkill.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 469ee2650c404576ed5efc8480f98a0e4164d212 Author: Darren Salt Date: Fri Jan 22 23:35:25 2010 +0000 Add "wlan" and "ultrawideband" as aliases for "wifi" and "uwb". I tend to think "wlan" rather than "wifi"; also, it fits in nicely with "wwan". Also, these aliases are what the kernel uses. rfkill.8 | 3 ++- rfkill.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) commit ce38452794791c71c8985b95f1c8fd1d6b19f222 Author: Tomas Winkler Date: Tue Jan 19 09:05:21 2010 +0200 update rfkill.h from kernel 2.6.33 1. add FM radio type 2. update rfkill_type docs Signed-off-by: Tomas Winkler rfkill.c | 3 +++ rfkill.h | 3 +++ 2 files changed, 6 insertions(+) commit 886e449d6286aa75c07a0f21dfb3d09d4fc1ea5d Author: Darren Salt Date: Fri Dec 4 17:04:39 2009 +0000 Move the man page to section 8 Makefile | 8 ++++---- rfkill.1 => rfkill.8 | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) commit 6217bea39d56404cebf09fe0084f867758d781ba Author: Johannes Berg Date: Thu Dec 3 14:28:03 2009 +0100 print time instead of useless text rfkill.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 1634aef27b2d72bae326c9401a1d37886d21cee3 Author: Johannes Berg Date: Thu Oct 29 13:57:27 2009 +0100 flush output after events suggested by Martin Dubuc who wants to log it to file rfkill.c | 1 + 1 file changed, 1 insertion(+) commit c0897372421e69266bb3339da66d7346ebdf6278 Author: John W. Linville Date: Tue Sep 29 13:41:37 2009 -0400 default install to $(PREFIX)/sbin The rfkill utility isn't generally useful to normal users, so move it to /sbin with other system management executables. Signed-off-by: John W. Linville Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 41669abb507ef2a0c782a6a1c0d0ca90c29f45a9 Author: Johannes Berg Date: Wed Sep 2 22:15:00 2009 +0200 version 0.3 license clarifications version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c67e71ffa1a453595963b74ba919c601a93d0c7b Author: Johannes Berg Date: Wed Sep 2 22:13:09 2009 +0200 resync rfkill.h with kernel The kernel rfkill.h got a new license thanks to all people involved with it -- we can now sync with it and clean up the little license mess here. The upstream (kernel) commit was: commit 8bc11b491b6cad75e737f1d38bb4b261bd95b291 Author: Johannes Berg Date: Wed Aug 26 18:13:17 2009 +0200 rfkill: relicense header file This header file is copied into userspace tools that need not be GPLv2 licensed, make that easier. Signed-off-by: Johannes Berg Acked-by: Alan Jenkins Acked-by: Henrique de Moraes Holschuh Acked-by: Iñaky Pérez-González Acked-by: Ivo van Doorn Acked-by: Jaswinder Singh Rajput Acked-by: Michael Buesch Acked-by: Tomas Winkler Signed-off-by: John W. Linville rfkill.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) commit bea11b7d48f25ba5517e10834e55d9bc03c6a632 Author: Johannes Berg Date: Wed Aug 26 19:51:32 2009 +0200 remove copyright notice from file should make it clear that COPYING is supposed to govern the entire source distribution rfkill.c | 2 -- 1 file changed, 2 deletions(-) commit 7999092b05fb0354d1b97b2ec58ecdf447e504f7 Author: Johannes Berg Date: Wed Aug 26 19:41:21 2009 +0200 add copyright notices COPYING | 4 ++++ 1 file changed, 4 insertions(+) commit 85309edf864ca804eeadc4c1dbe70ce4c1fe7cbf Author: Johannes Berg Date: Tue Aug 25 11:53:19 2009 +0200 version 0.2 version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 87d6ed52639007d200eeace220468dc0334492d2 Author: Johannes Berg Date: Tue Aug 25 11:52:29 2009 +0200 sync with kernel, add GPS The kernel added a GPS rfkill type, and also the event size. Sync with the kernel's header file and add support for GPS. core.h | 8 ------- rfkill.1 | 2 +- rfkill.c | 5 ++++- rfkill.h | 73 ++++++++++++++++++++++++++++++++++++++++++++-------------------- 4 files changed, 55 insertions(+), 33 deletions(-) commit b10e0a4a59501bcd7a4c5fdf670eaf21bbaa6d1a Author: Johannes Berg Date: Tue Aug 25 11:49:10 2009 +0200 add manpage Taken from http://tartarus.org/~ds/pkg/rfkill_0.1-4-g9429740-1.diff.gz Thanks Darren! .gitignore | 1 + Makefile | 8 ++++---- rfkill.1 | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) commit 942974036993a84d0beede0c1bbc19cdd3e9db40 Author: Johannes Berg Date: Thu Jul 23 19:11:21 2009 +0200 remove iteration and let the kernel do it rfkill.c | 82 ++++++++++++++++------------------------------------------------ 1 file changed, 20 insertions(+), 62 deletions(-) commit b1849b897f95c5229562f69dbcc93d58c939de78 Author: Tim Gardner Date: Thu Jul 23 10:53:47 2009 -0600 Added support for block/unblock wireless types. block/unblock now accepts an index as well as a wireless type, uncluding 'all'. Signed-off-by: Tim Gardner rfkill.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 8 deletions(-) commit 0d0256dadcb1506ef174d6f91aa197e33b3233f6 Author: Tim Gardner Date: Thu Jul 23 09:51:47 2009 -0600 Added rfkill_block_all() Utility function to block/unblock devices by type. Signed-off-by: Tim Gardner rfkill.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) commit 076e87a95dda27a613b5e11d6613412a8bec95b3 Author: Tim Gardner Date: Thu Jul 23 09:34:27 2009 -0600 Added a utility function to acquire a list of events. Construct a list of events for use by multiple functions, such as block/unblock for specific rfkill types. Signed-off-by: Tim Gardner rfkill.c | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) commit 2c3cbb3ae38dd6100ca03d7060b1a0704311d18b Author: Johannes Berg Date: Tue Jul 21 13:34:48 2009 +0200 bump version to 0.1 version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6e4e0b50005c68cd15dba0300c3fdf65503750fd Author: Johannes Berg Date: Sun Jul 5 14:37:40 2009 +0200 check event size for version 1 If we ever increase the event struct size, then we will need to handle multiple event sizes, so let's define the current event size and check for that so we remember to fix it up when (if ever) we need to change things. core.h | 10 ++++++++++ rfkill.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) commit 51da1093e715266a8bb6be4f881c8be654053da8 Author: Johannes Berg Date: Sun Jul 5 14:33:25 2009 +0200 use right event size for read() In order to be compatible with future size increases of the kernel's rfkill structure, userspace should only read as much as it expects -- the kernel will truncate the event read if necessary, which is the way we plan to have compatibility between different versions, should they ever be necessary. Thus, the userspace tool needs to use the exact event size for a read(). If the userspace tool is ever compiled with a newer kernel then it will need to be adjusted to work with older kernels, however. rfkill.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) commit 6980381c65cc758cb0d4bb472555735e041732e1 Author: Marcel Holtmann Date: Fri Jun 5 12:31:10 2009 +0200 open device read-only for list and event operations rfkill.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 80faa8f2020c8ba41b9da8b3a2acb3eead9a67f1 Author: Johannes Berg Date: Thu Jun 4 20:50:18 2009 +0200 comment out rfkill manpage install for now Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit cbcc49fb1ee981ef399615f5cf2d73376c34cea7 Author: Johannes Berg Date: Thu Jun 4 20:36:58 2009 +0200 add *~ to gitignore .gitignore | 1 + 1 file changed, 1 insertion(+) commit 4eac72be7cc9660fef995bdb156dd68b4f998f03 Author: Johannes Berg Date: Thu Jun 4 20:36:49 2009 +0200 add .gitignore .gitignore | 3 +++ 1 file changed, 3 insertions(+) commit 341b350314cd86edacef092c6ae06e8d28e59254 Author: Johannes Berg Date: Thu Jun 4 20:33:21 2009 +0200 version script "improvement" version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 07d517c0193ec137532650ed875798591c38d7d8 Author: Marcel Holtmann Date: Thu Jun 4 20:28:39 2009 +0200 implement basic rfkill functionality rfkill.c | 220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 214 insertions(+), 6 deletions(-) commit 87f7aab9acecf1e8e0f33182b8a8978587c2d985 Author: Marcel Holtmann Date: Thu Jun 4 20:28:37 2009 +0200 update to latest rfkill.h rfkill.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) commit 84c7585d810a136e839aaaad11de5030fc0ffa5f Author: Marcel Holtmann Date: Thu Jun 4 20:28:38 2009 +0200 fix wrong rfkill_version type core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d5fad6ebc22e9ecf76d97b18292424ef1df90907 Author: Johannes Berg Date: Thu May 28 11:39:20 2009 +0200 init rfkill basic code COPYING | 11 ++ Makefile | 58 ++++++++++ README | 12 +++ core.h | 6 ++ rfkill.c | 33 ++++++ rfkill.h | 358 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ version.sh | 23 ++++ 7 files changed, 501 insertions(+)