Changes between v2.28.2 and v2.29-rc1 -------------------------------------------- commit 37301faa01cd8fc2d4375b29c233c0f0f095409e Author: Karel Zak Date: Fri Sep 30 11:24:42 2016 +0200 build-sys: release++ (v2.29-rc1) Signed-off-by: Karel Zak NEWS | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) commit 66872edda51cbc29eaa361d7d61b19118f0863a2 Author: Karel Zak Date: Fri Sep 30 11:22:39 2016 +0200 docs: update v2.29-ReleaseNotes Signed-off-by: Karel Zak Documentation/releases/v2.29-ReleaseNotes | 485 ++++++++++++++++++++++++++++++ 1 file changed, 485 insertions(+) commit b86db3c7cff489b8ce4cf9fc58176a78a1797bdc Author: Karel Zak Date: Fri Sep 30 11:13:00 2016 +0200 docs: update AUTHORS file Signed-off-by: Karel Zak AUTHORS | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) commit 0d74f118cc5f5fa8d4beb02d5d607744576be5de Author: Karel Zak Date: Fri Sep 30 11:05:42 2016 +0200 po: merge changes Signed-off-by: Karel Zak po/ca.po | 533 ++++-- po/cs.po | 4794 +++++++++++++++++++++++++++---------------------- po/da.po | 512 ++++-- po/de.po | 4760 ++++++++++++++++++++++++++---------------------- po/es.po | 4770 ++++++++++++++++++++++++++---------------------- po/et.po | 535 ++++-- po/eu.po | 527 ++++-- po/fi.po | 530 ++++-- po/fr.po | 526 ++++-- po/gl.po | 532 ++++-- po/hr.po | 517 ++++-- po/hu.po | 532 ++++-- po/id.po | 531 ++++-- po/it.po | 534 ++++-- po/ja.po | 5187 ++++++++++++++++++++++++++--------------------------- po/nl.po | 4787 ++++++++++++++++++++++++++---------------------- po/pl.po | 4762 ++++++++++++++++++++++++++---------------------- po/pt_BR.po | 528 ++++-- po/ru.po | 508 ++++-- po/sl.po | 533 ++++-- po/sv.po | 4778 ++++++++++++++++++++++++++---------------------- po/tr.po | 533 ++++-- po/uk.po | 511 ++++-- po/util-linux.pot | 498 +++-- po/vi.po | 523 ++++-- po/zh_CN.po | 517 ++++-- po/zh_TW.po | 527 ++++-- 27 files changed, 25270 insertions(+), 19055 deletions(-) commit 82053f5e3d4cedcbe6fc61ee1e5e39d0db8a0f8f Author: Karel Zak Date: Fri Sep 30 11:01:41 2016 +0200 libsmartcols: add scols_column_add_width() Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 1 + libsmartcols/src/column.c | 19 +++++++++++++++++++ libsmartcols/src/libsmartcols.h.in | 2 ++ libsmartcols/src/libsmartcols.sym | 1 + 4 files changed, 23 insertions(+) commit 9abc8232404a20c61f02c2b16f864ddec18e42e8 Author: Sebastian Rasmussen Date: Fri Sep 30 10:34:15 2016 +0200 po: update sv.po (from translationproject.org) po/sv.po | 10946 +++++++++++++++++++++++++++++-------------------------------- 1 file changed, 5137 insertions(+), 5809 deletions(-) commit 7752451c25d57ec1e087dc44910899ca8520f5bc Author: Jakub Bogusz Date: Fri Sep 30 10:34:15 2016 +0200 po: update pl.po (from translationproject.org) po/pl.po | 4285 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 2027 insertions(+), 2258 deletions(-) commit c9ef4c05a9d3dcb20c9adee688eca511b9f89a87 Author: Benno Schulenberg Date: Fri Sep 30 10:34:15 2016 +0200 po: update nl.po (from translationproject.org) po/nl.po | 4577 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 2159 insertions(+), 2418 deletions(-) commit 91420f055a68bb8237ddf5d79bd2f393c65a94e1 Author: Takeshi Hamasaki Date: Fri Sep 30 10:34:15 2016 +0200 po: update ja.po (from translationproject.org) po/ja.po | 4731 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 2466 insertions(+), 2265 deletions(-) commit 09cac2b971c7f59825ef356f470e9c4736ddada4 Author: Antonio Ceballos Roa Date: Fri Sep 30 10:34:15 2016 +0200 po: update es.po (from translationproject.org) po/es.po | 4289 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 2030 insertions(+), 2259 deletions(-) commit 452c0f04fb91510a479e44161d22b22bc099db37 Author: Philipp Thomas Date: Fri Sep 30 10:34:15 2016 +0200 po: update de.po (from translationproject.org) po/de.po | 4286 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 2027 insertions(+), 2259 deletions(-) commit 01207d0f92619dbb59316d81fb240593cf897095 Author: Petr Písař Date: Fri Sep 30 10:34:15 2016 +0200 po: update cs.po (from translationproject.org) po/cs.po | 4292 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 2033 insertions(+), 2259 deletions(-) commit 32553147212b613e5248526ab4b9268fa5279a69 Author: Karel Zak Date: Fri Sep 30 10:30:07 2016 +0200 findmnt: remove duplicate include Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 1 - 1 file changed, 1 deletion(-) commit c9a11fe892f20a9973a90f6bbe66b1c64b9369c9 Author: Karel Zak Date: Fri Sep 30 10:29:00 2016 +0200 tests: update build-sys tests Signed-off-by: Karel Zak tests/expected/build-sys/config-all | 4 ++-- tests/expected/build-sys/config-all-non-nls | 4 ++-- tests/expected/build-sys/config-audit | 5 ++--- tests/expected/build-sys/config-chfnsh-libuser | 5 ++--- tests/expected/build-sys/config-chfnsh-no-password | 5 ++--- tests/expected/build-sys/config-chfnsh-pam | 5 ++--- tests/expected/build-sys/config-core | 5 ++--- tests/expected/build-sys/config-devel | 4 ++-- tests/expected/build-sys/config-devel-non-docs | 4 ++-- tests/expected/build-sys/config-non-libblkid | 5 ++--- tests/expected/build-sys/config-non-libmount | 5 ++--- tests/expected/build-sys/config-non-libs | 5 ++--- tests/expected/build-sys/config-non-libsmartcols | 5 ++--- tests/expected/build-sys/config-non-libuuid | 5 ++--- tests/expected/build-sys/config-non-nls | 5 ++--- tests/expected/build-sys/config-selinux | 5 ++--- tests/expected/build-sys/config-slang | 5 ++--- tests/expected/build-sys/config-static | 5 ++--- 18 files changed, 36 insertions(+), 50 deletions(-) commit 8e4925016875c6a4f2ab4f833ba66f0fc57396a2 Author: Karel Zak Date: Thu Sep 29 16:32:33 2016 +0200 su,runuser: add libseccomp based workaround for TIOCSTI ioctl This patch add libseccomp based syscalls filter to disable TIOCSTI ioctl in su/runuser children. IMHO it is not elegant solution due to dependence on libseccomp (--without-seccomp if hate it)... but there is nothing better for now. Addresses: CVE-2016-2779 Signed-off-by: Karel Zak configure.ac | 16 ++++++++++++++++ login-utils/Makemodule.am | 7 ++++--- login-utils/su-common.c | 20 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) commit a0a8e9884443601abf9f06b715f2f6bb0820cbad Author: Stanislav Brabec Date: Wed Mar 2 20:35:54 2016 +0100 tests: Add helper for TIOCSTI exploit This helper/exploit injects "id -u -n\n" to the vulnerable calling terminal. Use id -u -n to get a reproducible output of test cases based on it. What can happen: Nothing, no exploit: pty is not accessible, sedsid() disconnected the task from pty, TIOCSTI failed. The command is injected to the unprivileged environment pty, and you see e. g. "nobody": This is acceptable. The command is injected to the caller (privileged) pty, and you see "root" (or caller uid name): This is not acceptable and has security implications. References: CVE-2016-2779 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2779 http://seclists.org/oss-sec/2016/q1/448 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815922 https://bugzilla.redhat.com/show_bug.cgi?id=173008 https://bugzilla.suse.com/show_bug.cgi?id=968674 https://bugzilla.suse.com/show_bug.cgi?id=968675 CVE-2016-2781 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2781 http://seclists.org/oss-sec/2016/q1/452 Signed-off-by: Stanislav Brabec Cc: Federico Bento tests/commands.sh | 2 ++ tests/helpers/Makemodule.am | 3 +++ tests/helpers/test_tiocsti.c | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) commit 3e44e75dae38cce3423cf5270c5edfd1079ca438 Author: Karel Zak Date: Thu Sep 29 11:55:07 2016 +0200 libmount: paranoid change in mnt_table_is_fs_mounted() Signed-off-by: Karel Zak libmount/src/tab.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 76d4fba2e47808264f5c4c883127b0d275e31949 Author: Aurelien Aptel Date: Thu Sep 1 13:57:42 2016 +0200 libmount: fix mount -a for cifs when mounting a cifs share, the src is actually an UNC path which can in in several forms: simple: //host/share, //host/share/ including subpath: //host/share/sub/path to check if the cifs fs is mounted we have to extract the subpath and compare *that* to the root. Signed-off-by: Aurelien Aptel libmount/src/tab.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) commit f20b214edc6e0c422a9a8991929fb793ee543dda Author: Tobias Stoeckmann Date: Thu Sep 8 21:19:22 2016 +0200 ul: Fix buffer overflow The text-utility ul can run into a buffer overflow on very long lines. See this proof of concept how to reproduce the issue: $ dd if=/dev/zero bs=1M count=10 | tr '\000' '\041' > poc.txt $ echo -ne '\xe\x5f\x8\x5f\x61\x2\xf\x5f\x8\x5f' | dd of=poc.txt conv=notrunc $ ul -i poc.txt > /dev/null # output would take ages Segmentation fault $ _ The problem manifests by using alloca with "maxcol", which can be as large as INT_MAX, based on the input line. A very long line (> 8 MB) with modes must be supplied to ul, as seen in my proof of concept byte sequence above. It is rather easy to fix this issue: allocate space on the heap instead. maxcol could overflow here, but in that case no system will have enough space to handle the request, properly ending ul through an err() call. Signed-off-by: Tobias Stoeckmann text-utils/ul.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) commit 0b404f0845fe97f84e45f9b7b23e9e1814d3ef4e Author: Sami Kerola Date: Sun Sep 4 11:15:34 2016 +0100 lib/strutils: make left and right trims more robust Do not follow null pointer, and stop going any further when ltrim_whitespace() is at the end of a string. Signed-off-by: Sami Kerola include/strutils.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 68a7f92b94431b28aa345ab30214c3490dcc10bd Author: Karel Zak Date: Tue Sep 27 14:16:18 2016 +0200 libsmartcols: custom wrap fixes Reported-by: Igor Gnatenko libsmartcols/src/column.c | 10 ++++------ libsmartcols/src/libsmartcols.h.in | 2 +- libsmartcols/src/smartcolsP.h | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) commit 81b176c4da088c483c2cd4dea6f2e3e34a37f2be Author: Karel Zak Date: Tue Sep 27 12:52:47 2016 +0200 docs: some random fixes Signed-off-by: Karel Zak libfdisk/docs/libfdisk-docs.xml | 2 ++ libfdisk/src/gpt.c | 18 +++++++++--------- libfdisk/src/item.c | 22 +++++++++++----------- libmount/docs/libmount-docs.xml | 4 ++++ libmount/docs/libmount-sections.txt | 1 + libmount/src/fs.c | 1 + libmount/src/libmount.h.in | 4 ++-- libsmartcols/docs/libsmartcols-sections.txt | 14 +++++++------- libsmartcols/src/column.c | 8 +++++--- libsmartcols/src/libsmartcols.h.in | 2 +- 10 files changed, 43 insertions(+), 33 deletions(-) commit be163aa0da2a7dc0472947554ecd4d3690086de8 Author: Karel Zak Date: Tue Sep 27 11:58:32 2016 +0200 libfdisk: (docs) add missing version notes Signed-off-by: Karel Zak libfdisk/docs/libfdisk-docs.xml | 4 ++++ libfdisk/src/item.c | 5 +++-- libfdisk/src/partition.c | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) commit 3f47320a17735fbb33f7d84767045863c8d4987a Author: Karel Zak Date: Tue Sep 27 11:35:43 2016 +0200 libsmartcols: (docs) add missing version notes Signed-off-by: Karel Zak libsmartcols/src/column.c | 10 ++++++++++ libsmartcols/src/libsmartcols.sym | 1 - libsmartcols/src/table.c | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) commit 618a1d6dbe9055382f7f37c222e8456e6841dc8b Author: Igor Gnatenko Date: Fri Sep 23 16:05:02 2016 +0200 libsmartcols: fixes in doc generation * Add 2.29 symbols index * Sync argument names between header and implementation Signed-off-by: Igor Gnatenko libsmartcols/docs/libsmartcols-docs.xml | 6 +++++- libsmartcols/src/cell.c | 26 +++++++++++++------------- libsmartcols/src/column.c | 12 ++++++------ libsmartcols/src/libsmartcols.h.in | 4 ++-- libsmartcols/src/line.c | 12 ++++++------ libsmartcols/src/table.c | 6 +++--- 6 files changed, 35 insertions(+), 31 deletions(-) commit 949ea05f1af647834db24b9172ac006488d2e4f4 Author: Karel Zak Date: Mon Sep 26 11:20:07 2016 +0200 libsmartcols: support custom wrap and remove SCOLS_FL_WRAPNL This new API provides full control on multi-line cells, you can wrap text by new lines (build-in support) or by another way (after words, commas, etc.) Changes: * new scols_column_set_wrapfunc() sets pointers to two callback functions 1/ chunksize() - returns largest data chunk size; used when we calculate columns width 2/ nextchunk() - terminate the current chunk and returns pointer to the next; used when we print data * remove SCOLS_FL_WRAPNL and add new functions scols_wrapnl_chunksize() and scols_wrapnl_nextchunk() to provide build-in functionality to wrap cells on \n * remove scols_column_is_wrapnl() add scols_column_is_customwrap() (returns true if custom wrap functions are defined) * add scols_column_set_safechars() and scols_column_get_safechars() to allow to control output encoding, safe chars are not encoded by \xFOO * modify "fromfile" test code to use build-in scols_wrapnl_* callbacks for "wrapnl" tests * add new function scols_column_get_table() Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 8 +- libsmartcols/samples/fromfile.c | 9 +- libsmartcols/src/column.c | 146 +++++++++++++++++++++++++++- libsmartcols/src/libsmartcols.h.in | 19 +++- libsmartcols/src/libsmartcols.sym | 14 ++- libsmartcols/src/smartcolsP.h | 8 ++ libsmartcols/src/table_print.c | 62 ++++-------- 7 files changed, 208 insertions(+), 58 deletions(-) commit 0d71eb9c4bed2949fd09759e8eb0071702eaa1e7 Author: Karel Zak Date: Fri Sep 23 14:31:06 2016 +0200 libsmartcols: (docs) add missing functions Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 3 +++ 1 file changed, 3 insertions(+) commit a3b91e82f269f4663d36b7878d0c430621415080 Merge: 63168cf 43e06c6 Author: Karel Zak Date: Fri Sep 23 14:25:37 2016 +0200 Merge branch 'getters' of https://github.com/ignatenkobrain/util-linux * 'getters' of https://github.com/ignatenkobrain/util-linux: libsmartcols: add scols_table_is_nolinesep() libsmartcols: add scols_table_is_nowrap() libsmartcols: add scols_table_get_name() commit 43e06c67f9a03114fa616a529faee6ed8eb26e97 Author: Igor Gnatenko Date: Fri Sep 23 14:21:15 2016 +0200 libsmartcols: add scols_table_is_nolinesep() And save 1 or 0 into tb->no_linesep instead of any value. Signed-off-by: Igor Gnatenko libsmartcols/src/libsmartcols.h.in | 1 + libsmartcols/src/libsmartcols.sym | 1 + libsmartcols/src/table.c | 17 +++++++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) commit 8427c2ec9c2f240ba2198883d10b4757b0c425c5 Author: Igor Gnatenko Date: Fri Sep 23 14:20:41 2016 +0200 libsmartcols: add scols_table_is_nowrap() Signed-off-by: Igor Gnatenko libsmartcols/src/libsmartcols.h.in | 1 + libsmartcols/src/libsmartcols.sym | 1 + libsmartcols/src/table.c | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) commit 63168cf9b5172c3cccd4bd5541d0e186c798bf9b Author: Karel Zak Date: Fri Sep 23 14:20:24 2016 +0200 libsmartcols: cleanup scols_table_set_symbols() API Change behavior: * scols_table_set_symbols(tb, NULL) remove reference to the current symbols setting and does not set default symbols at all Add new functions: * scols_table_get_symbols() * scols_table_set_default_symbols() 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 | 96 +++++++++++++++++++++-------- libsmartcols/src/table_print.c | 34 +++++++--- 6 files changed, 103 insertions(+), 34 deletions(-) commit 96960717375978e9a30ddc882c53ff1adf85b26d Author: Igor Gnatenko Date: Fri Sep 23 14:09:43 2016 +0200 libsmartcols: add scols_table_get_name() Currently we have scols_table_set_name() but don't have getter for it. Signed-off-by: Igor Gnatenko libsmartcols/src/libsmartcols.h.in | 1 + libsmartcols/src/libsmartcols.sym | 1 + libsmartcols/src/table.c | 13 +++++++++++++ 3 files changed, 15 insertions(+) commit 302419e8da819f7ab4c6c5773b412ea939117291 Author: Karel Zak Date: Fri Sep 23 13:20:49 2016 +0200 findmnt: (verify) add docs Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 2 +- misc-utils/findmnt.8 | 10 ++++++++++ sys-utils/mount.8 | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) commit a766fafef39ab1e3ca9c72fb18401b49fe440618 Author: Karel Zak Date: Thu Sep 22 13:46:05 2016 +0200 findmnt: (verify) minor changes in strings Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 5f1608e068d5987df1f305c514500e2e12e6960c Author: Karel Zak Date: Thu Sep 22 13:40:24 2016 +0200 findmnt: (verify) check filesystem type Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 198 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) commit a1c95432f8e73fee9b08f9869a89f219cf2d66f8 Author: Karel Zak Date: Wed Sep 21 15:08:24 2016 +0200 findmnt: (verify) add swaparea verification Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) commit 67260dc4680f3b72c3a4cbd8d0ccb3ac38f60711 Author: Karel Zak Date: Wed Sep 21 14:32:47 2016 +0200 findmnt: (verify) add options verification Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) commit 169b4a8cd5608e87bb5f8bf2a51c02ab3a6a80b5 Author: Karel Zak Date: Wed Sep 21 14:15:49 2016 +0200 findmnt: (verify) add source verification Signed-off-by: Karel Zak configure.ac | 1 + misc-utils/Makemodule.am | 10 ++++-- misc-utils/findmnt-verify.c | 83 +++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 86 insertions(+), 8 deletions(-) commit c768892f4c2c33e52e5e898ee8b552ece4dd5224 Author: Karel Zak Date: Tue Sep 20 15:45:15 2016 +0200 findmnt: add --verify and --verbose Signed-off-by: Karel Zak misc-utils/Makemodule.am | 4 +- misc-utils/findmnt-verify.c | 201 ++++++++++++++++++++++++++++++++++++++++++++ misc-utils/findmnt.c | 81 +++++++++--------- misc-utils/findmnt.h | 39 +++++++++ sys-utils/fstab.5 | 2 +- 5 files changed, 284 insertions(+), 43 deletions(-) commit e0140aa138bd0d84d24870044a458ef3a98d6a3a Author: Igor Gnatenko Date: Fri Sep 23 11:24:28 2016 +0200 libsmartcols: use const qualifier for scols_table_get_termwidth Signed-off-by: Igor Gnatenko libsmartcols/src/libsmartcols.h.in | 2 +- libsmartcols/src/table.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 266eecd54e6b99e851272b63d7ad12a6817e3797 Merge: 54d98cf f7a9ea2 Author: Karel Zak Date: Fri Sep 23 11:14:15 2016 +0200 Merge branch 'api_const' of https://github.com/ignatenkobrain/util-linux * 'api_const' of https://github.com/ignatenkobrain/util-linux: libsmartcols: use const qualifier where it's possible debug: use const void * for ul_debugobj() libsmartcols: make get_line/column_separator() return const commit 54d98cf8e8babaf4fbb0fa972af317d5e4e2aca4 Merge: 02aaba6 2889fb2 Author: Karel Zak Date: Fri Sep 23 11:07:15 2016 +0200 Merge branch 'master' of https://github.com/ignatenkobrain/util-linux commit 02aaba6f9f4e20bd259655694eee58a435dae769 Author: Karel Zak Date: Thu Sep 22 13:47:23 2016 +0200 libsmartcols: keep scols_table_get_termwidth() read-only Addresses: https://github.com/karelzak/util-linux/issues/356 Signed-off-by: Karel Zak libsmartcols/src/table.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 07332bfa1ec122a251194a62f91319841121d5aa Author: Karel Zak Date: Wed Sep 21 14:47:32 2016 +0200 swapon: fix discard option parsing The current code does not work as expected if there is an option behind the discard=, for example: swapon /dev/sdc -o discard=once,pri=10 ignores "once" the result is SWAP_FLAG_DISCARD; strace: Old version: swapon("/dev/sdc", SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|10) = 0 Fixed version: swapon("/dev/sdc", SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|SWAP_FLAG_DISCARD_ONCE|10) = 0 Signed-off-by: Karel Zak sys-utils/swapon.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit f7a9ea28eff5c71b6fd07b49b16d14bdecaeb4f0 Author: Igor Gnatenko Date: Wed Sep 21 08:30:48 2016 +0200 libsmartcols: use const qualifier where it's possible Closes: https://github.com/karelzak/util-linux/issues/355 Signed-off-by: Igor Gnatenko libsmartcols/src/column.c | 22 +++++++------- libsmartcols/src/iter.c | 2 +- libsmartcols/src/libsmartcols.h.in | 62 +++++++++++++++++++------------------- libsmartcols/src/line.c | 9 +++--- libsmartcols/src/smartcolsP.h | 2 +- libsmartcols/src/symbols.c | 1 - libsmartcols/src/table.c | 38 +++++++++++------------ 7 files changed, 65 insertions(+), 71 deletions(-) commit 0e0943c15b173015c3ff9475085bd064204f9c74 Author: Igor Gnatenko Date: Wed Sep 21 08:22:35 2016 +0200 debug: use const void * for ul_debugobj() We don't modify data it's pointing out and we should not modify it. Also remove casting to void * as gcc will do it automatically (before we had to cast it explicitly to avoid warning on discarding 'const' qualifier). Signed-off-by: Igor Gnatenko include/debug.h | 2 +- libfdisk/src/parttype.c | 4 ++-- libsmartcols/src/cell.c | 2 +- libsmartcols/src/column.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) commit 6f9377ab8159bf52e52ec41c32fbfd47401a254e Author: Igor Gnatenko Date: Wed Sep 21 07:25:23 2016 +0200 libsmartcols: make get_line/column_separator() return const The patch introduces tiny API changes (char * -> const char *) for scols_table_get_line_separator scols_table_get_column_separator Signed-off-by: Igor Gnatenko libsmartcols/src/libsmartcols.h.in | 4 ++-- libsmartcols/src/table.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) commit 2889fb2da9775b553e213bef4987081fcb36b3a0 Author: Igor Gnatenko Date: Tue Sep 20 15:36:55 2016 +0200 trivial: use tabs consistently Signed-off-by: Igor Gnatenko tests/ts/libsmartcols/fromfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8f0c12f1c9d28e5399a1479db1f20e4295854303 Merge: ffd1325 4fb899e Author: Karel Zak Date: Mon Sep 19 14:21:18 2016 +0200 Merge branch 'hotfix' of https://github.com/ignatenkobrain/util-linux commit ffd1325ddd964f20e5ac3c3b6a3d4e3ce68be847 Merge: 4e91ebc bfc6941 Author: Karel Zak Date: Mon Sep 19 14:20:37 2016 +0200 Merge branch 'typos' of https://github.com/ignatenkobrain/util-linux * 'typos' of https://github.com/ignatenkobrain/util-linux: libsmartcols: fix typos in docs commit 4fb899ed7731fc84a81fab86203a43d1ee89bece Author: Igor Gnatenko Date: Sat Sep 17 18:55:52 2016 +0200 libsmartcols: be consistent, use 'sy' for symbols Signed-off-by: Igor Gnatenko libsmartcols/src/libsmartcols.h.in | 12 ++++----- libsmartcols/src/symbols.c | 50 +++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 31 deletions(-) commit bfc6941ae764dc5305add287463d06692cc94e8d Author: Igor Gnatenko Date: Sun Sep 18 11:47:13 2016 +0200 libsmartcols: fix typos in docs Signed-off-by: Igor Gnatenko libsmartcols/src/column.c | 2 +- libsmartcols/src/line.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) commit 4e91ebca3e237fb0e7b3aae05505f4ce3b52146a Author: Karel Zak Date: Mon Sep 19 14:07:38 2016 +0200 libsmartcols: be more strict about empty tables and don't print extra \n for empty table. Signed-off-by: Karel Zak libsmartcols/src/table.c | 2 +- libsmartcols/src/table_print.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) commit 166897ceb3578e3a90ab49d2c251b66cb060f28d Author: Karel Zak Date: Mon Sep 19 13:48:42 2016 +0200 libsmartcols: fix comment Signed-off-by: Karel Zak libsmartcols/src/line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d4275a4bde84c9c295859131cd661f165362f9e3 Author: Karel Zak Date: Mon Sep 19 13:39:03 2016 +0200 libsmartcols: cleanup get functions The patch introduces tiny API changes (int -> size_t) for scols_table_get_ncols scols_table_get_nlines Addresses: https://github.com/karelzak/util-linux/issues/349 Signed-off-by: Karel Zak libsmartcols/src/cell.c | 8 +++--- libsmartcols/src/column.c | 59 +++++++++++++------------------------- libsmartcols/src/libsmartcols.h.in | 4 +-- libsmartcols/src/line.c | 11 ++++--- libsmartcols/src/table.c | 37 +++++++++++------------- 5 files changed, 47 insertions(+), 72 deletions(-) commit 695fd479be6796fdad5b79c0ecbd22e25cee750b Author: Karel Zak Date: Fri Sep 16 14:18:01 2016 +0200 tests: add columns separator to libsmartcols test Signed-off-by: Karel Zak libsmartcols/samples/fromfile.c | 9 ++++++-- .../libsmartcols/fromfile-column-separator | 11 +++++++++ tests/ts/libsmartcols/fromfile | 27 +++++++++++++++------- 3 files changed, 37 insertions(+), 10 deletions(-) commit 4a2b50f2384f8fb6cec941c1483d1c60003671ee Author: Karel Zak Date: Fri Sep 16 13:49:37 2016 +0200 tests: add export and raw to libsmartcols test Signed-off-by: Karel Zak libsmartcols/samples/fromfile.c | 23 +++++++++++++++++++++-- tests/expected/libsmartcols/fromfile-export | 10 ++++++++++ tests/expected/libsmartcols/fromfile-raw | 11 +++++++++++ tests/ts/libsmartcols/fromfile | 22 ++++++++++++++++++++++ 4 files changed, 64 insertions(+), 2 deletions(-) commit 0c3e7a013149a056866817c6d17aa605253b42d2 Author: Karel Zak Date: Fri Sep 16 13:37:08 2016 +0200 tests: add libsmartcols JSON test Signed-off-by: Karel Zak tests/expected/libsmartcols/fromfile-tree-end | 11 ++++++ tests/expected/libsmartcols/fromfile-tree-json | 29 +++++++++++++++ tests/expected/libsmartcols/fromfile-tree-middle | 11 ++++++ tests/ts/libsmartcols/fromfile | 45 ++++++++++++++++++++++++ 4 files changed, 96 insertions(+) commit 6a82714dbfa7b3a73b972e015e6ca3d91514eddb Author: Karel Zak Date: Fri Sep 16 13:30:29 2016 +0200 libsmartcols: add JSON support to sample application Signed-off-by: Karel Zak libsmartcols/samples/fromfile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 65f3ebc334f71846feb2536df570102ad26febff Author: Karel Zak Date: Fri Sep 16 13:22:47 2016 +0200 libsmartcols: improve JSON Signed-off-by: Karel Zak libsmartcols/src/table.c | 2 +- libsmartcols/src/table_print.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) commit 346e3a40a0dd8ff543a3c3daf32d47783e8dc7a9 Author: Karel Zak Date: Fri Sep 16 13:00:47 2016 +0200 libsmartcols: cleanup line separator usage * use line separator only to separate lines, not after last line * explicitly print \n after table in scols_print_table() * don't terminate table by \n or line separator in scols_print_table_to_string() Note that the patch is little bit trick due to impact to the trees printing. Now print_tree_line() should be more readable. Signed-off-by: Karel Zak libsmartcols/src/table.c | 2 +- libsmartcols/src/table_print.c | 83 ++++++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 36 deletions(-) commit 73bcb64f1abe9aa26953152aed500a4d349987b5 Author: Karel Zak Date: Thu Sep 15 12:32:58 2016 +0200 tests: add libsmartcols wrap and wrapnl tree tests Signed-off-by: Karel Zak tests/expected/libsmartcols/fromfile-wrap-tree | 18 ++++++++++++++ tests/expected/libsmartcols/fromfile-wrapnl-tree | 19 +++++++++++++++ tests/ts/libsmartcols/fromfile | 30 ++++++++++++++++++++++++ 3 files changed, 67 insertions(+) commit 63a79e75ecd2023e999c010ec6dbe49f057b1b45 Author: Karel Zak Date: Thu Sep 15 12:25:08 2016 +0200 tests: add tree libsmartcols test files Signed-off-by: Karel Zak tests/expected/libsmartcols/fromfile-tree | 11 +++++++++++ tests/ts/libsmartcols/files/col-id | 3 +++ tests/ts/libsmartcols/files/col-parent | 3 +++ tests/ts/libsmartcols/files/col-tree | 3 +++ tests/ts/libsmartcols/files/data-id | 10 ++++++++++ tests/ts/libsmartcols/files/data-parent | 10 ++++++++++ 6 files changed, 40 insertions(+) commit 9aca40bbec08a15e71c56d33e7d78e6f7063ae6e Author: Karel Zak Date: Thu Sep 15 12:22:12 2016 +0200 libsmartcols: fix tree padding We cannot use cell-padding char with in tree ASCII art, because tree uses two chars rather than one. Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 18ff51547d8dec7e37c034c5f9b6cb529470069e Author: Karel Zak Date: Thu Sep 15 12:12:18 2016 +0200 libsmartcols: add support for trees to the sample application Signed-off-by: Karel Zak libsmartcols/samples/fromfile.c | 81 +++++++++++++++++++++++++++++++++++++++-- tests/ts/libsmartcols/fromfile | 16 +++++++- 2 files changed, 92 insertions(+), 5 deletions(-) commit 54c6de3d04f2740cd2d7a6b665677105f722174e Merge: 937e045 8e7d9d2 Author: Karel Zak Date: Thu Sep 15 10:05:15 2016 +0200 Merge branch 'patch-1' of https://github.com/ignatenkobrain/util-linux commit 8e7d9d231e231ffc28078b23afe45f9a06d4515f Author: Igor Gnatenko Date: Wed Sep 14 19:36:51 2016 +0200 trivial: s/automatical/automatic/g "Automatical" is archaic form of "automatic". Signed-off-by: Igor Gnatenko libsmartcols/src/table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 937e0458554e20577019da0a033801a53e60eba1 Author: Igor Gnatenko Date: Tue Sep 13 15:06:49 2016 +0200 smartcols/symbols: free cell_padding in unref() Signed-off-by: Igor Gnatenko libsmartcols/src/symbols.c | 1 + 1 file changed, 1 insertion(+) commit 280fe9c901cc3474ae8fa78b9555bbdd03dab661 Author: Karel Zak Date: Wed Sep 14 17:02:54 2016 +0200 tests: add missing expected/ dir stuff Signed-off-by: Karel Zak tests/expected/libsmartcols/fromfile-hidden | 11 +++++++++++ tests/expected/libsmartcols/fromfile-noextremes | 12 ++++++++++++ tests/expected/libsmartcols/fromfile-strictwidth | 11 +++++++++++ tests/expected/libsmartcols/fromfile-trunc | 11 +++++++++++ tests/expected/libsmartcols/fromfile-wrap | 17 +++++++++++++++++ 5 files changed, 62 insertions(+) commit 36eb51ebb420e88b3147b652d08c21728d5c4f87 Author: Karel Zak Date: Wed Sep 14 12:49:46 2016 +0200 tests: add libsmartcols title test Signed-off-by: Karel Zak libsmartcols/samples/Makemodule.am | 2 +- libsmartcols/samples/fromfile.c | 2 -- libsmartcols/samples/title.c | 19 +++++++++++++++++++ tests/commands.sh | 1 + tests/expected/libsmartcols/title | 12 ++++++++++++ tests/ts/libsmartcols/title | 28 ++++++++++++++++++++++++++++ 6 files changed, 61 insertions(+), 3 deletions(-) commit 8fe4724568bf174032454689b6512d116d69a97d Author: Karel Zak Date: Wed Sep 14 12:38:34 2016 +0200 tests: add another libsmartcols tests Signed-off-by: Karel Zak tests/ts/libsmartcols/files/col-hidden | 3 ++ tests/ts/libsmartcols/files/col-noextremes | 3 ++ tests/ts/libsmartcols/files/col-number | 2 +- tests/ts/libsmartcols/files/col-strict | 3 ++ tests/ts/libsmartcols/files/col-trunc | 3 ++ tests/ts/libsmartcols/files/data-number-tiny | 10 +++++ tests/ts/libsmartcols/files/data-string-extreme | 10 +++++ tests/ts/libsmartcols/fromfile | 59 +++++++++++++++++++++++++ 8 files changed, 92 insertions(+), 1 deletion(-) commit fdf72798490df282e0c6b851c306bd792e370ab9 Author: Karel Zak Date: Wed Sep 14 12:37:53 2016 +0200 libsmartcols: fix hidden file usage Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 45 +++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 14 deletions(-) commit 6db10580caf941e785dc3471d87c9e4ee0df788f Author: Karel Zak Date: Tue Sep 13 16:50:10 2016 +0200 build-sys: remove dead libsmartcols sample Signed-off-by: Karel Zak libsmartcols/samples/Makemodule.am | 5 ----- 1 file changed, 5 deletions(-) commit a414a1709387298c633d0f549bde5d0459b43a31 Author: Karel Zak Date: Tue Sep 13 14:12:11 2016 +0200 tests: improve libsmartcols test Signed-off-by: Karel Zak libsmartcols/samples/fromfile.c | 7 ++++++- tests/expected/libsmartcols/fromfile-right-maxout | 11 +++++++++++ tests/ts/libsmartcols/fromfile | 9 +++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) commit 19055a25ed2a28d005460ee41627d2595ae7ad34 Author: Karel Zak Date: Tue Sep 13 14:06:01 2016 +0200 libsmartcols: add functions to control terminal usage Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 8 +++- libsmartcols/src/libsmartcols.h.in | 14 +++++++ libsmartcols/src/libsmartcols.sym | 4 ++ libsmartcols/src/smartcolsP.h | 1 + libsmartcols/src/table.c | 59 +++++++++++++++++++++++++++++ libsmartcols/src/table_print.c | 16 +++++--- 6 files changed, 94 insertions(+), 8 deletions(-) commit fa4691833a2758ee3defc31645a502c117624369 Author: Karel Zak Date: Tue Sep 13 13:08:02 2016 +0200 libsmartcols: add application to test library features Signed-off-by: Karel Zak libsmartcols/samples/Makemodule.am | 5 + libsmartcols/samples/fromfile.c | 225 +++++++++++++++++++++++++++ libsmartcols/samples/wrapnl.c | 141 ----------------- tests/commands.sh | 1 + tests/expected/libsmartcols/fromfile | 1 + tests/expected/libsmartcols/fromfile-right | 11 ++ tests/expected/libsmartcols/fromfile-wrapnl | 19 +++ tests/ts/libsmartcols/files/col-name | 3 + tests/ts/libsmartcols/files/col-number | 3 + tests/ts/libsmartcols/files/col-string | 3 + tests/ts/libsmartcols/files/col-wrap | 3 + tests/ts/libsmartcols/files/col-wrapnl | 3 + tests/ts/libsmartcols/files/data-number | 10 ++ tests/ts/libsmartcols/files/data-string | 10 ++ tests/ts/libsmartcols/files/data-string-long | 10 ++ tests/ts/libsmartcols/files/data-string-nl | 10 ++ tests/ts/libsmartcols/fromfile | 50 ++++++ 17 files changed, 367 insertions(+), 141 deletions(-) commit ef4a34bbb82804dd454a2b443d6a7b73dafedec0 Author: Karel Zak Date: Mon Sep 12 16:12:22 2016 +0200 libsmartcols: fix WRAPNL on strings without \n Addresses: https://github.com/karelzak/util-linux/issues/343 Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 975ed32fd93503aa109e231ec26a582cb0398dd8 Author: Karel Zak Date: Mon Sep 12 11:58:34 2016 +0200 libsmartcols: fix WRAPNL crashes Addresses: https://github.com/karelzak/util-linux/issues/344 Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fa177917209e54ec90a52c6475330b97be82a320 Author: Karel Zak Date: Thu Sep 8 11:57:34 2016 +0200 mount: add note about another flags for "remount,bind" The man page is talking about read-only bind mounts (-o remount,bind,ro), but this feature also works for another VFS flags like nodev, suid, etc. For example: mount -o remount,bind,noatime /mountpoint is a valid command. Addresses: https://github.com/karelzak/util-linux/issues/342 Signed-off-by: Karel Zak sys-utils/mount.8 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 37948503c995d2986e95819f6f5b2c3037dbc23d Author: Karel Zak Date: Wed Sep 7 12:25:06 2016 +0200 libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=on This env.variable forces libsmartcols to use visible padding chars. The standard debug has to be enabled (to minimize overhead for non-debug execution). For example: $ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log Signed-off-by: Karel Zak disk-utils/cfdisk.8 | 2 ++ disk-utils/fdisk.8 | 2 ++ libsmartcols/src/smartcolsP.h | 1 + libsmartcols/src/table.c | 16 ++++++++++++++++ libsmartcols/src/table_print.c | 4 +++- misc-utils/findmnt.8 | 2 ++ misc-utils/lsblk.8 | 2 ++ 7 files changed, 28 insertions(+), 1 deletion(-) commit f1f9b71736705421bfb1baa17c9b09ea8f2acefb Author: Karel Zak Date: Wed Sep 7 11:45:35 2016 +0200 libsmartcols: add fallback for symbols Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) commit 64ce7cbbc0a43010d97e333cc56b31e3218ab646 Author: Karel Zak Date: Wed Sep 7 11:07:04 2016 +0200 libsmartcols: allow to change cell padding char Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 1 + libsmartcols/src/libsmartcols.h.in | 1 + libsmartcols/src/libsmartcols.sym | 1 + libsmartcols/src/smartcolsP.h | 1 + libsmartcols/src/symbols.c | 20 +++++++++++++++++++- libsmartcols/src/table.c | 1 + libsmartcols/src/table_print.c | 16 +++++++++------- 7 files changed, 33 insertions(+), 8 deletions(-) commit 7208ef864bf903ae4eb16491e7cfd24cf792baad Author: Karel Zak Date: Tue Sep 6 14:49:48 2016 +0200 fsck: remove fs-specific options from man page Let's force users to read fs-specific man pages rather than try to be smart and maintain some non-fsck options in fsck.8. Reported-by: Matej Cepl Signed-off-by: Karel Zak disk-utils/fsck.8 | 77 +++++++++---------------------------------------------- 1 file changed, 12 insertions(+), 65 deletions(-) commit a2b8ad291f599230c72886a811d455531402458f Author: Karel Zak Date: Tue Sep 6 13:01:45 2016 +0200 libsmartcols: extend wrapnl sample Signed-off-by: Karel Zak libsmartcols/samples/wrapnl.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) commit 77a94efb5eaa0aadba2a45214131be81974bb45e Author: Karel Zak Date: Tue Sep 6 13:01:09 2016 +0200 libsmartcols: fix padding for non-maxout output Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 4f07ff4041de76fa6acfefac06c500aea710f290 Author: Karel Zak Date: Tue Sep 6 12:24:49 2016 +0200 libsmartcols: remove debuging code from sample Signed-off-by: Karel Zak libsmartcols/samples/wrapnl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit 6cd398642be7d63ea62e488d5cd4b8ecbf88544f Author: Karel Zak Date: Tue Sep 6 11:18:18 2016 +0200 libsmartcols: commit missing file Signed-off-by: Karel Zak libsmartcols/samples/wrapnl.c | 138 ++ po/ca.po | 4257 +++++++++++++++++++++------------------- po/cs.po | 4279 ++++++++++++++++++++++------------------- po/da.po | 4270 +++++++++++++++++++++------------------- po/de.po | 4271 +++++++++++++++++++++------------------- po/es.po | 4274 +++++++++++++++++++++------------------- po/et.po | 4265 ++++++++++++++++++++-------------------- po/eu.po | 4247 +++++++++++++++++++++------------------- po/fi.po | 4267 +++++++++++++++++++++------------------- po/fr.po | 4272 +++++++++++++++++++++------------------- po/gl.po | 4249 +++++++++++++++++++++------------------- po/hr.po | 4220 +++++++++++++++++++++------------------- po/hu.po | 4267 ++++++++++++++++++++-------------------- po/id.po | 4267 ++++++++++++++++++++-------------------- po/it.po | 4257 +++++++++++++++++++++------------------- po/ja.po | 4264 +++++++++++++++++++++------------------- po/nl.po | 4277 +++++++++++++++++++++------------------- po/pl.po | 4270 +++++++++++++++++++++------------------- po/pt_BR.po | 4274 +++++++++++++++++++++------------------- po/ru.po | 4257 +++++++++++++++++++++------------------- po/sl.po | 4257 +++++++++++++++++++++------------------- po/sv.po | 4263 +++++++++++++++++++++------------------- po/tr.po | 4257 +++++++++++++++++++++------------------- po/uk.po | 4270 +++++++++++++++++++++------------------- po/util-linux.pot | 4185 +++++++++++++++++++++------------------- po/vi.po | 4270 +++++++++++++++++++++------------------- po/zh_CN.po | 4265 +++++++++++++++++++++------------------- po/zh_TW.po | 4265 +++++++++++++++++++++------------------- 28 files changed, 60443 insertions(+), 54731 deletions(-) commit ff471d89a12eef331de8e66c33cd9a2c0e23984e Author: Karel Zak Date: Tue Sep 6 10:51:25 2016 +0200 libsmartcols: support multi-line cells based on line breaks Now libsmartcols completely control when and how wrap long lines/cells. This is sometimes user unfriendly and it would be nice to support multi-line cells where wrap is based on \n (new line char). This patch add new column flag SCOLS_FL_WRAPNL. Signed-off-by: Karel Zak include/mbsalign.h | 2 +- lib/mbsalign.c | 12 +++- libsmartcols/docs/libsmartcols-sections.txt | 1 + libsmartcols/samples/Makemodule.am | 5 ++ libsmartcols/src/column.c | 16 ++++++ libsmartcols/src/libsmartcols.h.in | 2 + libsmartcols/src/libsmartcols.sym | 5 ++ libsmartcols/src/table_print.c | 85 ++++++++++++++++++++++++----- 8 files changed, 109 insertions(+), 19 deletions(-) commit a55d646bd3986937cd3a8488b6abaf74b2b9e28a Author: Karel Zak Date: Tue Sep 6 10:19:52 2016 +0200 lib/randutils: add xsrand() and rand_get_number() Signed-off-by: Karel Zak include/randutils.h | 5 +++++ lib/randutils.c | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) commit d4a90151e3b223f3c44e6148943acacd299dd168 Author: Karel Zak Date: Fri Sep 2 11:14:54 2016 +0200 sfdisk: add --no-tell-kernel The option forces sfdisk to not call re-read partitions ioctl after write PT. Requested-by: Scott Moser Signed-off-by: Karel Zak disk-utils/sfdisk.8 | 5 +++++ disk-utils/sfdisk.c | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) commit 2862bda919da23bc5136d697152318adafe9a02f Author: Karel Zak Date: Thu Sep 1 11:43:42 2016 +0200 tests: update sfdisk output strings Signed-off-by: Karel Zak tests/expected/libfdisk/gpt-all-defaults | 5 +++-- tests/expected/libfdisk/gpt-all-defaults-with-typo | 5 +++-- tests/expected/sfdisk/dos-dump-gaps | 2 +- tests/expected/sfdisk/dos-dump-old | 2 +- tests/expected/sfdisk/dos-explicit-size | 5 +++-- tests/expected/sfdisk/dos-read-dump | 5 +++-- tests/expected/sfdisk/dos-simple-commas | 5 +++-- tests/expected/sfdisk/dos-simple-space | 5 +++-- tests/expected/sfdisk/gpt-all-defaults | 5 +++-- tests/expected/sfdisk/gpt-read-dump | 5 +++-- tests/expected/sfdisk/gpt-reorder | 5 +++-- 11 files changed, 29 insertions(+), 20 deletions(-) commit ad8cd66adf344da5b6c0ab40ee2618640f086350 Author: Karel Zak Date: Wed Aug 31 15:51:11 2016 +0200 sfdisk: make non-interactive output more readable # echo -e ',1M\n,2M' | sfdisk /dev/sdc Old version: >>> Created a new DOS disklabel with disk identifier 0x8fc7d065. Created a new partition 1 of type 'Linux' and of size 1 MiB. /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB. /dev/sdc3: New version: >>> Created a new DOS disklabel with disk identifier 0x9afe17c0. /dev/sdc1: Created a new partition 1 of type 'Linux' and of size 1 MiB. /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB. /dev/sdc3: Done. Addresses: https://github.com/karelzak/util-linux/issues/337 Signed-off-by: Karel Zak disk-utils/sfdisk.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) commit b54439cbadaf77ff96baf43c83670dbe7395f95b Author: Karel Zak Date: Wed Aug 31 15:51:03 2016 +0200 libsmartcols: use SCOLS_FL_RIGHT in sample Signed-off-by: Karel Zak libsmartcols/samples/maxout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 51962c95e301d3c22802b63ecb435a190ee6a39e Author: Karel Zak Date: Wed Aug 31 15:15:28 2016 +0200 libsmartcols: add maxout sample Signed-off-by: Karel Zak libsmartcols/samples/Makemodule.am | 7 ++++- libsmartcols/samples/maxout.c | 56 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) commit 5e6421ee0734fb037163dad4a2f9b3e88dac4ac6 Author: Karel Zak Date: Wed Aug 31 15:13:06 2016 +0200 libsmartcols: fix minimal column width calculation Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit f067de449578636441be8d471127e415b460bbf4 Author: Karel Zak Date: Wed Aug 31 13:01:48 2016 +0200 libsmartcols: fix non-tty output for 'maxout' columns Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a593128fd0c3d6faefe05a4162e9379c024c1321 Author: Karel Zak Date: Wed Aug 31 12:42:38 2016 +0200 libsmartcols: fix title output on non-tty Signed-off-by: Karel Zak libsmartcols/src/table.c | 4 ++++ libsmartcols/src/table_print.c | 24 +++++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) commit 066779c67b5764275fca49b0a3a2668c4742d194 Author: Karel Zak Date: Wed Aug 31 12:05:48 2016 +0200 libsmartcols: fix scols_table_enable_colors() usage in samples Signed-off-by: Karel Zak libsmartcols/samples/title.c | 2 +- libsmartcols/samples/tree.c | 2 +- libsmartcols/samples/wrap.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit d7cda881d57867d46c6c53d1a9a725d0ed1343a1 Author: Karel Zak Date: Wed Aug 31 12:05:21 2016 +0200 libsmartcols: don't print title color is colors disabled Signed-off-by: Karel Zak libsmartcols/src/table_print.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit cb129d9cc4a2ae39ba2b678bc511ff81d5023850 Author: Tobias Stoeckmann Date: Tue Aug 30 21:00:38 2016 +0200 lib/loopdev: Set errno in is_loopdev on error The function is_loopdev does not set errno if the supplied string does not reference a valid loop device. Fix this to avoid an error message like this one: losetup: /: failed to use device: Success I prefer this one: losetup: /: failed to use device: No such device Signed-off-by: Tobias Stoeckmann lib/loopdev.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit 2480b52743409a09277ecae47259b57804232e25 Author: Karel Zak Date: Wed Aug 31 09:48:43 2016 +0200 mount: add note about paths verification to mount.8 Signed-off-by: Karel Zak sys-utils/mount.8 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit f98b563268624a94a7e8a6ed0a6b06b78c676ba1 Author: Rostislav Skudnov Date: Tue Aug 30 10:07:49 2016 +0000 libblkid: [exfat] Limit maximum number of iterations in find_label Do not hang if there is a cluster chain loop in rootdir [kzak@redhat.com: - add return NULL] Signed-off-by: Karel Zak libblkid/src/superblocks/exfat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 4db236f7e4b9c54b04cb1bb4e4dcdbdc11aec2cc Author: Karel Zak Date: Tue Aug 30 12:07:40 2016 +0200 libblkid: ignore empty MBR on LVM device It's possible to use boot sector and empty MBR on LVM physical volume to make LVM disk bootable. In this case MBR should be ignored and disk reported as LVM. Just for the record, this is ugly non-default LVM setup maintained for backward compatibility (yes, LVM guys don't like it too). Unfortunately people still use it. The proper way is to use regular partitioned disk. Reported-by: Xen Signed-off-by: Karel Zak libblkid/src/partitions/dos.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) commit a1df9c9d4e8908ef5942ca0d58ee490352930c5b Author: Karel Zak Date: Tue Aug 30 11:22:30 2016 +0200 libblkid: remove unused function Signed-off-by: Karel Zak libblkid/src/blkidP.h | 2 -- libblkid/src/probe.c | 9 --------- 2 files changed, 11 deletions(-) commit 29ad8689b8084cfcbd3bfa6c40d2f87557a51b13 Author: Karel Zak Date: Tue Aug 30 10:41:05 2016 +0200 umount: cleanup umount.8 about mtab Signed-off-by: Karel Zak sys-utils/umount.8 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) commit d00eb87ba284635e72b10880dfcf409276fa41b0 Author: Karel Zak Date: Tue Aug 30 10:25:44 2016 +0200 umount: fix obsolete info about loop= in umount.8 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1370959 Signed-off-by: Karel Zak sys-utils/umount.8 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) commit 8fa57ab0b5696031da800e243def32bc5265ff6d Author: Tobias Stoeckmann Date: Sun Aug 28 21:15:59 2016 +0200 libblkid: Avoid OOB access on illegal ZFS superblocks 64 bit systems can trigger an out of boundary access while performing a ZFS superblock probe. This happens due to a possible integer overflow while calculating the remaining available bytes. The variable is of type "int" and the string length is allowed to be larger than INT_MAX, which means that avail calculation can overflow, circumventing the "avail < 0" check and therefore accessing memory outside the "buff" array later on. Signed-off-by: Tobias Stoeckmann libblkid/src/superblocks/zfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1037269fec43e8055c530c13d4fd58819e86b233 Author: Tobias Stoeckmann Date: Sat Aug 27 19:28:48 2016 +0200 libfdisk: Distinguish between first LBA sector and partition An insufficient check leads to an invalid free space output, as seen here: $ dd if=/dev/zero of=cfdisk.iso bs=1M count=1 $ losetup -f cfdisk.iso $ echo w | fdisk /dev/loop0 $ echo '1,1' | sfdisk /dev/loop0 --append $ echo '3,' | sfdisk /dev/loop0 --append $ sfdisk --list-free /dev/loop0 Start End Sectors Size 1 2 2 1K $ _ In this case, libfdisk fails to notice that it tries to calculate space between two partitions, not between start of disk and first partition. Currently, the code tries to achieve that by checking the address of the last "partition", which is the first_lba block. Now if the first partition is merely 1 block in size, the "last" address is still equal to the first_lba block, which renders the check in libfdisk for the next partition invalid. I chose to use "nparts == 0" for this check, because the partitions are properly sorted before iterating over them. Signed-off-by: Tobias Stoeckmann libfdisk/src/table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 848018183869d908ddfa59ce7362272f65baa860 Author: Tobias Stoeckmann Date: Sat Aug 27 19:28:16 2016 +0200 libfdisk: Fix assert error in free space handling An off-by-one issue exists in fdisk_get_freespaces. It can trigger an assert, as seen here: $ dd if=/dev/zero of=cfdisk.iso bs=1M count=1 $ losetup -f cfdisk.iso $ echo w | fdisk /dev/loop0 $ echo '1,2' | sfdisk /dev/loop0 --append $ echo '3,' | sfdisk /dev/loop0 --append $ sfdisk --list-free /dev/loop0 Aborted $ _ Problem here is an invalid "grain" processing. A grain is considered expected free space between partitions which can be required for proper alignment. Normally, it's 1 MB but in this case our iso is merely 1 MB so the grain is reduced to 1 byte. The if-condition in question checks for "last + grain <= pa->start" and therefore even triggers if there is no space between them (due to equal check). Eventually, the start block address is higher than the end block address which triggers the assert(). Signed-off-by: Tobias Stoeckmann libfdisk/src/table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e132ae59cae70f5500e39d995ae6fdee044ffeee Author: Karel Zak Date: Fri Aug 26 17:47:01 2016 +0200 lib/pager: fix test Signed-off-by: Karel Zak lib/pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a9fcbf6f6a892c872a57b9d24e9ceb28e6e3c032 Author: Karel Zak Date: Fri Aug 26 13:02:37 2016 +0200 lib/pager: restore signals setting by pager_close() Signed-off-by: Karel Zak lib/pager.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) commit 8d2f449818df988c1ca100e8f775cf24810a643e Author: Karel Zak Date: Fri Aug 26 12:09:53 2016 +0200 fdisk: use PAGER for 'l' command. The list of the partition types is too long. Let's try to use $PAGER. Reported-by: Bruce Dubbs Signed-off-by: Karel Zak disk-utils/fdisk.c | 6 ++++++ 1 file changed, 6 insertions(+) commit e215d467ca828498109d178eb0e7cbe4a835cd99 Author: Karel Zak Date: Fri Aug 26 12:07:25 2016 +0200 lib/pager: cleanup and extend API * clean up function names * add functions to temporary redirect to the pager and then restore original terminal output Signed-off-by: Karel Zak include/pager.h | 5 ++++- lib/pager.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++---- sys-utils/dmesg.c | 4 ++-- 3 files changed, 57 insertions(+), 7 deletions(-) commit c424fd834b4845971e9ce5ef3d7325f6f4e6b163 Author: Karel Zak Date: Thu Aug 18 11:12:44 2016 +0200 su, runuser, setpriv: create links between man pages .. and add notes about differences between the utuils. Reported-by: Lennart Poettering Signed-off-by: Karel Zak login-utils/runuser.1 | 7 ++++++- login-utils/su.1 | 11 +++++++++++ sys-utils/setpriv.1 | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) commit 0e0e167704365f7723f92260d82ee8c1be2f8730 Author: Karel Zak Date: Wed Aug 17 13:54:34 2016 +0200 tests: fix losetup tests for --nooverlap Signed-off-by: Karel Zak tests/ts/losetup/losetup-loop | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) commit d8ba61fcb43effb310f9d59627125118a453ef74 Author: Karel Zak Date: Wed Aug 17 13:52:22 2016 +0200 losetup: allow to use --nooverlap when device specified Signed-off-by: Karel Zak sys-utils/losetup.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) commit 912d50b3bec755d8b4f08aec69d255dbb5fe5e31 Author: Stanislav Brabec Date: Tue Aug 2 20:00:46 2016 +0200 tests: Add losetup-loop test suite Add losetup loop test suite that tests proper behavior of conflicting and re-used loop devices. Signed-off-by: Stanislav Brabec tests/expected/losetup/losetup-loop | 1 + tests/expected/losetup/losetup-loop-find-conflict | 3 + .../losetup-loop-find-conflict-no-sizelimit | 3 + .../losetup/losetup-loop-find-conflict-readonly | 3 + tests/expected/losetup/losetup-loop-find-no-re-use | 2 + .../losetup/losetup-loop-find-ok-no-sizelimit | 2 + .../losetup/losetup-loop-find-race-condition | 2 + tests/expected/losetup/losetup-loop-find-re-use | 2 + tests/expected/losetup/losetup-loop-plain-conflict | 2 + tests/expected/losetup/losetup-loop-plain-re-use | 2 + tests/expected/losetup/losetup-loop-plain-readonly | 2 + tests/ts/losetup/losetup-loop | 228 +++++++++++++++++++++ 12 files changed, 252 insertions(+) commit f27d989c67eb0d85b3bfc54807e626ff16e71f56 Author: Stanislav Brabec Date: Wed Aug 17 12:54:40 2016 +0200 losetup: Prevent AUTOCLEAR detach race Kernel needs some time to delete a device after losetup --detach. If the losetup --find --nooverlay is called just after losetup --delete, it can sometimes attempt to recycle the device that is just being released. To prevent this race, clear the AUTOCLEAR flag of the device. [kzak@redhat.com: - rebase to the new version of the code] Signed-off-by: Stanislav Brabec Signed-off-by: Karel Zak sys-utils/losetup.c | 6 ++++++ 1 file changed, 6 insertions(+) commit bfd4e1f75898510f93779766688cc5086404c23b Author: Stanislav Brabec Date: Tue Aug 2 19:57:56 2016 +0200 loopdev: Implememt loopcxt_set_status() Implement stand-alone loopcxt_set_status(). It allows manipulation with some loop device parameters even if it is initialized. Its function is limited by the kernel implementation, and only a small subset of changes is allowed. For more see linux/drivers/block/loop.c:loop_set_status() Signed-off-by: Stanislav Brabec include/loopdev.h | 1 + lib/loopdev.c | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) commit 9a94b634a343e83bfa2a9d311074e3e520abdddd Author: Karel Zak Date: Wed Aug 17 12:28:33 2016 +0200 losetup: add --nooverlap options This patch introduces overlap detections and loop devices re-use for losetup(8). We already support this feature for mount(8) where it's enabled by default (because we mount filesystems and it's always mistake to share the same filesystem between more loop devices). Stanislav has suggested to enable this feature also for losetup by default. I'm not sure about it, IMHO it's better to keep losetup(8) simple and stupid by default, and inform users about possible problems and solutions in the man page. The feature forces losetup to scan all loop devices always when new one is requested. This maybe disadvantage (especially when we use control-loop to avoid /sys or /dev scans) on system with huge number of loop devices. Co-Author: Stanislav Brabec Signed-off-by: Karel Zak lib/loopdev.c | 14 ++++-- sys-utils/losetup.8 | 11 +++++ sys-utils/losetup.c | 136 ++++++++++++++++++++++++++++++++++++---------------- 3 files changed, 114 insertions(+), 47 deletions(-) commit f066f32aaec26e96f88e8043692fdb3214dfd14f Author: Karel Zak Date: Tue Aug 16 13:40:44 2016 +0200 tests: keep 'hppa' in fdisk/bsd test too Signed-off-by: Karel Zak tests/ts/fdisk/bsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f319e301a90bb6129a1656c46ed8b9cdf72a2d29 Author: Karel Zak Date: Tue Aug 16 13:39:07 2016 +0200 build-sys: add parisc to define ARCH_ Signed-off-by: Karel Zak configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 569ad28288f64df2161e545780c8afad6287316f Author: Helge Deller Date: Mon Aug 15 22:26:30 2016 +0200 tests: really fix fdisk/bsd for hppa Finally fix the bsd testcase on the hppa architecture. Commit 1b7be556e553cdcef6213ead6340832c306011ed tried to fix it, but missed the fact that "uname -m" returns "parisc" or "parisc64" instead of "hppa*". Signed-off-by: Helge Deller Cc: 827225@bugs.debian.org tests/ts/fdisk/bsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2b8889c44b6752e92bfb982a5eaa2255a129e072 Author: Michał Bartoszkiewicz Date: Mon Aug 15 12:22:30 2016 +0200 lsns: support cgroup namespaces Signed-off-by: Michał Bartoszkiewicz sys-utils/lsns.8 | 4 ++-- sys-utils/lsns.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) commit 090d8c763a50b5b0c83f423a2e943fa928b29d56 Author: Karel Zak Date: Tue Aug 16 13:35:06 2016 +0200 include/closestream: define exit codes Signed-off-by: Karel Zak disk-utils/fsck.c | 4 +++- disk-utils/mkfs.cramfs.c | 5 ++++- include/closestream.h | 8 ++++++-- misc-utils/blkid.c | 3 ++- misc-utils/getopt.c | 1 + 5 files changed, 16 insertions(+), 5 deletions(-) commit 05d8868d86104c26aee8a1a30192243d0f9d2682 Author: Karel Zak Date: Tue Aug 16 12:35:57 2016 +0200 include/env: minor fixes and clean ups Signed-off-by: Karel Zak include/env.h | 8 +++++++- login-utils/login.c | 7 ++++--- 2 files changed, 11 insertions(+), 4 deletions(-) commit 64ffc95b0f9478743493278d5bbcd90e0cf9683d Merge: 9d89a95 00971cc Author: Karel Zak Date: Tue Aug 16 12:09:00 2016 +0200 Merge branch 'misc' of https://github.com/kerolasa/lelux-utiliteetit * 'misc' of https://github.com/kerolasa/lelux-utiliteetit: pg: stop building the command by default kill: remove pid command-name to option alias misc: always check setenv(3) return value commit 9d89a95e889f69aebf78f6d5ae38920026a8a94f Author: Rostislav Skudnov Date: Thu Aug 11 18:24:00 2016 +0000 libblkid: Check that cluster size is nonzero when probing exFAT This should prevent division by zero in find_label() Signed-off-by: Rostislav Skudnov libblkid/src/superblocks/exfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3082f8518f2739e9f68e660f1749acdd2b9d7a97 Author: Karel Zak Date: Mon Aug 15 11:02:18 2016 +0200 lsns: missing ns/ is not error For example user namespace is optional it does not make sense to ignore process completely if the ns/user file is missing. Reported-by: Michał Bartoszkiewicz Signed-off-by: Karel Zak sys-utils/lsns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 00971cca8a270b6e162c977182d134a64bbc914a Author: Sami Kerola Date: Mon Aug 8 22:08:16 2016 +0100 pg: stop building the command by default The pg command is marked deprecated in POSIX since 1997, and this project has thought the same since Feb 2013. Time has come to stop shipping this binary by default. Reference: 956e582874d3a28434018bf12057c745f74821de Signed-off-by: Sami Kerola configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0be3ad70ad85cce75be6fffb87fa81e62bd4b105 Author: Sami Kerola Date: Mon Aug 8 21:50:19 2016 +0100 kill: remove pid command-name to option alias Removal was promised to happen in March 2016 and the time has come to get rid of this unexpected feature. Reference: c5b057b3422504a671ee588fa66574ae876521f1 Reviewed-by: Benno Schulenberg Signed-off-by: Sami Kerola Documentation/deprecated.txt | 5 ----- misc-utils/kill.1 | 5 ----- misc-utils/kill.c | 4 ---- 3 files changed, 14 deletions(-) commit 984a60965a0e3cd3253a74c77af916b05381c03d Author: Sami Kerola Date: Sun Aug 7 07:27:21 2016 +0100 misc: always check setenv(3) return value At least glibc setenv(3) can fail when system runs out of memory. Signed-off-by: Sami Kerola include/env.h | 2 +- lib/pager.c | 3 ++- login-utils/login.c | 19 +++++++++++-------- login-utils/su-common.c | 2 +- login-utils/sulogin.c | 21 +++++++++++---------- sys-utils/hwclock.c | 5 +++-- sys-utils/rtcwake.c | 3 ++- term-utils/agetty.c | 4 +++- 8 files changed, 34 insertions(+), 25 deletions(-) commit 8c4ae2fd48f2d20f4aec28ddf75b3f847b5d9add Author: Karel Zak Date: Fri Aug 12 10:06:59 2016 +0200 tests: mark build-in paths test as optional The test makes sense only if you know what are you doing (see #ifdef(s) in the include/pathnames.h. Signed-off-by: Karel Zak tests/ts/paths/built-in | 5 +++++ 1 file changed, 5 insertions(+) commit b8c65bd0b8880014109ace50e2e13545371bfef8 Merge: 1ef66ac 0773ad1 Author: Karel Zak Date: Fri Aug 12 10:05:00 2016 +0200 Merge branch 'pathnames_fbsd' of https://github.com/fichtner/util-linux commit 1ef66ace16af7ae5cfc58da79d019f563ecc2f9a Merge: 160eef8 6978b2c Author: Karel Zak Date: Fri Aug 12 10:04:35 2016 +0200 Merge branch 'blkdev_fbsd_11' of https://github.com/fichtner/util-linux commit 160eef814a95d74b2da6e55a87e0dfcd99f5eb5a Author: Ruediger Meier Date: Thu Aug 11 17:30:20 2016 +0200 travis: fix OSX, glibtoolize could not find sed Since a few days travis OSX seems to have a bad libtool package: $ glibtoolize --version /usr/local/bin/glibtoolize: line 406: /usr/local/Library/ENV/4.3/sed: No such file or directory Exporting SED is a simple fix. Otherwise we could have also re-installed libtool: brew uninstall libtool brew install libtool Signed-off-by: Ruediger Meier .travis-functions.sh | 3 +++ 1 file changed, 3 insertions(+) commit 0773ad14a371a00a2191aa6527c0f80cca3ed6a7 Author: Franco Fichtner Date: Thu Aug 11 15:03:50 2016 +0200 pathnames: guard clashing definitions on FreeBSD include/pathnames.h | 4 ++++ 1 file changed, 4 insertions(+) commit 6978b2c43096e2d4d7938c359d37ff143505aa13 Author: Franco Fichtner Date: Thu Aug 11 14:56:08 2016 +0200 blkdev: guard against missing DIOCGDINFO on FreeBSD 11 DIOCGMEDIASIZE is supported and available since FreeBSD 5, it may make sense to kill the backwards-glue completely instead. lib/blkdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 727c689908c5e68c92aa1dd65e0d3bdb6d91c1e5 Author: Filipe Brandenburger Date: Wed Aug 10 13:27:07 2016 -0700 libmount: Preserve empty string value in optstr parsing Recent mount (since the switch to libmount in v2.22) drops the '=' in mount options that are set to an empty value. For example, the command line below will be affected: # mount -o rw,myopt='' -t tmpfs tmpfs /mnt/tmp Fix that by preserving an empty string in the options passed to the mount(2) syscall when they are present on the command line. Add test cases to ensure empty string handling is working as expected and in order to prevent regressions in the future. Also tested manually by stracing mount commands (on a kernel which accepts a special extra option, for testing purposes.) Before this commit: # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myarg") = -1 EINVAL (Invalid argument) After this commit: # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myopt=") = 0 All test cases pass, including newly added test cases. Also checked them with valgrind using: $ tests/run.sh --memcheck libmount/optstr Fixes #332. Signed-off-by: Filipe Brandenburger libmount/src/optstr.c | 4 ++-- tests/expected/libmount/optstr-append-empty-value | 1 + tests/expected/libmount/optstr-deduplicate-empty | 1 + tests/expected/libmount/optstr-prepend-empty-value | 1 + tests/expected/libmount/optstr-remove-empty-value | 1 + tests/expected/libmount/optstr-set-empty | 1 + tests/expected/libmount/optstr-set-new-empty | 1 + tests/expected/libmount/optstr-set-new-end-empty | 1 + tests/ts/libmount/optstr | 28 ++++++++++++++++++++++ 9 files changed, 37 insertions(+), 2 deletions(-) commit 7cd6d50aa92a2e9b567675acc88f7206c84a4d5f Author: Filipe Brandenburger Date: Wed Aug 10 13:36:55 2016 -0700 tests: Allow running a single test case from tests/run.sh Tested by running `tests/run.sh libmount/optstr` successfully. Signed-off-by: Filipe Brandenburger tests/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 88a5f90e874cac53f5d24aed6542d4867be10e2d Author: Filipe Brandenburger Date: Wed Aug 10 13:17:12 2016 -0700 tests: Use proper word splitting when executing tests Use the shell special variable "$@" instead of the inferior $* to execute the test command in ts_valgrind. The expansion of "$@" respects proper word splitting and makes it possible to pass the command empty arguments. It might also prevent surprises with quoting in corner cases. Tested that `make check` passes. Valgrind run with `make check TS_OPTS='--nonroot --memcheck'` passes. Signed-off-by: Filipe Brandenburger tests/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 47bd898e91043c5c505f8d28bb7d5377f10ae0db Author: Chris Metcalf Date: Tue Aug 9 11:31:41 2016 +0200 taskset: clarify that masks are always hex in man page The man page confusingly says that the mask is "typically" hexadecimal, when in fact it is always hexadecimal. Fix the language, and provide an additional example with no leading "0x". Also, provide an example using the --cpu-list option. Signed-off-by: Chris Metcalf Signed-off-by: Karel Zak schedutils/taskset.1 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit d4e89dea4e8e95cee0cede39dc77618a181b8d19 Author: Karel Zak Date: Mon Aug 8 17:23:54 2016 +0200 libmount: ignore redundant slashes ///aaa/bbb and /aaa/bbb/ are the same paths. This is important especially with NFS where number of slashes are not the same in the /proc/self/mountinfo and fstab or utab. The regular URI is euler://tmp but /proc contains euler:/tmp Reported-by: Ales Novak Signed-off-by: Karel Zak include/strutils.h | 2 +- lib/strutils.c | 100 ++++++++++++++++++++++++++++++++++-------------- libmount/src/cache.c | 2 +- libmount/src/fs.c | 14 ++++--- tests/ts/misc/strtosize | 68 ++++++++++++++++---------------- 5 files changed, 116 insertions(+), 70 deletions(-) commit b7a245e27af6053c262a0e16438d4ab2ebb48016 Author: Sami Kerola Date: Mon Aug 8 12:33:16 2016 +0200 uuidd: remove unnecessary pidpile path variable Signed-off-by: Karel Zak misc-utils/uuidd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 349ac672734d15df09096475dbb08250fc165cbc Author: Karel Zak Date: Mon Aug 8 12:15:47 2016 +0200 sfdisk: add show-pt-geometry to usage() and sfdisk.8 Signed-off-by: Karel Zak disk-utils/sfdisk.8 | 4 +++- disk-utils/sfdisk.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) commit ba7f6ba53a869fd78bcbc56fd7398e2e47ff782c Author: Stanislav Brabec Date: Fri Aug 5 13:05:39 2016 +0200 deprecated.txt: Add sfdisk --show-pt-geometry Documentation/deprecated.txt | 5 +++++ 1 file changed, 5 insertions(+) commit f7c6c31f08a0f72e13527f2de368686dd77ad66c Author: Stanislav Brabec Date: Thu Aug 4 20:15:57 2016 +0200 sfdisk: Add --show-pt-geometry compatibility code --show-pt-geometry existed since cf3f26bf (2006), and it is used by third party tools. To prevent failure of these tools, add a minimal compatibility code. Signed-off-by: Stanislav Brabec disk-utils/sfdisk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 041d33734e845a5fab328ef63771863b445f21dc Author: Karel Zak Date: Thu Aug 4 15:09:05 2016 +0200 tests: fix loop-overlay test Signed-off-by: Karel Zak tests/ts/libmount/loop-overlay | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 05b483010e3e274571059d75e781a5d77859a4dd Author: Karel Zak Date: Thu Aug 4 12:30:09 2016 +0200 tests: fix libmount loop-overlay test Signed-off-by: Karel Zak tests/ts/libmount/loop-overlay | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit c8bbdff0833a1656e5362c7b248060589e51fd87 Merge: 2c497d3 03b4519 Author: Karel Zak Date: Thu Aug 4 11:57:49 2016 +0200 Merge branch 'lo' * lo: mount: small change to mount.8 loopdev section libmount: one iteration to detect overlap and reuse loopdev lib/loopdev: cleanup sizelimit check mount.8: Update loop device documentation tests: Add loop-overlay test libmout: Reuse loop device safely Implement loopcxt_check_conflict() Add sizelimit to internal API mount: Handle MNT_ERR_LOOPOVERLAP libmount: Introduce new error: MNT_ERR_LOOPOVERLAP libmount: Fix possible crash in mnt_context_setup_loopdev() commit 03b4519b356b2aa87ea9a426c116f9830a546e7e Author: Karel Zak Date: Thu Aug 4 11:56:50 2016 +0200 mount: small change to mount.8 loopdev section Signed-off-by: Karel Zak sys-utils/mount.8 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit dff7e1604680ee0118a04233ef365aebb869c9db Author: Karel Zak Date: Thu Aug 4 11:48:26 2016 +0200 libmount: one iteration to detect overlap and reuse loopdev The current code scans loopdevs to detect already used loop device and another scan to detect overlap. Let's use one scan only, for this purpose loopcxt_find_overlap() has been modified to return info (rc==2) about full size and offset match. Signed-off-by: Karel Zak lib/loopdev.c | 22 ++++++++++++--- libmount/src/context_loopdev.c | 63 +++++++++++++++++++++--------------------- 2 files changed, 49 insertions(+), 36 deletions(-) commit c444a71b1ba216b39707b41ebade2e35f6a256b7 Author: Karel Zak Date: Thu Aug 4 10:49:46 2016 +0200 lib/loopdev: cleanup sizelimit check Signed-off-by: Karel Zak include/loopdev.h | 6 +++--- lib/loopdev.c | 20 +++++++++++--------- libmount/src/context_loopdev.c | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) commit 2c497d328840c8cf6d915675fd6168ff616517d3 Author: Heiko Carstens Date: Fri Jul 29 14:13:36 2016 +0200 lscpu: print correct number of threads per core if possible lscpu calculates the number of threads per core by dividing the number of online cpus with the number of cores. This may or may not give the correct number of threads per core depending on the number of online CPUs (and which CPUs are online). At least on s390 there is a new "max thread id" field within /proc/cpuinfo present which reliably allows us to tell the number of threads per core. Let's use this instead, like we already have also special treatment to figure out the number core per socket etc. on s390. Signed-off-by: Heiko Carstens sys-utils/lscpu.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 6417dd7ffd01bc856f9c7872d5e4d3865d0e281a Author: Heiko Carstens Date: Fri Jul 29 14:13:35 2016 +0200 lspcu: minor manpage improvement Always use the word "can" instead of "may" to be consistent with the descriptions of the other columns. Also print "lspcu" always with bold characters like everywhere else in the man page. Signed-off-by: Heiko Carstens sys-utils/lscpu.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0002704ebe998d70af87d4385cc243baae7b2059 Author: Heiko Carstens Date: Fri Jul 29 14:13:34 2016 +0200 lscpu: only try to read sysfs attributes of present CPUs lscpu can skip all CPUs which are possible but not present. For configurations where a lot of CPUs are possible but only few CPUs are present this saves a lot of pointless glibc/system calls. Signed-off-by: Heiko Carstens sys-utils/lscpu.c | 4 ++++ 1 file changed, 4 insertions(+) commit 0be8771a71059b968e6f02f3cbeb4c4a17f6d46c Author: Heiko Carstens Date: Fri Jul 29 14:13:33 2016 +0200 lscpu: add parsable testcase with the --physical option Signed-off-by: Heiko Carstens tests/expected/lscpu/lscpu-armv7 | 7 +++ tests/expected/lscpu/lscpu-ppc-qemu | 6 +++ tests/expected/lscpu/lscpu-ppc64-POWER7 | 21 ++++++++ tests/expected/lscpu/lscpu-ppc64-POWER7-64cpu | 69 +++++++++++++++++++++++++++ tests/expected/lscpu/lscpu-s390-kvm | 8 ++++ tests/expected/lscpu/lscpu-s390-lpar | 22 +++++++++ tests/expected/lscpu/lscpu-s390-lpar-drawer | 13 +++++ tests/expected/lscpu/lscpu-s390-zvm | 9 ++++ tests/expected/lscpu/lscpu-sparc64 | 11 +++++ tests/expected/lscpu/lscpu-vbox-win | 7 +++ tests/expected/lscpu/lscpu-x86_64-64cpu | 69 +++++++++++++++++++++++++++ tests/expected/lscpu/lscpu-x86_64-dell_e4310 | 9 ++++ tests/ts/lscpu/lscpu | 5 ++ 13 files changed, 256 insertions(+) commit 0d2b5d2a72bc6619229a4d7456fbb70eda561825 Author: Heiko Carstens Date: Fri Jul 29 14:13:32 2016 +0200 lscpu: add --physical option With the --physical option lscpu will use the IDs that are reported by the kernel (e.g. core id for the CORE column) instead of calculating them on it's own. This has the advantage that it is possible to tell on which physical hardware CPUs a Linux instance runs. The logical IDs that lscpu generates on it own are based on comparing of CPU masks and may or may not be identical with the physical IDs. If the kernel was unable to retrieve an ID for a topology element then the corresponding sysfs file will normally contain "-1". In the extended and parsable output a dash "-" will be displayed for such cases. Signed-off-by: Heiko Carstens sys-utils/lscpu.1 | 12 +++++- sys-utils/lscpu.c | 111 ++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 103 insertions(+), 20 deletions(-) commit 7aa390db981d7c587940a60fce5ca1b548f1cd74 Author: Stanislav Brabec Date: Fri Jul 15 15:07:38 2016 +0200 mount.8: Update loop device documentation New code checks both offset and sizelimit before re-using loop device. Signed-off-by: Stanislav Brabec sys-utils/mount.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ab9795aca848d6c7f5845bbb7ef52f99a255a112 Author: Stanislav Brabec Date: Thu Jul 14 15:30:09 2016 +0200 tests: Add loop-overlay test The test will check proper loop device reuse and error in case of overlapping loop device. Signed-off-by: Stanislav Brabec tests/expected/libmount/loop-overlay | 7 ++++ tests/ts/libmount/loop-overlay | 64 ++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) commit 8efad715b9cf9746f77fa1fda17b0af1f5ed4fcd Author: Stanislav Brabec Date: Thu Jul 14 15:29:44 2016 +0200 libmout: Reuse loop device safely Add a safety check to mnt_context_setup_loopdev(). Only a loop device with equal offset and sizelimit will be reused. If any overlapping loop device exists, MNT_ERR_LOOPOVERLAP is returned. Signed-off-by: Stanislav Brabec libmount/src/context_loopdev.c | 65 +++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 13 deletions(-) commit 211e1d4609d36081fc57dd31cad6806f51b06016 Author: Stanislav Brabec Date: Thu Jul 14 15:29:21 2016 +0200 Implement loopcxt_check_conflict() Add a function that searches for a possible conflicting (i. e. overlaying loop device). Signed-off-by: Stanislav Brabec include/loopdev.h | 3 +++ lib/loopdev.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) commit 74a4705a993ce475d95c1c20d0cc4eb740b0c933 Author: Stanislav Brabec Date: Thu Jul 14 15:29:09 2016 +0200 Add sizelimit to internal API Fully safe checks of loop device need to check sizelimit. To prevent need of two nearly equal functions, introduce sizelimit parameter to several internal functions: loopdev_is_used() loopdev_find_by_backing_file() loopcxt_is_used() loopcxt_find_by_backing_file() If sizelimit is zero, fall back to the old behavior (ignoring of sizelimit). Signed-off-by: Stanislav Brabec include/loopdev.h | 8 +++++--- lib/ismounted.c | 2 +- lib/loopdev.c | 26 +++++++++++++++++++------- libmount/src/context_loopdev.c | 6 +++--- libmount/src/context_umount.c | 2 +- libmount/src/tab.c | 2 +- sys-utils/losetup.c | 8 ++++---- 7 files changed, 34 insertions(+), 20 deletions(-) commit 41c9e5d366d22eeb6592ac330ab75e1e4b28acec Author: Stanislav Brabec Date: Thu Jul 14 15:28:58 2016 +0200 mount: Handle MNT_ERR_LOOPOVERLAP Use warnx(), as there is no strerror() text associated with it. There is currently no easy way to report name and type of conflict. Signed-off-by: Stanislav Brabec sys-utils/mount.c | 3 +++ 1 file changed, 3 insertions(+) commit 7e6b7035e7bd5dd82bf4fc95494df3552e80a8f1 Author: Stanislav Brabec Date: Thu Jul 14 15:28:45 2016 +0200 libmount: Introduce new error: MNT_ERR_LOOPOVERLAP This error code is intended for situations where overlapping loop device exists and cannot be reused. Signed-off-by: Stanislav Brabec libmount/src/libmount.h.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 441cdba95b1344a5bf4ce4f490bce416cc85f7d7 Author: Stanislav Brabec Date: Thu Jul 14 15:28:29 2016 +0200 libmount: Fix possible crash in mnt_context_setup_loopdev() If loopcxt_init() fails, Iloopcxt_deinit() should not be called. Signed-off-by: Stanislav Brabec libmount/src/context_loopdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit cc73d2d9fde267446aa5bcf5f1bc580b9295d39d Author: Sami Kerola Date: Fri Jul 22 21:24:34 2016 +0100 tests: remove unnecessary file Signed-off-by: Sami Kerola tests/colcrt | Bin 14720 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) commit 2b1df916e1b29856fb5f3536374e872d263a4ae9 Merge: 38f6945 d27f5fe Author: Karel Zak Date: Tue Aug 2 16:08:31 2016 +0200 Merge branch 'getopt' of git://github.com/kerolasa/lelux-utiliteetit * 'getopt' of git://github.com/kerolasa/lelux-utiliteetit: getops: improve getopt-parse.bash example commit 38f6945d63f3e233996af8ccec179168afb5a8e5 Author: Karel Zak Date: Fri Jul 15 10:39:20 2016 +0200 liblkid: fix probe_nilfs2 I/O error backup Signed-off-by: Karel Zak libblkid/src/superblocks/nilfs.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) commit e948ac218b93174d0e59e622b75b3aa3592ac876 Merge: 1ca2661 6b95f11 Author: Karel Zak Date: Tue Aug 2 15:26:49 2016 +0200 Merge branch 'oclint' of git://github.com/kerolasa/lelux-utiliteetit * 'oclint' of git://github.com/kerolasa/lelux-utiliteetit: libblkid: fix debugging macro [oclint] agetty: move unreachable code to pre-processor #else segment [oclint] setterm: fix declarations shadowing variables in the global scope [oclint] misc: fix declarations shadowing variables in the global scope [oclint] dmesg: drop core at impossible case in read_buffer() [oclint] libmount, look: remove dead code [oclint] syspriv: flip inverted logic [oclint] logger: simplify if clause [oclint] libblkid: simplify if clause [oclint] lslogins: simplify if clause and move definition and comments [oclint] switch_root: simplify code and reduce indentation [oclint] misc: simplify if clauses [oclint] commit 1ca2661bb8c4021aac2130536d846d6276448f53 Author: Karel Zak Date: Tue Aug 2 11:58:50 2016 +0200 libsmartcols: Corrected JSON escaping Based on patch set https://github.com/karelzak/util-linux/pull/331 from Fordi. Addresses: https://github.com/karelzak/util-linux/issues/330 Co-Author: Bryan Elliott Signed-off-by: Karel Zak include/carefulputc.h | 80 ++++++++++++++++++++++++++++++++++++++++++ libsmartcols/src/table_print.c | 4 +-- 2 files changed, 82 insertions(+), 2 deletions(-) commit d27f5fe770025e456fbd33b87a96968f34c455ed Author: Sami Kerola Date: Wed Jul 27 11:17:47 2016 +0100 getops: improve getopt-parse.bash example Use correct names of example scripts in the script. Remove use of backticks, they require quoting that makes the example harder to follow. Split one-liners to one-command-at-a-time expressions. Add continue keyword to avoid additional case statement matching. Be strict with quoting. Reported-by: Benno Schulenberg Signed-off-by: Sami Kerola misc-utils/getopt-parse.bash | 84 +++++++++++++++++++++++++++++--------------- misc-utils/getopt-parse.tcsh | 8 ++--- 2 files changed, 60 insertions(+), 32 deletions(-) commit 6b95f11c066f54f29e43dcb3fce6d564d1ae3630 Author: Sami Kerola Date: Sun Jul 3 20:57:23 2016 +0100 libblkid: fix debugging macro [oclint] The oclint was complaining 'empty do/while statement' that turned out to be true and I started to think it is best to use the same DBG() macro as in other source files for this library. Signed-off-by: Sami Kerola libblkid/src/superblocks/zfs.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) commit 58c756c92dc4795c9c7a72df7c30b5d6ff24a74a Author: Sami Kerola Date: Sun Jul 3 20:10:11 2016 +0100 agetty: move unreachable code to pre-processor #else segment [oclint] Signed-off-by: Sami Kerola term-utils/agetty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit ef4d11d57e13086a394e86a75e390ec3086ca0ff Author: Sami Kerola Date: Sun Jul 3 13:13:21 2016 +0100 setterm: fix declarations shadowing variables in the global scope [oclint] Signed-off-by: Sami Kerola term-utils/setterm.c | 80 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) commit eb2306e675d9ba5e348938e473f5a6f96400980f Author: Sami Kerola Date: Sun Jul 3 13:20:30 2016 +0100 misc: fix declarations shadowing variables in the global scope [oclint] Fixes multiple occurences of 'optarg' overwrites. Signed-off-by: Sami Kerola login-utils/last.c | 6 +++--- login-utils/lslogins.c | 6 +++--- misc-utils/logger.c | 14 +++++++------- sys-utils/dmesg.c | 14 +++++++------- sys-utils/ipcrm.c | 8 ++++---- sys-utils/lsipc.c | 6 +++--- sys-utils/rtcwake.c | 6 +++--- 7 files changed, 30 insertions(+), 30 deletions(-) commit f6f1356f1c633e65413d13be927fe1e56e8515be Author: Sami Kerola Date: Sun Jul 3 12:18:03 2016 +0100 dmesg: drop core at impossible case in read_buffer() [oclint] Signed-off-by: Sami Kerola sys-utils/dmesg.c | 2 ++ 1 file changed, 2 insertions(+) commit 445e9ca2d408b9936f101272b8f4cf87fb37609e Author: Sami Kerola Date: Sun Jul 3 20:13:42 2016 +0100 libmount, look: remove dead code [oclint] Signed-off-by: Sami Kerola libmount/src/context_mount.c | 1 - libmount/src/context_umount.c | 1 - misc-utils/look.c | 2 -- 3 files changed, 4 deletions(-) commit 7d55b2df2e29845ce4d096676507772c230fcea3 Author: Sami Kerola Date: Sun Jul 3 12:42:58 2016 +0100 syspriv: flip inverted logic [oclint] Signed-off-by: Sami Kerola sys-utils/setpriv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit da0788fb9782f5c13c345f462c91c1f8640c90c3 Author: Sami Kerola Date: Mon Jul 4 22:14:41 2016 +0100 logger: simplify if clause [oclint] This has effect of collapsing rather long indentation block, so commit separately. Signed-off-by: Sami Kerola misc-utils/logger.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) commit 92a4d098ce12994756c3a0527786609a83947224 Author: Sami Kerola Date: Mon Jul 4 22:12:55 2016 +0100 libblkid: simplify if clause [oclint] Move negative and positive testing of 'has' variable to top level, and test flag bit mask on second level. This way the 'has' needs to be checked only once. Signed-off-by: Sami Kerola libblkid/src/probe.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 01e6b621e4671eba42164405cbcdd5b5c7e9c352 Author: Sami Kerola Date: Mon Jul 4 22:16:54 2016 +0100 lslogins: simplify if clause and move definition and comments [oclint] The if clause change is pretty trivial. Moving the macro near to where it is used makes sense to people who want to read the code. And finally the comment about user list was at wrong spot. Signed-off-by: Sami Kerola login-utils/lslogins.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) commit 341154da281916a0cc04ec0d4712296bc3e7e69a Author: Sami Kerola Date: Sun Jul 3 12:30:46 2016 +0100 switch_root: simplify code and reduce indentation [oclint] The if statement in line 162 already ensures value of cfd to be 0 or greater, so the later if is not needed. Signed-off-by: Sami Kerola sys-utils/switch_root.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) commit 74ce680a3ef90503b26da0a34f04cf725f6c5beb Author: Sami Kerola Date: Mon Jul 4 22:09:10 2016 +0100 misc: simplify if clauses [oclint] Signed-off-by: Sami Kerola disk-utils/fsck.c | 31 +++++++++++++++---------------- disk-utils/fsck.cramfs.c | 11 ++++------- disk-utils/fsck.minix.c | 7 +++---- disk-utils/mkfs.cramfs.c | 15 ++++++--------- disk-utils/mkfs.minix.c | 8 ++------ lib/sysfs.c | 6 ++---- lib/timeutils.c | 6 ++---- libfdisk/src/dos.c | 26 ++++++++++++-------------- libfdisk/src/sgi.c | 5 ++--- libmount/src/fs.c | 9 ++++----- libmount/src/utils.c | 6 ++---- login-utils/sulogin.c | 6 ++---- login-utils/utmpdump.c | 5 ++--- login-utils/vipw.c | 7 +++---- misc-utils/cal.c | 6 ++---- misc-utils/mcookie.c | 6 ++---- misc-utils/uuidd.c | 5 ++--- sys-utils/dmesg.c | 13 +++++-------- sys-utils/ipcrm.c | 5 ++--- sys-utils/rtcwake.c | 9 +++------ sys-utils/setpriv.c | 10 ++++------ sys-utils/setsid.c | 6 ++---- term-utils/agetty.c | 25 ++++++++++--------------- term-utils/setterm.c | 8 +++----- text-utils/hexdump-parse.c | 15 ++++++--------- text-utils/tailf.c | 8 +++----- 26 files changed, 105 insertions(+), 159 deletions(-) commit 10e8d7a324202b87846599058037ae5695c5e58c Author: Karel Zak Date: Wed Jul 20 13:20:14 2016 +0200 agetty: call uname() only when necessary Signed-off-by: Karel Zak term-utils/agetty.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 1132e5aad18cd3cf5326a4afa342fcd246d6aa6d Author: Karel Zak Date: Wed Jul 20 13:16:13 2016 +0200 agetty: fix \S usage If \S without argument used then uninitialized 'varname' compared with ANSI_COLOR. Addresses: https://github.com/karelzak/util-linux/issues/329 Signed-off-by: Karel Zak term-utils/agetty.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) commit 78e7f78896f2c9cf1b2615c8c555a64dcd9d2642 Author: Karel Zak Date: Wed Jul 20 11:24:36 2016 +0200 Revert "sfdisk: exit with error if rereading partition table fails" This reverts commit 14f644f386a1708483ed446e983c0976e3976a9d. It seems we have mess in reread-after-write: all old versions to v2.20 -- returns 0 from v2.20 to v2.26 -- returns 1 since v2.26 -- returns 0 I think re-read errors should not be interpreted as fatal errors, because it's pretty common that you want to modify only one partition (e.g. resize) and then another partitions are probably still in use and re-read all PT does not make sense. What we need is to improve granularity for re-read and calls it only when really necessary (all PT modified) and otherwise call BLKPG (add/delete/resize) ioctls. Reported-by: Nikhil Valluru Signed-off-by: Karel Zak disk-utils/sfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f1f5f21ee664c232df1454a322f2570301ee1add Author: Sami Kerola Date: Mon Jul 18 21:49:27 2016 +0100 logger: remove trailing spaces when outputing to journal Issues: 1. Whitespace-ish \r is not stripped, while it should be. 2. In journal \r is considered unprintable. Lennart: "it is the duty of the client side to drop the trailing whitespace, which "logger" doesn't do". Reported-by: Ivan Babrou Explained-by: Lennart Poettering Reference: https://github.com/systemd/systemd/issues/3416 Signed-off-by: Sami Kerola misc-utils/logger.c | 7 ++----- tests/expected/logger/journald | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) commit 3f0e7f371a398a5b8ef23ff94651de13f4f987d3 Author: Tobias Stoeckmann Date: Sat Jul 16 12:51:42 2016 +0200 tailf: Fix previously adjusted segfault patch Casting the value to be checked to size_t renders the check useless. If st_size is SIZE_MAX+1, it will be truncated to 0 and the check succeeds. In fact, this check can never be false because every value stored in a size_t is smaller or equal to SIZE_MAX. I think this adjustment was meant to fix a compiler warning for 64 bit systems for which sizeof(off_t) is sizeof(size_t), but the signedness differs. Going unconditionally to the greatest possible unsigned int type if st_size is positive (off_t is signed) will fix this issue. Signed-off-by: Tobias Stoeckmann text-utils/tailf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b8fd5c055889edcefdd97afa2abb35b71e6fa369 Author: Karel Zak Date: Fri Jul 15 10:11:35 2016 +0200 tests: fix ttyutils test Signed-off-by: Karel Zak lib/ttyutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit aefd6a9d6a6c7626098439a5b9bbf6a9d28528c5 Author: Karel Zak Date: Thu Jul 14 13:20:58 2016 +0200 write: don't use strftime() Signed-off-by: Karel Zak term-utils/write.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit 85a37ca8d14060a29b46fc677eeed19c8a99db5e Merge: b236e43 285c1f3 Author: Karel Zak Date: Thu Jul 14 13:07:25 2016 +0200 Merge branch 'write-improvements' of git://github.com/kerolasa/lelux-utiliteetit * 'write-improvements' of git://github.com/kerolasa/lelux-utiliteetit: lib: try to find tty in get_terminal_name() write: stop removing and adding /dev/ in front of tty string write: tell when effective gid and tty path group mismatch write: improve coding style write: remove PUTC macro write: make timestamp to be obviously just a clock time write: remove unnecessary utmp variables write: improve function and variable names write: add control structure to clarify what is going on write: run atexit() checks at the end of execution write: use xstrncpy() from strutils.h write: set atime value in term_chk() only when needed write: remove pointless fileno(3) calls write: get rid of function prototypes write: remove unused variable commit b236e43ef052fa5d18b72b28338bae2f7f3e8b56 Author: Sami Kerola Date: Sat Jul 2 10:28:55 2016 +0100 sulogin: remove __nonnull__ function attribute This change fixes compiler option -Werror=nonnull option warning: login-utils/sulogin-consoles.c: In function 'append_console': login-utils/sulogin-consoles.c:324:14: warning: nonnull argument 'consoles' compared to NULL [-Wnonnull-compare] The NULL check done with list_empty() looks valid, so it is best to remove the function attribute that allows compiler to optimize the check away. Signed-off-by: Sami Kerola login-utils/sulogin-consoles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0d474d29c58f36085d3dfdfc22524e0870527e00 Author: James Clarke Date: Thu Jul 14 09:02:24 2016 +0100 tests: Fix fdisk/id and fdisk/mbr-nondos-mode on Sparc On Sparc, fdisk defaults to using SUN disk labels, which causes the output from these tests to differ from non-Sparc. Signed-off-by: James Clarke tests/expected/fdisk/id.sparc | 3 + tests/expected/fdisk/mbr-nondos-mode.sparc | 189 +++++++++++++++++++++++++++++ tests/ts/fdisk/id | 13 ++ tests/ts/fdisk/mbr-nondos-mode | 13 ++ 4 files changed, 218 insertions(+) commit 6bc4cc18e63e3a870f114b5183c9356119350151 Author: Allon Mureinik Date: Thu Jul 14 12:19:25 2016 +0200 blkdiscard: Improve man page Improve the grammar and phrasing of the --verbose option and how it interacts with the --step option. Signed-off-by: Allon Mureinik sys-utils/blkdiscard.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e3684760501439abce5b480e1d0a432a626e21f4 Author: Tobias Stoeckmann Date: Sun Jul 10 16:14:08 2016 +0200 tailf: Fix segmentation fault in tailf on 32 bit tailf crashes with a segmentation fault when used with a file that is exactly 4GB in size due to an integer overflow between off_t and size_t: $ dd if=/dev/zero of=tailf.crash bs=1 count=1 seek=4294967295 $ tailf tailf.crash Segmentation fault $ _ Signed-off-by: Tobias Stoeckmann Signed-off-by: Karel Zak text-utils/tailf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 04c163ed167ee5e28eff923263e0d6132759936c Author: Thierry Vignaud Date: Tue Jul 5 18:39:05 2016 +0200 fdisk: make -l behaves like fdisk -l aka having the same spacing between disks Signed-off-by: Karel Zak disk-utils/fdisk.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 50d1594c2e6142a3b51d2143c74027480df082e0 Author: Karel Zak Date: Tue Jul 12 13:34:54 2016 +0200 libblkid: avoid non-empty recursion in EBR This is extension to the patch 7164a1c34d18831ac61c6744ad14ce916d389b3f. We also need to detect non-empty recursion in the EBR chain. It's possible to create standard valid logical partitions and in the last one points back to the EBR chain. In this case all offsets will be non-empty. Unfortunately, it's valid to create logical partitions that are not in the "disk order" (sorted by start offset). So link somewhere back is valid, but this link cannot points to already existing partition (otherwise we will see recursion). This patch forces libblkid to ignore duplicate logical partitions, the duplicate chain segment is interpreted as non-data segment, after 100 iterations with non-data segments it will break the loop -- no memory is allocated in this case by the loop. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1349536 References: http://seclists.org/oss-sec/2016/q3/40 Signed-off-by: Karel Zak libblkid/src/partitions/dos.c | 7 +++++++ libblkid/src/partitions/partitions.c | 14 ++++++++++++++ libblkid/src/partitions/partitions.h | 2 ++ 3 files changed, 23 insertions(+) commit 6f27e449a9cbb96c4731207469aea7cbd8d0a5c4 Author: Karel Zak Date: Mon Jul 11 15:33:46 2016 +0200 chrt: add fallback to be usable on kernels without sched_{get,set}attr We have fallback for compilation with/without proper glibc and kernel headers, but it's not enough, because people can switch between kernels with and without the syscalls. (For example RT kernels for RHEL/CentOS). Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1353340 Signed-off-by: Karel Zak schedutils/chrt.c | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) commit 2cad2b32ff8e807e282cd7a5a8351b79a1b288c8 Author: Karel Zak Date: Mon Jul 11 12:36:51 2016 +0200 tests: mark chrt as TS_KNOWN_FAIL Signed-off-by: Karel Zak tests/ts/schedutils/chrt | 3 +++ 1 file changed, 3 insertions(+) commit b267ec301bdf224c6f23ce29f43b65a5f4167419 Author: Karel Zak Date: Mon Jul 11 11:54:31 2016 +0200 tests: make chrt test more debug-able Signed-off-by: Karel Zak tests/run.sh | 5 +++++ tests/ts/schedutils/chrt | 7 +++++++ 2 files changed, 12 insertions(+) commit 77604e87f3830f17164a512412b0e0eae332277c Author: Karel Zak Date: Mon Jul 11 11:12:47 2016 +0200 tests: mark chrt tests as root-only Signed-off-by: Karel Zak tests/ts/schedutils/chrt | 1 + 1 file changed, 1 insertion(+) commit 94fa9b4637b3555fac8646c93602d2c29d80b074 Author: Karel Zak Date: Mon Jul 11 11:01:14 2016 +0200 tests: implement ts_skip_subtest Signed-off-by: Karel Zak tests/functions.sh | 17 ++++++++++++----- tests/ts/schedutils/chrt | 12 ++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) commit 078720a76f275fc7858d6a02a9c7dbe9df5127f1 Author: Karel Zak Date: Mon Jul 11 10:25:13 2016 +0200 tests: add chrt test Signed-off-by: Karel Zak schedutils/chrt.c | 4 +- tests/commands.sh | 1 + tests/expected/schedutils/chrt | 0 tests/expected/schedutils/chrt-batch | 2 + tests/expected/schedutils/chrt-deadline | 9 +++ tests/expected/schedutils/chrt-fifo | 4 ++ tests/expected/schedutils/chrt-idle | 2 + tests/expected/schedutils/chrt-other | 2 + tests/expected/schedutils/chrt-rr | 4 ++ tests/ts/schedutils/chrt | 99 +++++++++++++++++++++++++++++++++ 10 files changed, 125 insertions(+), 2 deletions(-) commit 6e51ab0c5cabe63ee1b5b7577ed91b46358a5eab Author: Karel Zak Date: Thu Jul 7 15:02:20 2016 +0200 cfisk: add /dev/vda as another default disk And use array for all default alternative disks. Reported-by: Thierry Vignaud Signed-off-by: Karel Zak disk-utils/cfdisk.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) commit 7164a1c34d18831ac61c6744ad14ce916d389b3f Author: Karel Zak Date: Thu Jul 7 14:22:41 2016 +0200 libblkid: ignore extended partition at zero offset If the extended partition starts at zero LBA then MBR is interpreted as EBR and all is recursively parsed... result is out-of-memory. MBR --extended-partition--> EBR --> MBR --> ENB --> MBR ... Note that such PT is not possible to create by standard partitioning tools. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1349536 Signed-off-by: Karel Zak libblkid/src/partitions/dos.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) commit 285c1f3a3eda762897d45f698e94c461d68e8d68 Author: Sami Kerola Date: Sat May 14 19:50:41 2016 +0100 lib: try to find tty in get_terminal_name() Try all standard terminal input/output file descriptors when finding tty name in get_germinal_name(). This should make all invocations of the function as robust as they can get. Signed-off-by: Sami Kerola include/ttyutils.h | 2 +- lib/ttyutils.c | 15 +++++++++++++-- login-utils/login.c | 2 +- login-utils/su-common.c | 4 ++-- term-utils/write.c | 16 +++------------- 5 files changed, 20 insertions(+), 19 deletions(-) commit a58b90255c247efc455e6e84ffa0601b325ac090 Author: Sami Kerola Date: Sat May 14 19:39:37 2016 +0100 write: stop removing and adding /dev/ in front of tty string Add both path and tty name representations of tty's to control structure, that point to same string beginning from different depths. This way there is no need to removing and adding /dev/ in front of tty string all the time. Secondly this change makes it possible to use of get_terminal_name() from ttyutils.c. Signed-off-by: Sami Kerola term-utils/Makemodule.am | 1 + term-utils/write.c | 81 +++++++++++++++++++++++------------------------- 2 files changed, 39 insertions(+), 43 deletions(-) commit 50e417c8ad08e6a5d3c15adc39c16b6085b3cab6 Author: Sami Kerola Date: Sat May 7 23:44:17 2016 +0100 write: tell when effective gid and tty path group mismatch Most commonly this error happens when write(1) executable does not have correct group ownership and setgid bit. The earlier message was unclear what exactly was wrong. $ mesg is y $ write testuser write: you have write permission turned off Alternatively the 'getegid() == s.st_gid' could be considered unnecessary. Afterall if to write to destination tty is denied that does not go unnoticed at thet time when tty is opened. Reviewed-by: Benno Schulenberg Signed-off-by: Sami Kerola term-utils/write.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 5592bf0d9aa71d617ae540071ef7d6a8b611449f Author: Sami Kerola Date: Sun May 8 21:00:21 2016 +0100 write: improve coding style Signed-off-by: Sami Kerola term-utils/write.c | 71 +++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) commit a8031743eaea418a9512c426f5678ea53e943ceb Author: Sami Kerola Date: Sat May 14 16:40:45 2016 +0100 write: remove PUTC macro Function like macros make following the execution flow unnecessarily difficult, and deserves to be removed. Requested-by: Karel Zak Signed-off-by: Sami Kerola term-utils/write.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) commit a07943926612bd62bf302b50537616b0917c8a63 Author: Sami Kerola Date: Sat May 7 21:07:44 2016 +0100 write: make timestamp to be obviously just a clock time By looking the code one will had hard time knowing that a slice of ctime() from characters 11 to 16 is HH:MM time format. Use of strftime("%H:%M") makes this a lot less mysterious. In same go make \007 hex printouts to be \a that is the same thing: alarm. Signed-off-by: Sami Kerola term-utils/write.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit c1d0a95eea8a1e3f05d78f734f0c93ef97b6b7e5 Author: Sami Kerola Date: Sat May 7 12:50:01 2016 +0100 write: remove unnecessary utmp variables glibc documentation tells getutent() calls are not thread safe, and recommends to copy the context of the structures when information is wished to be stored. This leads to excessive copying, that in this case is not relevant. write(1) is single threaded program and there is no reason to assume this would change in future. Reference: http://www.gnu.org/software/libc/manual/html_node/Manipulating-the-Database.html Signed-off-by: Sami Kerola term-utils/write.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) commit d732758e6548b65a6bab5dffc35301f466eec416 Author: Sami Kerola Date: Sat May 7 12:36:44 2016 +0100 write: improve function and variable names Signed-off-by: Sami Kerola term-utils/write.c | 73 ++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 38 deletions(-) commit b5a6937961ec9146883ad107b588ff41f6f3a278 Author: Sami Kerola Date: Sat May 7 12:02:12 2016 +0100 write: add control structure to clarify what is going on This is done purely an improve readability of the source code. Signed-off-by: Sami Kerola term-utils/write.c | 96 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 42 deletions(-) commit 97ebab4ea82103ca17c23489041b24231bf24e2e Author: Sami Kerola Date: Sat May 7 08:33:57 2016 +0100 write: run atexit() checks at the end of execution Earlier use of _exit() caused program to terminate abnormally from atexit() perspective and standard file descriptor close checks did not run resulting to blindness if writes were successful, or not. Easy fix is to avoid running _exit() altogether. Signed-off-by: Sami Kerola term-utils/write.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) commit e4aaa0e5932e12671d209a5fcf60f4775b7820a8 Author: Sami Kerola Date: Sat May 7 00:20:32 2016 +0100 write: use xstrncpy() from strutils.h Earlier if the tty path was exactly length of the maximum ut_line then last character of the path was overwrote by \0. This is in practise theoretical bug, as it is unheard that a tty device path could be 32 characters long. Signed-off-by: Sami Kerola term-utils/write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 489a0fd2f55b2bb0aefeef8a9a1514cf63ea8342 Author: Sami Kerola Date: Fri May 6 23:38:11 2016 +0100 write: set atime value in term_chk() only when needed The search_utmp() is needs atime but main() does not, so remove the later. Signed-off-by: Sami Kerola term-utils/write.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 59f3d6ae123851da79e77b4c85f842aac413ccf8 Author: Sami Kerola Date: Fri May 6 23:27:17 2016 +0100 write: remove pointless fileno(3) calls Signed-off-by: Sami Kerola term-utils/write.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit b985f37240f0f6b6846f15a0c2c1a2c40703bf8a Author: Sami Kerola Date: Fri May 6 22:47:41 2016 +0100 write: get rid of function prototypes Marking functions static and writing them in order where functions are introduced before use is enough. Signed-off-by: Sami Kerola term-utils/write.c | 273 ++++++++++++++++++++++++++--------------------------- 1 file changed, 132 insertions(+), 141 deletions(-) commit 1baec22b084af28bac608c27321dae5043ed45a6 Author: Sami Kerola Date: Fri May 6 22:43:26 2016 +0100 write: remove unused variable Signed-off-by: Sami Kerola term-utils/write.c | 4 ---- 1 file changed, 4 deletions(-) commit 99ae5a4956b0de8de152edf0992181b52ff9f62b Author: Karel Zak Date: Fri Jul 1 15:42:50 2016 +0200 lsns: check for OOM Signed-off-by: Karel Zak sys-utils/lsns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f29bc6e1cc4ed9f76bded543c6ab393f674ec3ed Author: Karel Zak Date: Fri Jul 1 14:45:04 2016 +0200 lslocks: add --noinaccessible * add --noinaccessible to not print incomplete information * make incomplete paths more visible (append "...") * don't print 0B size if lock file inaccessible Signed-off-by: Karel Zak misc-utils/lslocks.8 | 8 +++++-- misc-utils/lslocks.c | 64 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 27 deletions(-) commit 29fdedc2bc99a990857200cf357447351900c117 Merge: 6c448f4 3d47107 Author: Karel Zak Date: Fri Jul 1 13:51:59 2016 +0200 Merge branch 'utmpdump' of git://github.com/kerolasa/lelux-utiliteetit * 'utmpdump' of git://github.com/kerolasa/lelux-utiliteetit: docs: add file format note to utmpdump manual page tests: utmpdump add subsecond accuracy test tests: challenge utmpdump localization go-around tests: fix utmpdump timestamps to be in iso format utmpdump: use iso-8601 timestamp format with subsecond accuracy libcommon: add ISO_8601_GMTIME that will print UTC-0 timestamps utmpdump: use always UTC-0 timezone in textual output commit 6c448f452e380a76eec5b93ae6994ec7fed09354 Author: Alexey Obitotskiy Date: Fri Jun 24 11:59:35 2016 +0200 libblkid: Add metadata signature check for IMSM on 4Kn drives Drives with 512 and 4K sectors have different offset for metadata signature. Without signature detected on 4Kn drives those drives will not be recognized as raid member. This patch adds checking for IMSM signature for 4Kn drives. Signed-off-by: Alexey Obitotskiy libblkid/src/superblocks/isw_raid.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit 3383b2f5caa92376c0e2762622547617090fb675 Author: Karel Zak Date: Thu Jun 30 14:00:44 2016 +0200 agetty: don't modify argv[] when parse speeds Signed-off-by: Karel Zak term-utils/agetty.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 3d47107de5d04fe2803827d3e24c227a18d1a4b0 Author: Sami Kerola Date: Mon Jun 27 20:38:27 2016 +0100 docs: add file format note to utmpdump manual page Tell that the old textual format that does not use full utmp time precision, and has issues with timezones. Warn also that the textual format may become incompatible, although there are no plans in foreseeable future to do so. Signed-off-by: Sami Kerola login-utils/utmpdump.1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit b5ef1507df78a4e7e08a1fdc94595528a4c1561c Author: Sami Kerola Date: Sun May 15 10:55:54 2016 +0100 tests: utmpdump add subsecond accuracy test Signed-off-by: Sami Kerola tests/expected/utmp/utmpdump-subsecond | 5 +++++ tests/ts/utmp/subsec | 3 +++ tests/ts/utmp/utmpdump-subsecond | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) commit 73f46aedc316efbb8e2a719c1c6c3aef364a5553 Author: Sami Kerola Date: Sun May 15 10:42:25 2016 +0100 tests: challenge utmpdump localization go-around The utmpdump timestamps are unambiguous, they always use UTC-0 regardless of localization. If thesse tests starts to fail after this change then the timezone forcing is not working. Signed-off-by: Sami Kerola tests/ts/utmp/utmpdump-circle | 2 +- tests/ts/utmp/utmpdump-tobin | 2 +- tests/ts/utmp/utmpdump-tobin-ipv6 | 2 +- tests/ts/utmp/utmpdump-totxt | 2 +- tests/ts/utmp/utmpdump-totxt-ipv6 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) commit a17e7d7fab28efbcc9ca59a6a992ddcd5ede5c11 Author: Sami Kerola Date: Sun May 15 10:32:20 2016 +0100 tests: fix utmpdump timestamps to be in iso format The utmpdump-circle is slightly modified to use old timestamp format as basis of conversion and to do cyclic conversion via new format. This is better from test coverage point of view. Signed-off-by: Sami Kerola tests/expected/utmp/utmpdump-totxt | 20 ++++++++--------- tests/expected/utmp/utmpdump-totxt-ipv6 | 4 ++-- tests/ts/utmp/txt-a | 38 ++++++++++++++++----------------- tests/ts/utmp/txt-a-old | 19 +++++++++++++++++ tests/ts/utmp/txt-b | 20 ++++++++--------- tests/ts/utmp/txt-b-old | 10 +++++++++ tests/ts/utmp/txt-ipv6 | 4 ++-- tests/ts/utmp/txt-ipv6-old | 2 ++ tests/ts/utmp/utmpdump-circle | 8 ++++++- 9 files changed, 81 insertions(+), 44 deletions(-) commit 1173d0a6bfff4db43c1690403992c17a82cba0bb Author: Sami Kerola Date: Sun May 15 10:25:48 2016 +0100 utmpdump: use iso-8601 timestamp format with subsecond accuracy Newer 'struct utmp' is using 'struct timeval' to represent login and logout times, so include the maximum accuracy to textual utmp format. Notice that this change does not remove support of converting earlier textual formats back to binary. But conversions from binary to former format will no longer be available. Signed-off-by: Sami Kerola login-utils/Makemodule.am | 1 + login-utils/utmpdump.c | 63 ++++++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 26 deletions(-) commit c1616946825e7f4ae9769e2846e9ad63a7ba369c Author: Sami Kerola Date: Sun Jun 19 21:43:40 2016 +0100 libcommon: add ISO_8601_GMTIME that will print UTC-0 timestamps When timestamps are intented to be conversable back from string to binary it is best to stick with UTC-0 timezone. This is needed in utmpdump(1). Signed-off-by: Sami Kerola include/timeutils.h | 3 ++- lib/timeutils.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) commit 3749bdcecfb799619555de2eff9636cb93509eb5 Author: Sami Kerola Date: Sun May 15 09:50:40 2016 +0100 utmpdump: use always UTC-0 timezone in textual output Converting a time structure from text format that has timezone markup is practically impossible. See reference links for more information. This leads to situation where multiple utmpdump(1) conversions from binary to text and back make timestamps to shift amount of timezone offset to UTC-0. The easiest way to make multiple conversions to work without timeshifts is to always use UTC-0 timezone. Downside of this approach is that the textual format is less human readable than local timestamps would be. Reference: http://www.catb.org/esr/time-programming/#_strptime_3_and_getdate_3 Reference: http://man7.org/linux/man-pages/man3/strptime.3.html Signed-off-by: Sami Kerola login-utils/utmpdump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ac681a310c32319423297544833932f4d689a7a2 Author: Torsten Hilbrich Date: Mon Jun 20 07:09:10 2016 +0200 liblkid: Add length check in probe_nilfs2 before crc32 The bytes variable is read from the file system to probe and must be checked before used as length parameter in the crc32 call. The following problems may occur here: - bytes smaller than sumoff + 4: underflow in length calculation - bytes larger than remaining space in sb: overflow of buffer This fixes a problem where an encrypted volume had the correct magic values 0x3434 at offset 0x406 and the following uint16_t (which is read into the nilfs_super_block.s_bytes struct) was parsed as 1. Then crc32 was called with the length value 18446744073709551597 causing a segmentation fault. [kzak@redhat.com: - fix probe_nilfs2() return code] Signed-off-by: Karel Zak libblkid/src/superblocks/nilfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 81a307bd4d906815dad7b6b3c355f663907a68c4 Author: Karel Zak Date: Fri Jun 24 11:07:00 2016 +0200 lscpu: make lookup_cache() more robust Signed-off-by: Karel Zak sys-utils/lscpu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit bfbe985eb456c43825454d72ce6f37bf16a2b719 Author: Heiko Carstens Date: Wed Jun 22 09:26:01 2016 +0200 lscpu: fix MMHZ column entry within man page The indentation for the MMHZ column within the man page is wrong. Also there doesn't exist any column with the name MMHZ. The correct names would be MAXMHZ and MINMHZ. Therefore rename MMHZ to MAXMHZ and add the missong MINMHZ entry. Signed-off-by: Heiko Carstens sys-utils/lscpu.1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 8eb9604a341871e2c10c57c6b5cd8dba54fab577 Author: Heiko Carstens Date: Wed Jun 22 09:26:00 2016 +0200 lscpu: update s390-lpar-drawer testcase I noticed that the "cpu" line within /proc/cpuinfo has a different meaning on powerpc and sparc than on s390. On s390 it represents the cpu number while on powerpc and sparc it represent the model name. Given that the s390 kernel patch which adds the "cpu" line to /proc/cpuinfo hasn't been merged into the kernel yet, I changed that line to "cpu number" to avoid the unnecessary conflict. Therefore this patch updates the testcase, which mainly changes the contents of /proc/cpuinfo. Signed-off-by: Heiko Carstens tests/expected/lscpu/lscpu-s390-lpar-drawer | 3 +-- tests/ts/lscpu/dumps/s390-lpar-drawer.tar.gz | Bin 18125 -> 18131 bytes 2 files changed, 1 insertion(+), 2 deletions(-) commit 28b1658f8b5b3c9fdd971201de6e95abb33526a9 Author: Heiko Carstens Date: Wed Jun 22 09:25:59 2016 +0200 lscpu: show additional caches (s390) The Linux kernel exposes the cache topology via sysfs. However on virtualized machines like s390 the cache topology contains only cpu private caches. For shared caches it is not known which cpus share them. The hypervisor would have to update this information whenever a virtual cpu would be scheduled on a different physical cpu and make the guest aware of that change. Given that there is hardly any benefit, if it all, this isn't done. However it is still of interest to know about the non-private caches. Therefore this information is available via /proc/cpuinfo at least on s390. This patch adds additional lines to the summary output for all shared caches for which information can be found in /proc/cpuinfo, since we know these aren't exposed via sysfs. Signed-off-by: Heiko Carstens sys-utils/lscpu.c | 70 +++++++++++++++++++++++++++++ tests/expected/lscpu/lscpu-s390-lpar-drawer | 2 + 2 files changed, 72 insertions(+) commit 0c28f0c8151a8ac41e12b672643a5beda82f09b4 Author: Heiko Carstens Date: Wed Jun 22 09:25:58 2016 +0200 lscpu: show machine type (s390) Show also the machine type within the lscpu output. With the machine type it is possible to identify the cpu generation and the supported features. Signed-off-by: Heiko Carstens sys-utils/lscpu.c | 12 ++++++++++++ tests/expected/lscpu/lscpu-s390-kvm | 1 + tests/expected/lscpu/lscpu-s390-lpar | 1 + tests/expected/lscpu/lscpu-s390-lpar-drawer | 1 + tests/expected/lscpu/lscpu-s390-zvm | 1 + 5 files changed, 16 insertions(+) commit 4632b28811c9d2d63a90a78f79244ab614bd9033 Author: Heiko Carstens Date: Wed Jun 22 09:25:57 2016 +0200 lscpu: show static and dynamic MHz (s390) s390 machines provide static and dynamic cpu mhz information via /proc/cpuinfo. The static cpu mhz is the normal cpu frequency a cpu is supposed to run with. The dynamic cpu mhz is the actual frequency a cpu is running with. This is usually the same as the static cpu mhz. Note that this values are different to the min/max mhz values available on other architecutes. The min/max values are unknown. This patch adds two new fields to the summary output which display these two values. Signed-off-by: Heiko Carstens sys-utils/lscpu.c | 8 ++++++++ tests/expected/lscpu/lscpu-s390-lpar-drawer | 2 ++ 2 files changed, 10 insertions(+) commit 156740ca3779faf4aa58deb7cde2ffd356a1bd5c Author: Heiko Carstens Date: Wed Jun 22 09:25:56 2016 +0200 lscpu: fix typo in summary output The new drawer support did have a type in the summary output: it reported Drawers(s) instead of Drawer(s). Fix this. Signed-off-by: Heiko Carstens sys-utils/lscpu.c | 2 +- tests/expected/lscpu/lscpu-s390-lpar-drawer | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 08fb47ad827cf54a57917c1082082c57d8e6425d Author: Heiko Carstens Date: Tue Jun 14 12:38:08 2016 +0200 lscpu: add s390 drawer testcase Add a new s390 testcase so we get some coverage for the new drawer cpu topology level. Signed-off-by: Heiko Carstens tests/expected/lscpu/lscpu-s390-lpar-drawer | 35 +++++++++++++++++++++++++++ tests/ts/lscpu/dumps/s390-lpar-drawer.tar.gz | Bin 0 -> 18125 bytes 2 files changed, 35 insertions(+) commit b3adf6ef6676ca8c10ecdda3e1c92a861df3b885 Author: Heiko Carstens Date: Tue Jun 14 09:22:34 2016 +0200 lscpu: add drawer support The s390 architecture gained another cpu topology level called "drawer" which is above the book level. Add support for this to lscpu. Signed-off-by: Heiko Carstens sys-utils/lscpu.1 | 5 ++++- sys-utils/lscpu.c | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 47 insertions(+), 9 deletions(-) commit f88eeb25f2eb89fdbd35a9dfbaa26e234a3b0e14 Author: Karel Zak Date: Tue Jun 21 14:21:30 2016 +0200 libfdisk: cleanup fdisk_gpt_set_npartitions() Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/gpt.c | 22 +++++++++++++++++----- libfdisk/src/libfdisk.h.in | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) commit 0a7cdf80606cc0670ef7f740d37640b05932e0ce Author: Karel Zak Date: Tue Jun 21 14:06:14 2016 +0200 libfdisk: (gpt) be more careful with 64bit constants It's probably more robust (and readable) to be explicit when we count with constant and 64bit numbers. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1344482 Signed-off-by: Karel Zak libfdisk/src/gpt.c | 56 ++++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) commit 1c7227598824b1d9140298e9fe5742cae4131130 Author: Karel Zak Date: Tue Jun 21 13:32:14 2016 +0200 logger: be more precise about --port description Signed-off-by: Karel Zak misc-utils/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7f787ced5d401ccd56a82bb2b1202f1ea7164783 Author: Karel Zak Date: Tue Jun 14 13:55:27 2016 +0200 libblkid: don't check nonnull attributes for NULL [-Wnonnull-compare] Signed-off-by: Karel Zak libblkid/src/blkid.h.in | 142 +++++++++++++++++++++------------ libblkid/src/partitions/partitions.c | 48 ++++------- libblkid/src/probe.c | 106 +++++++----------------- libblkid/src/read.c | 3 - libblkid/src/save.c | 3 - libblkid/src/superblocks/superblocks.c | 10 +-- libblkid/src/tag.c | 6 -- libblkid/src/topology/topology.c | 4 +- 8 files changed, 135 insertions(+), 187 deletions(-) commit 372d410d9e2ffd300cc7e264646c6cdd70e022a6 Author: Karel Zak Date: Tue Jun 14 13:55:27 2016 +0200 libmount: don't check nonnull attributes for NULL [-Wnonnull-compare] Signed-off-by: Karel Zak libmount/src/context.c | 2 +- libmount/src/context_loopdev.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit dd5ef107adfe2c05f7d2e3e3543d3c042868b6fb Author: Karel Zak Date: Tue Jun 14 13:15:44 2016 +0200 chfn: chsh: use selinux_check_passwd_access() * selinux/av_permissions.h and magic constants are deprecated, the recommended solution is to use string_to_security_class() and string_to_av_perm() to get access vector * it also seems that selinux_check_passwd_access() does exactly the same as our checkAccess(), let's use it. Signed-off-by: Karel Zak login-utils/chfn.c | 5 +++-- login-utils/chsh.c | 5 +++-- login-utils/selinux_utils.c | 30 ++++-------------------------- login-utils/selinux_utils.h | 7 ++++++- 4 files changed, 16 insertions(+), 31 deletions(-) commit 3d7cad18e79640dfd00e43ba4b789359c8469e8b Author: Karel Zak Date: Thu Jun 9 12:39:44 2016 +0200 build-sys: remove global dependence between widechar and ncursesw It seems that globally defined dependence between ncursesw and wide-char support is overkill, because in some cases (e.g. cal(1)) we can use ncurses independently on wide-char support. It would be better to care about relation between wide-char and ncurses individually (per util). Signed-off-by: Karel Zak configure.ac | 4 ---- 1 file changed, 4 deletions(-) commit 4a62215c842e61efef31b1f2b3e02af88e12a942 Author: Karel Zak Date: Thu Jun 9 12:10:33 2016 +0200 tests: fix for non-ncurses version Signed-off-by: Karel Zak tests/functions.sh | 9 +++++++++ tests/ts/cal/color | 5 +++++ tests/ts/cal/colorw | 5 +++++ tests/ts/cal/weekarg | 5 +++++ 4 files changed, 24 insertions(+) commit 58149472adcbd8f307e2ed9ff3892bd47fbe4658 Author: Karel Zak Date: Thu Jun 9 11:39:24 2016 +0200 cal: cleanup non-ncurses build misc-utils/cal.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) commit db4e264574dd1b123476918979abcc739fa9d67a Author: Karel Zak Date: Wed Jun 8 13:38:48 2016 +0200 build-sys: workaround for autoconf "present but cannot be compiled" See also: https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Present-But-Cannot-Be-Compiled.html Signed-off-by: Karel Zak configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit dfe177dadb510a93c6c6de94c0174b421cad476f Author: Karel Zak Date: Wed Jun 8 12:24:10 2016 +0200 build-sys: add non-action for ncurses pkg-cong test Signed-off-by: Karel Zak configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 18dae5d87999d4e8fff4c0ee19b54a0b24ac61bb Author: Karel Zak Date: Wed Jun 8 12:03:15 2016 +0200 build-sys: clean up relation between ncurses[w] and wide-char support * error if wide-char enabled/supported, but (non-wide) ncurses explicitly requested * disable ncurses at all if widechar enabled/supported, but ncursesw not found Reported-by: Stanislav Brabec Signed-off-by: Karel Zak configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+) commit 4ffcc7a93e1acfa4a6cb804ddfd840ed649aef95 Author: Karel Zak Date: Wed Jun 8 11:31:31 2016 +0200 build-sys: cleanup --with-ncurses * don't use UL_CHECK_LIB(), only use pkg-config to avoid complexity * split --with-ncursesw and --with-ncurses; ncurses (widechar) is the default, check for ncurses only if ncursesw disabled/unavailabled * don't use generic placeholders, just have_ncursesw and have_ncurses Signed-off-by: Karel Zak configure.ac | 91 ++++++++++++++++++++++++------------------------------------ 1 file changed, 37 insertions(+), 54 deletions(-) commit fe5a9bcfcd1ffcb085161e2b241f89e9941842d4 Author: Daniel Shahaf Date: Fri Jun 3 21:27:49 2016 +0000 ionice: clarify description of --classdata Before this patch, it wasn't clear whether '0' or '7' should be used to specify "highest priority". (The answer could have been inferred from the 'Examples' section of the man page.) Signed-off-by: Daniel Shahaf schedutils/ionice.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bac7fbdb2d141879526ca4342d56d2c749ba8af5 Author: Waldemar Brodkorb Date: Fri Jun 3 04:23:28 2016 +0200 build-sys: fix uClibc-ng scanf check uClibc-ng tries to be compatible with GNU libc and defines __GLIBC__ and pretend to be version 2.2. We once changed it to 2.10, but then some hard to fix problems in different software packages (gcc) occured. It would be better if we disable the special GNU libc checks for uClibc-ng here. uClibc-ng implements the required scanf functionality. Signed-off-by: Waldemar Brodkorb configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 324e52a5cf5a7016807c81e8c9d668aa8fad8b34 Author: Karel Zak Date: Fri Jun 3 14:51:01 2016 +0200 more: don't include ncurses.h, fix for non-widechar It seems our crazy widechar.h is in conflict with ncurses, but it seems that nothing in more.c requires anything from ncurses. All we need is probably . Signed-off-by: Karel Zak text-utils/more.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit e19916c89d4137dc8497cbe49c9a6cccd11c7e45 Author: Karel Zak Date: Fri Jun 3 14:50:48 2016 +0200 include/widechar: add fallback for WEOF Signed-off-by: Karel Zak include/widechar.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit c191740c285a71b8ab5bbf4a429a14d0459b2d10 Author: Karel Zak Date: Fri Jun 3 14:46:17 2016 +0200 misc: cleanup non-widechar compilation Signed-off-by: Karel Zak lib/mbsalign.c | 7 ++++++- libsmartcols/src/table.c | 1 - libsmartcols/src/table_print.c | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) commit 92312207e718bccce377dd24f3a1ad1720768354 Author: Karel Zak Date: Fri Jun 3 14:41:04 2016 +0200 include/widechar: add missing fallbacks Signed-off-by: Karel Zak include/widechar.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit d67f61c06d079c6f999505fa41921e5f93fa62d0 Author: Karel Zak Date: Fri Jun 3 13:42:40 2016 +0200 build-sys: use UL_DEFAULT_ENABLE() only for programs The UL_DEFAULT_ENABLE modifies $enable_ according to the global --enable-all-programs. This makes sense only for programs, but not for any built-in code. Signed-off-by: Karel Zak configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4cb6fea5ccd7ce5e258c52160de167dd7aa24494 Author: Karel Zak Date: Fri Jun 3 13:41:51 2016 +0200 build-sys: add --disable-widechar Signed-off-by: Karel Zak configure.ac | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) commit 2bd0b84f18c935e9d66be545049686ab7646cb9a Author: Karel Zak Date: Fri Jun 3 13:37:15 2016 +0200 build-sys: add UL_REQUIRES_COMPILE macro Signed-off-by: Karel Zak m4/ul.m4 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) commit 9907a95a7dafd01dd85a44abf8405096a76ae4e5 Author: Karel Zak Date: Fri Jun 3 12:20:24 2016 +0200 cfdisk: use libsmartcols ASCII for non-widechar environment Reported-by: Stanislav Brabec Signed-off-by: Karel Zak disk-utils/cfdisk.c | 4 ++++ 1 file changed, 4 insertions(+) commit 4a423fb963d4cd87e9e5c75c77e1ac5d1ea2417f Author: Karel Zak Date: Fri Jun 3 12:18:21 2016 +0200 lib/mbsalign: fix for non-widechar Signed-off-by: Karel Zak lib/mbsalign.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit cce05a2a8185b1b8bed68e59f07c0b969d7c6d23 Author: Karel Zak Date: Fri Jun 3 10:20:03 2016 +0200 build-sys: fix comments in ul.m4 Signed-off-by: Karel Zak m4/ul.m4 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) commit 3d305170f0240feb804fa5075141751b5650e9c9 Author: Karel Zak Date: Thu Jun 2 14:41:08 2016 +0200 lsblk: improve support for nvme Signed-off-by: Karel Zak misc-utils/lsblk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 638402edb039d58df04cc9aaf48e08fe184b3b4b Author: Karel Zak Date: Thu Jun 2 14:40:13 2016 +0200 lib/sysfs: be more smart for non-scsi devices Signed-off-by: Karel Zak include/sysfs.h | 3 ++- lib/sysfs.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) commit 8f0ac5792191499292a2d23c8ebd743695af70b7 Author: Karel Zak Date: Thu Jun 2 12:31:45 2016 +0200 lib/ttyutils: use stdout for get_terminal_width() We use the function to be sure with *output* width. Note that the current code (with STDIN) is broken because in some situations libsmartcols is not able to detect terminal width and fall back to default 80. Signed-off-by: Karel Zak lib/ttyutils.c | 4 ++-- libsmartcols/src/table_print.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit b1fd64eb793b49c3b12d6bdd61f3c2bc67796175 Author: Karel Zak Date: Wed Jun 1 15:04:07 2016 +0200 tests: check for mount(8) in minix test Signed-off-by: Karel Zak tests/ts/minix/mkfs | 2 ++ 1 file changed, 2 insertions(+) commit 65c74885df72750d347276d857f3c95a2b5983d9 Author: Karel Zak Date: Wed Jun 1 14:55:15 2016 +0200 fsck.minix: fix endless loop and out of stack It seems there is no elegant way how to recovery if a directory i_zone (and i_size) is out of reality. Let's require human interaction to avoid endless loop when executed with --auto, etc. Addresses: https://github.com/karelzak/util-linux/issues/228 Signed-off-by: Karel Zak disk-utils/fsck.minix.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit d1b7bfe5068d4aa3ee37d3755f0020aaa839b087 Author: Sebastian Rasmussen Date: Sun May 29 22:11:52 2016 +0200 fdisk: Fix typo RequiredPartiton -> RequiredPartition This typo fix is backwards compatible in that fdisk will accept both the GPT attribute RequiredPartition and RequiredPartiton with the typo. Update documentation and tests to all use the new attribute name. Signed-off-by: Sebastian Rasmussen disk-utils/sfdisk.8 | 4 +- libfdisk/src/gpt.c | 7 +- tests/expected/libfdisk/gpt-all-defaults-with-typo | 21 + tests/expected/sfdisk/gpt-attrs | 2 +- tests/expected/sfdisk/gpt-attrs-with-typo | 1110 ++++++++++++++++++++ tests/ts/libfdisk/gpt | 13 + tests/ts/sfdisk/gpt | 10 +- 7 files changed, 1162 insertions(+), 5 deletions(-) commit 9e93004171eb0c4c288051b2d7bb37f97a0ae430 Author: Sebastian Rasmussen Date: Sun May 29 23:11:53 2016 +0200 misc: Fix various typos Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen disk-utils/cfdisk.c | 2 +- disk-utils/fdisk-menu.c | 6 +++--- disk-utils/fdisk.c | 2 +- disk-utils/fsck.c | 6 +++--- disk-utils/fsck.minix.c | 6 +++--- disk-utils/mkfs.cramfs.c | 2 +- disk-utils/mkfs.minix.c | 6 +++--- disk-utils/mkswap.c | 2 +- disk-utils/sfdisk.c | 10 +++++----- include/color-names.h | 2 +- include/cpuset.h | 2 +- include/debug.h | 2 +- include/plymouth-ctrl.h | 2 +- include/statfs_magic.h | 2 +- include/sysfs.h | 2 +- lib/blkdev.c | 2 +- lib/canonicalize.c | 2 +- lib/colors.c | 4 ++-- lib/crc32.c | 2 +- lib/langinfo.c | 2 +- lib/loopdev.c | 6 +++--- lib/plymouth-ctrl.c | 6 +++--- lib/strutils.c | 2 +- lib/sysfs.c | 6 +++--- libblkid/samples/mkfs.c | 2 +- libblkid/samples/partitions.c | 2 +- libblkid/samples/superblocks.c | 2 +- libblkid/samples/topology.c | 2 +- libblkid/src/blkidP.h | 6 +++--- libblkid/src/cache.c | 2 +- libblkid/src/dev.c | 4 ++-- libblkid/src/devname.c | 2 +- libblkid/src/evaluate.c | 2 +- libblkid/src/init.c | 6 +++--- libblkid/src/partitions/dos.c | 4 ++-- libblkid/src/partitions/gpt.c | 8 ++++---- libblkid/src/partitions/mac.c | 2 +- libblkid/src/partitions/partitions.c | 30 +++++++++++++++--------------- libblkid/src/partitions/solaris_x86.c | 4 ++-- libblkid/src/partitions/sun.c | 2 +- libblkid/src/partitions/unixware.c | 2 +- libblkid/src/probe.c | 18 +++++++++--------- libblkid/src/superblocks/gfs.c | 2 +- libblkid/src/superblocks/highpoint_raid.c | 2 +- libblkid/src/superblocks/iso9660.c | 6 +++--- libblkid/src/superblocks/linux_raid.c | 2 +- libblkid/src/superblocks/lvm.c | 2 +- libblkid/src/superblocks/superblocks.c | 12 ++++++------ libblkid/src/superblocks/sysv.c | 2 +- libblkid/src/tag.c | 6 +++--- libblkid/src/topology/evms.c | 2 +- libblkid/src/topology/sysfs.c | 4 ++-- libblkid/src/topology/topology.c | 4 ++-- libblkid/src/version.c | 2 +- libfdisk/src/alignment.c | 14 +++++++------- libfdisk/src/ask.c | 14 +++++++------- libfdisk/src/bsd.c | 4 ++-- libfdisk/src/context.c | 16 ++++++++-------- libfdisk/src/dos.c | 16 ++++++++-------- libfdisk/src/fdiskP.h | 10 +++++----- libfdisk/src/field.c | 4 ++-- libfdisk/src/gpt.c | 14 +++++++------- libfdisk/src/init.c | 2 +- libfdisk/src/item.c | 6 +++--- libfdisk/src/label.c | 12 ++++++------ libfdisk/src/partition.c | 12 ++++++------ libfdisk/src/parttype.c | 12 ++++++------ libfdisk/src/script.c | 16 ++++++++-------- libfdisk/src/sgi.c | 2 +- libfdisk/src/sun.c | 4 ++-- libfdisk/src/table.c | 8 ++++---- libmount/python/context.c | 12 ++++++------ libmount/python/fs.c | 4 ++-- libmount/python/pylibmount.c | 2 +- libmount/python/tab.c | 4 ++-- libmount/src/btrfs.c | 2 +- libmount/src/context.c | 24 ++++++++++++------------ libmount/src/context_mount.c | 2 +- libmount/src/context_umount.c | 2 +- libmount/src/fs.c | 2 +- libmount/src/init.c | 2 +- libmount/src/lock.c | 4 ++-- libmount/src/optmap.c | 4 ++-- libmount/src/tab.c | 8 ++++---- libmount/src/tab_parse.c | 4 ++-- libmount/src/utils.c | 2 +- libsmartcols/samples/continuous.c | 6 +++--- libsmartcols/samples/title.c | 6 +++--- libsmartcols/samples/tree.c | 6 +++--- libsmartcols/samples/wrap.c | 6 +++--- libsmartcols/src/smartcolsP.h | 2 +- libsmartcols/src/symbols.c | 4 ++-- libsmartcols/src/table.c | 6 +++--- libsmartcols/src/table_print.c | 22 +++++++++++----------- login-utils/last.c | 4 ++-- login-utils/login.c | 4 ++-- login-utils/lslogins.c | 2 +- login-utils/su-common.c | 2 +- login-utils/sulogin-consoles.c | 2 +- login-utils/sulogin.c | 4 ++-- misc-utils/blkid.c | 2 +- misc-utils/cal.c | 4 ++-- misc-utils/findmnt.c | 6 +++--- misc-utils/kill.c | 4 ++-- misc-utils/logger.c | 4 ++-- misc-utils/lsblk.c | 12 ++++++------ misc-utils/lslocks.c | 2 +- misc-utils/test_uuidd.c | 2 +- misc-utils/uuidd.c | 2 +- sys-utils/dmesg.c | 10 +++++----- sys-utils/fstrim.c | 4 ++-- sys-utils/hwclock-cmos.c | 2 +- sys-utils/ipcutils.c | 2 +- sys-utils/lscpu.c | 2 +- sys-utils/mountpoint.c | 2 +- sys-utils/nsenter.c | 2 +- sys-utils/rtcwake.c | 2 +- sys-utils/setarch.c | 2 +- sys-utils/swapoff.c | 2 +- sys-utils/swapon.c | 2 +- sys-utils/umount.c | 6 +++--- sys-utils/zramctl.c | 2 +- term-utils/agetty.c | 8 ++++---- term-utils/setterm.c | 4 ++-- term-utils/wall.c | 2 +- term-utils/write.c | 2 +- tests/expected/ipcs/limits | 2 +- tests/ts/ipcs/limits | 2 +- text-utils/pg.c | 6 +++--- text-utils/ul.c | 2 +- 130 files changed, 329 insertions(+), 329 deletions(-) commit d35df4db5bb6164b4f4f378e92394333ef5c68a3 Author: Sebastian Rasmussen Date: Sun May 29 22:54:03 2016 +0200 docs: Fix various typos Signed-off-by: Sebastian Rasmussen disk-utils/blockdev.8 | 2 +- disk-utils/fsck.8 | 4 ++-- disk-utils/sfdisk.8 | 2 +- libblkid/docs/libblkid-docs.xml | 6 +++--- libblkid/libblkid.3 | 2 +- libfdisk/docs/libfdisk-docs.xml | 2 +- login-utils/login.1 | 2 +- misc-utils/findmnt.8 | 2 +- misc-utils/kill.1 | 2 +- misc-utils/logger.1 | 6 +++--- sys-utils/ipcrm.1 | 2 +- sys-utils/lsns.8 | 2 +- sys-utils/mount.8 | 8 ++++---- sys-utils/swapon.8 | 2 +- text-utils/hexdump.1 | 4 ++-- text-utils/pg.1 | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) commit cd28d6a405c9cfcaf30fe248a4df84133dbfa17a Author: Karel Zak Date: Tue May 31 18:27:20 2016 +0200 cal: support timestamps For example $ cal '2 weeks ago' Signed-off-by: Karel Zak misc-utils/cal.1 | 17 +++++++++++++++++ misc-utils/cal.c | 12 +++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) commit 731441ac5bfa846cdbd99e3903f11393eaeb2e53 Author: Karel Zak Date: Tue May 31 13:53:58 2016 +0200 cal: allow to specify month by name For example: $ cal August 2016 Signed-off-by: Karel Zak misc-utils/cal.1 | 3 +++ misc-utils/cal.c | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) commit 8f35b3a998cc4ca5a9030692a5bbffbbf3449765 Author: Tobias Stoeckmann Date: Sun May 29 18:56:58 2016 +0200 fsck.minix: Verify more fields in super-block. The field s_ninodes in super-block is used for memory allocation and division without verifications. The memory allocation increments the unchecked value by 1, making it vulnerable to an integer overflow on 32 bit systems with minix 3 file systems. I did not find a (good) way to exploit this by crafting a malicious file system, so I consider it as a reliability issue. If it's 0, a division by zero occurs when "-v" has been used. A filesystem without any inodes is definitely wrong, because it means that there's not even the root inode, which is accessed unchecked later on. The field s_firstdatazone has to be checked against s_(n)zones. If it is larger than the highest allowed index, the file system is definitely corrupted -- hard to say which value is wrong though, therefore I decided to simply call die(). A maliciously created file system could do more harm in this way: single bits inside the memory area could be flipped because range checks would fail. Hard to consider it as a security issue though, because these addresses are not arbitrarily accessible without very careful crafting (if at all possible). [kzak@redhat.com: - fix compiler warning (cast get_nzones()) [-Wsign-compare]] Signed-off-by: Karel Zak disk-utils/fsck.minix.c | 4 ++++ 1 file changed, 4 insertions(+) commit 1eb16fd78065dd6485731c4fb70924bc9b69df3a Author: Karel Zak Date: Thu May 26 15:05:14 2016 +0200 build-sys: add --disable-plymouth-support The plymouth support depends on Linux specific SOCK_* flags and all the feature is probably unnecessary in some cases (non-plymouth distros, etc.) Signed-off-by: Karel Zak configure.ac | 31 +++++++++++++++++++++++++++++++ lib/Makemodule.am | 5 ++++- login-utils/sulogin.c | 9 +++++---- term-utils/agetty.c | 7 +++++-- 4 files changed, 45 insertions(+), 7 deletions(-) commit 924c93d9df118338fd54cd73b4a45ccddc4ac103 Author: Karel Zak Date: Thu May 26 12:02:12 2016 +0200 libblkid: store only canonical devnames to the cache Let's try to use symlink: # ls -la /dev/block/8\:1 # lrwxrwxrwx 1 root root 7 May 25 16:42 /dev/block/8:1 -> ../sda1 # blkid /dev/block/8:1 /dev/block/8:3: LABEL="HOME" UUID="196972ad-3b13-4bba-ac54-4cb3f7b409a4" TYPE="ext4" PARTUUID="6073277f-87bc-43ff-bcfd-724c4484a63a" unfortunately the symlink is stored to the cache: /dev/block/8:3 next time if you ask for LABEL=HOME the answer will be /dev/block/8:3 rather than /dev/sda3. It seems better to canonicalize the paths we store to the cache. Unfortunately if you ask for /dev/block/8:3 then you probably expect that blkid_dev_devname() returns the same path. This patch introduces dev->bid_xname, this is the path used by application (and never stored in the cache). Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1332779 Signed-off-by: Karel Zak libblkid/src/blkidP.h | 3 ++- libblkid/src/dev.c | 11 +++++++++-- libblkid/src/devname.c | 43 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 9 deletions(-) commit 4d7ef267ccc7675c319d04179c3c2a9396af1e93 Author: Karel Zak Date: Wed May 25 16:11:51 2016 +0200 lsblk: use ID_WWN_WITH_EXTENSION is possible Addresses: https://github.com/karelzak/util-linux/issues/321 Signed-off-by: Karel Zak misc-utils/lsblk.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 702b6b5f7f77f198e921e51a83e31afcc6e81d0e Author: Karel Zak Date: Wed May 25 15:59:15 2016 +0200 build-sys: add tools/Makemodule.am We have "make" targets which depends on tools/check*.sh scripts. It's ugly to exclude these scripts from the release tar balls (as generated by "make distcheck"). Signed-off-by: Karel Zak Makefile.am | 5 ++--- tools/Makemodule.am | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) commit 5d25b7814faf3272887d7e6dae82438fb084f2be Author: Karel Zak Date: Wed May 25 15:28:42 2016 +0200 tools: add script to load .po from translationproject.org I use it for years, let's keep it in the repository. Signed-off-by: Karel Zak tools/git-tp-sync | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) commit 14308bc3f2a66c2f960c12fe831195aa997ca1cb Author: Karel Zak Date: Wed May 25 15:06:22 2016 +0200 libblkid: improve debug messages Signed-off-by: Karel Zak libblkid/src/blkidP.h | 1 - libblkid/src/cache.c | 11 +++++------ libblkid/src/dev.c | 6 ++---- libblkid/src/read.c | 6 +++--- libblkid/src/tag.c | 21 ++++++--------------- 5 files changed, 16 insertions(+), 29 deletions(-) commit 0966b16b22e4527417b44c9d8e9b9c93f15e8105 Author: Karel Zak Date: Tue May 24 14:50:07 2016 +0200 build-sys: add missing include/plymouth-ctrl.h Signed-off-by: Karel Zak include/Makemodule.am | 1 + 1 file changed, 1 insertion(+) commit 54d172327b9080edf2b712cc0b33352032eb8f5c Author: Karel Zak Date: Tue May 24 14:12:54 2016 +0200 dmesg: fix indention Signed-off-by: Karel Zak sys-utils/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c4482f7b3b298b2a66c959a08f07a19aa580fba5 Author: Karel Zak Date: Tue May 24 14:08:57 2016 +0200 last: fix logout time Signed-off-by: Karel Zak login-utils/last.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit bcf720693d1d23fdaa9e328165d9446478f75628 Author: Karel Zak Date: Tue May 24 13:22:40 2016 +0200 lsipc: use strtime_short() Signed-off-by: Karel Zak sys-utils/lsipc.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) commit cb5b52882efe43584df1373855decc04c1c26db3 Author: Karel Zak Date: Tue May 24 13:22:23 2016 +0200 lslogins: use strtime_short() Signed-off-by: Karel Zak login-utils/lslogins.c | 50 +++++++++++++++++++------------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) commit eee665bb5a4fb648d29d9f2fafb0490d46617053 Author: Karel Zak Date: Tue May 24 13:21:26 2016 +0200 lib/timeutils: add strtime_short() Signed-off-by: Karel Zak include/timeutils.h | 7 +++++++ lib/timeutils.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) commit 101f91ee84cb38b5ead8134d3e28fec50a430ed2 Author: Karel Zak Date: Tue May 24 11:16:12 2016 +0200 tests: refresh cal(1) test Signed-off-by: Karel Zak tests/expected/cal/color | 2 +- tests/expected/cal/colorw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit bbdfcbe9f00ab16fdd241599c99e137b5d411a54 Author: Karel Zak Date: Tue May 24 11:10:57 2016 +0200 lsipc: use strtm_iso() Signed-off-by: Karel Zak sys-utils/lsipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7c678f819b50117fec2461e02c18c181d13275f5 Author: Karel Zak Date: Tue May 24 11:10:10 2016 +0200 hwclock: use strtimeval_iso() Signed-off-by: Karel Zak sys-utils/hwclock.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) commit 3c6e7c5414a7235f8b4065900966f7fd87f53d3c Author: Karel Zak Date: Tue May 24 11:09:41 2016 +0200 dmesg: use strtimeval_iso() Signed-off-by: Karel Zak sys-utils/dmesg.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) commit 88134ee20863c060301508872aad966aff747933 Author: Karel Zak Date: Tue May 24 11:08:10 2016 +0200 lslogins: use strtm_iso() Signed-off-by: Karel Zak login-utils/lslogins.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit c7eb14d3253a4944d317129588a81c96fcab2376 Author: Karel Zak Date: Tue May 24 11:07:08 2016 +0200 last: cleanup time formatting code - describe difference between login and logout time formats in struct last_timefmt - use strtime_iso() - rename LAST_TIMEFTM_SHORT_CTIME to LAST_TIMEFTM_SHORT - rename LAST_TIMEFTM_FULL_CTIME to LAST_TIMEFTM_CTIME - add LAST_TIMEFTM_HHMM for internal purpose (logout format for "--time-format short") Signed-off-by: Karel Zak login-utils/last.c | 114 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 66 insertions(+), 48 deletions(-) commit 33c7ffa3039511384012296d05a9f227269f7797 Author: Karel Zak Date: Tue May 24 10:58:52 2016 +0200 include/timeutils: rewrite iso formatting functions - use buffers rather than allocate memory - support .usec and ,usec convention - use strftime for timezone (we need to care about daylight saving time) Signed-off-by: Karel Zak include/timeutils.h | 16 +++++---- lib/timeutils.c | 98 ++++++++++++++++++++++++++++++++++------------------- 2 files changed, 74 insertions(+), 40 deletions(-) commit 01b47d46d76291ea338ecd5190e1e670f4ab890a Author: Karel Zak Date: Mon May 23 11:56:31 2016 +0200 include/timeutils: use pointer for time_t Signed-off-by: Karel Zak include/timeutils.h | 2 +- lib/timeutils.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit fe3f7e17aad40d2e0e16fb2102ea4980589ee412 Author: Werner Fink Date: Fri Apr 22 12:16:04 2016 +0200 sulogin: agetty: use the plymouth local protocol instead the plymouth binary for stopping plymouthd. That do not depend on the existence of the plymouth binary if it e.g. becomes uninstalled or an other service is providing plymouthd facilities. [kzak@redhat.com: - fix compiler warnings [-Wpointer-sign] - use sizeof() for write_all() - cast to char* for read_all] Signed-off-by: Werner Fink Signed-off-by: Karel Zak include/plymouth-ctrl.h | 65 +++++++++++++++++++++ lib/Makemodule.am | 1 + lib/plymouth-ctrl.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++ login-utils/sulogin.c | 44 ++------------- term-utils/agetty.c | 48 ++-------------- 5 files changed, 223 insertions(+), 82 deletions(-) commit fded7cd03401e7b4ffe945c6855e325192a8b4d8 Merge: 5593132 e671a62 Author: Karel Zak Date: Fri May 20 10:55:06 2016 +0200 Merge branch 'cal04' commit 5593132a90c4330bd028a6fc2ab1feefac6cf5f6 Author: Mike Frysinger Date: Tue May 10 15:26:54 2016 -0400 man pages: fix spacing between man page name & section number Most have standardized correctly, but fix a few latent ones. Signed-off-by: Mike Frysinger disk-utils/cfdisk.8 | 2 +- disk-utils/sfdisk.8 | 4 ++-- misc-utils/kill.1 | 2 +- misc-utils/logger.1 | 2 +- sys-utils/losetup.8 | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) commit 53ca05329127fc0c44b43f25f8c1627b4a3c33f4 Author: Karel Zak Date: Wed May 18 15:06:31 2016 +0200 script: improve coding style and the "done" message Don't print the "done" message if the file does not exist. Signed-off-by: Karel Zak term-utils/script.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit e671a62ef8574b16cd6acbfd04dc35c514b184e5 Author: Karel Zak Date: Wed May 18 14:43:20 2016 +0200 cal: use %04d for year It seems that people are crazy enough to assume that "cal 16" is the year 2016, rather than 16 (2000 years ago). This patch makes it more clear as the output is 0016. Addresses: https://github.com/karelzak/util-linux/issues/320 Signed-off-by: Karel Zak misc-utils/cal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 747600537c67a25cc27a235a24980b234b6ac29e Author: Karel Zak Date: Wed May 18 14:29:50 2016 +0200 libfdisk: use table-length in dump for non-standard PT Signed-off-by: Karel Zak libfdisk/src/fdiskP.h | 1 + libfdisk/src/gpt.c | 2 +- libfdisk/src/script.c | 23 +++++++++++++++-------- 3 files changed, 17 insertions(+), 9 deletions(-) commit a67054f9be6998cd111ab81e4ca8931128569f56 Author: Karel Zak Date: Wed May 18 14:15:02 2016 +0200 libfdisk: make table-length usage more robust Signed-off-by: Karel Zak libfdisk/src/gpt.c | 2 ++ libfdisk/src/script.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) commit d96153f8c8735e21d0e150a00bd7899767cd507c Author: Sassan Panahinejad Date: Thu May 12 12:54:43 2016 +0100 sfdisk: Add support for altering GPT size Adds a header option to alter the GPT table length libfdisk/src/script.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) commit a18e726c6676914d4488cc8ace5d253a35dac4e5 Author: Sassan Panahinejad Date: Fri May 13 15:01:02 2016 +0100 libfdisk: Add support for altering GPT size This is useful in two situations: 1. More than 128 partitions are required. Or 2. The partition table must be restricted in size, such as when a system expects to find a bootloader at a location that would otherwise overlap the partition table. The gdisk partitioner supports this feature. libfdisk is already capable of reading and writing partition tables of any size, but previously could only create ones of 128 entries and could not resize. This change should be fairly safe, as it has no effect unless explicitly activated. Signed-off-by: Karel Zak libfdisk/src/gpt.c | 100 +++++++++++++++++++++++++++++++++++++++++++++ libfdisk/src/libfdisk.h.in | 1 + libfdisk/src/libfdisk.sym | 1 + 3 files changed, 102 insertions(+) commit 304cf9499dc5a8b170f8be56f59e9fddc5545b8a Author: Sassan Panahinejad Date: Fri May 13 11:42:14 2016 +0100 fdisk: Add support for altering GPT size Adds an options (l) to the GPT menu to resize the GPT. disk-utils/fdisk-menu.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 083c35b9f671bc42df2bed56132df783c26f4b61 Author: Sassan Panahinejad Date: Thu May 12 13:09:00 2016 +0100 libfdisk: fix range checking for fdisk_set_last_lba libfdisk/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 28b6c76f8a4ea1faa80fe779c2011bc433de28c6 Author: Karel Zak Date: Mon May 16 15:05:28 2016 +0200 logger: add man page note about the default --tag Signed-off-by: Karel Zak misc-utils/logger.1 | 2 ++ 1 file changed, 2 insertions(+) commit 40c9c3a6b7e6c4cda627d76edb14e92e823451c3 Author: Karel Zak Date: Thu May 12 14:37:29 2016 +0200 libfdisk: add API for work with labelitems Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 31 +++-- libfdisk/src/Makemodule.am | 9 +- libfdisk/src/fdiskP.h | 4 +- libfdisk/src/init.c | 1 + libfdisk/src/item.c | 243 ++++++++++++++++++++++++++++++++++++ libfdisk/src/label.c | 11 +- libfdisk/src/libfdisk.h.in | 14 ++- libfdisk/src/libfdisk.sym | 10 ++ 8 files changed, 309 insertions(+), 14 deletions(-) commit e4c5250dfbcbba067cea80f3be2a79c7ef3fdc46 Author: Karel Zak Date: Thu May 12 12:21:59 2016 +0200 libfdisk: move fdisk_field_...() functions to field.c Signed-off-by: Karel Zak libfdisk/src/Makemodule.am | 1 + libfdisk/src/field.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++ libfdisk/src/label.c | 46 ------------------------ libfdisk/src/libfdisk.h.in | 14 ++++---- 4 files changed, 97 insertions(+), 52 deletions(-) commit 3c201431ee26c85b5c7fbcd85856c1df84065d64 Author: Karel Zak Date: Wed May 11 15:31:02 2016 +0200 lib/timeutils: add strxxx_iso() functions Signed-off-by: Karel Zak include/strutils.h | 2 ++ include/timeutils.h | 13 +++++++++ lib/Makemodule.am | 5 +++- lib/strutils.c | 17 +++++++++++ lib/timeutils.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 117 insertions(+), 1 deletion(-) commit 627258104b936eeaaa19e8f21650f28378b661c8 Author: Karel Zak Date: Wed May 11 12:43:40 2016 +0200 ramctl: add support for zram-control Based on patch from Timofey Titovets. Addresses: https://github.com/karelzak/util-linux/issues/318 Reported-by: Timofey Titovets Signed-off-by: Karel Zak sys-utils/zramctl.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 3 deletions(-) commit a3a125b9227be82d84941062feaf3ddfde8265f7 Author: Karel Zak Date: Tue May 10 10:52:31 2016 +0200 libfdisk: use fdisk_add_partition() for unused partno For example: sfdisk -N may address unused partition. In this case we need to redirect from fdisk_set_partition() to fdisk_add_partition() and follow default setting (used all free space). Signed-off-by: Karel Zak libfdisk/src/partition.c | 5 +++++ 1 file changed, 5 insertions(+) commit 94af67f2aaaafce58f495b2415e534a0c2508332 Merge: c8a6f83 7032514 Author: Karel Zak Date: Mon May 9 13:28:52 2016 +0200 Merge branch 'no-fork' of https://github.com/terryburton/util-linux commit c8a6f83e85bf33821546609614d7414ee23702a3 Author: Sami Kerola Date: Sun May 8 21:17:18 2016 +0100 setterm: remove unnecessary translation string Signed-off-by: Sami Kerola term-utils/setterm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 98297e65a1e242cb09c370a10a7c0345fd8504ed Author: Karel Zak Date: Mon May 9 12:35:41 2016 +0200 setterm: de-duplicate color option string parsing Signed-off-by: Karel Zak term-utils/setterm.c | 80 +++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 44 deletions(-) commit 3e90d04af98c476f024ec12e5296b88d6dd830bf Author: Wayne Pollock Date: Wed May 4 17:15:14 2016 +0100 write: fix setuid related regression The write(1) is commonly a setuid binary, because common users cannot by default write to each others terminals. Since the commit in reference, that is part of releases v2.24 to v2.28, the write(1) has used access(2) to check capability to write to a destination terminal. The catch is that access(2) uses real UID and GID to when performing the accessibility. The obvious correction is to avoid access(2) when in context of setuid binaries. As a smaller fix, but equally important fix, ensure the 'msgsok' variable is initialized to indicate no access. Uninitialized variable will almost certainly do wrong thing at the time of check. Breaking-commit: 0233a8ea18bec17dd59cfe1fec8281 Signed-off-by: Sami Kerola Signed-off-by: Karel Zak Signed-off-by: Wayne Pollock term-utils/write.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit f0b3b904c7972374e8b9a280164508e356e9b5be Author: Sami Kerola Date: Sun May 1 23:56:05 2016 +0100 scriptreplay: avoid re-implementing strtod_or_err() And use isnan() to detect NaN. Signed-off-by: Sami Kerola term-utils/Makemodule.am | 1 + term-utils/scriptreplay.c | 17 ++++------------- 2 files changed, 5 insertions(+), 13 deletions(-) commit ba660b99110d5d7fc018a1bdbea314be0bba98a4 Author: Sami Kerola Date: Sun May 1 23:56:04 2016 +0100 scriptreplay: improve error message Use human numbering for lines - that is start counting from 1. And tell in error message what the number means. Signed-off-by: Sami Kerola term-utils/scriptreplay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 14f644f386a1708483ed446e983c0976e3976a9d Author: Victor Dodon Date: Thu Apr 21 00:24:58 2016 -0700 sfdisk: exit with error if rereading partition table fails Use the return value of fdisk_reread_partition_table in write_changes so that sfdisk exits with error if re-reading the partition table fails. Signed-off-by: Victor Dodon disk-utils/sfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 832bbc73b26f8bffc1f57c29cf9d819ef5d1bc4f Author: Karel Zak Date: Wed May 4 15:02:02 2016 +0200 build-sys: remove obsolete [cs]fdisk LDADDs Signed-off-by: Karel Zak disk-utils/Makemodule.am | 25 ------------------------- disk-utils/cfdisk.c | 4 ---- 2 files changed, 29 deletions(-) commit 3d6db3fdb1382fa2eb33cd7bccb27f6daaaf10ee Author: Karel Zak Date: Wed May 4 12:43:35 2016 +0200 sfdisk: add --wipe-partitions=auto|never|default The option allows to remove filesystes/RAIDs from newly created partitions before the partition table is updated (and partition device created). The default is "auto" in this case wipe is enabled in interactive mode only and user's confirmation (yes/no dialog) is required. Note that keep filesystem signature on partition is pretty valid use-case, so we don't erase anything by default. Signed-off-by: Karel Zak disk-utils/cfdisk.c | 45 ++++++++++-------------------------- disk-utils/sfdisk.8 | 12 ++++++++++ disk-utils/sfdisk.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 85 insertions(+), 38 deletions(-) commit ba465623d84b9e330f248a477d078b5f280b7943 Author: Karel Zak Date: Wed May 4 12:43:35 2016 +0200 fdisk: add --wipe-partitions=auto|never|default The option allows to remove filesystes/RAIDs from newly created partitions before the partition table is updated (and partition device created). The default is "auto" in this case wipe is enabled in interactive mode only and user's confirmation (yes/no dialog) is required. Note that keep filesystem signature on partition is pretty valid use-case, so we don't erase anything by default. Signed-off-by: Karel Zak disk-utils/fdisk-menu.c | 38 +++++++++++++++++++++++++++++++++++++- disk-utils/fdisk.8 | 12 ++++++++++++ disk-utils/fdisk.c | 11 ++++++++++- disk-utils/fdisk.h | 2 ++ 4 files changed, 61 insertions(+), 2 deletions(-) commit 131e38a28ea055548a098611eeba94078a17c19d Author: Karel Zak Date: Wed May 4 12:32:52 2016 +0200 libfdisk: add fdisk_wipe_partition() Now libfdisk provides functionality wipe disk device only ([s]fdisk option --wipe). This patch allows to probe for filesystems/RAIDs on newly created partitions. It means we can remove signatures before the partition node (device) is created. This reduces udev events and it's unnecessary to call wipefs for all partitions. For example sfdisk --wipe=always --wipe-partitions=always /dev/sda <<< ... EOF is a elegant way how to create new disk layout without any obsolete filesystems/RAIDs. Signed-off-by: Karel Zak libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/Makemodule.am | 1 + libfdisk/src/context.c | 57 ++++++-------- libfdisk/src/fdiskP.h | 16 +++- libfdisk/src/init.c | 1 + libfdisk/src/label.c | 6 +- libfdisk/src/libfdisk.h.in | 8 +- libfdisk/src/libfdisk.sym | 4 + libfdisk/src/partition.c | 137 ++++++++++++++++++++++++++++++++-- libfdisk/src/wipe.c | 143 ++++++++++++++++++++++++++++++++++++ 10 files changed, 324 insertions(+), 50 deletions(-) commit 55ad13c26fe5d0e606be5a83937f31b8cf576588 Author: Karel Zak Date: Thu Apr 28 13:54:01 2016 +0200 libblkid: make I/O errors on CDROMs non-fatal It seems too tricky to get a real size of the data track on hybrid disks with audio+data. It seems overkill to analyze all header in libblkid and on some disks it's probably possible to get I/O error almost everywhere due to crazy copy protection etc. Signed-off-by: Karel Zak libblkid/src/probe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 6548ac6aa797b3e64ea1ea28a3fb41464b35bc05 Author: Karel Zak Date: Wed Apr 27 18:49:36 2016 +0200 Revert "libblkid: check for multi-session CDROMs" This reverts commit a14cc9a5046bc4954b4110323c83599f90f9f35e. We need a better way (probably analyze track ioctls CDROMREADTOCHDR and CDROMREADTOCENTRY) to get also proper track size. The original patch works only if data track is the last track. Signed-off-by: Karel Zak libblkid/src/probe.c | 51 ++++++--------------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) commit a14cc9a5046bc4954b4110323c83599f90f9f35e Author: Karel Zak Date: Wed Apr 27 14:18:41 2016 +0200 libblkid: check for multi-session CDROMs .. and read last session if probing offset is not specified. udev uses cdrom_id to get last session offset, so people don't see a problem with hybrid media (audio+data), but if you execute blkid on command line (without -O ) then you get I/O errors. It seems that we can use the same way as kernel filesystem iso9960 driver when session= mount option is not specified ... just use CDROMMULTISESSION ioctl to get last session offset and probe this last session rather than all medium. Signed-off-by: Karel Zak libblkid/src/probe.c | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) commit b362a4cb986f7eea4b884c800719971502e2e8a8 Author: Karel Zak Date: Mon Apr 25 11:59:06 2016 +0200 libfdisk: don't offer zero length freespace Reported-by: Kay Sievers Signed-off-by: Karel Zak libfdisk/src/table.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) commit 8fcdce8fffeb243184d1f0bf1460a23cd0c598e3 Author: Karel Zak Date: Fri Apr 22 13:59:06 2016 +0200 libsmartcols remove duplicate code For petty long time we have strdup_to_struct_member() macro to avoid duplicate code when strdup() strings in setter functions. Let's use it for libmount. Signed-off-by: Karel Zak libsmartcols/src/cell.c | 41 +++++++---------------------- libsmartcols/src/column.c | 27 +++++-------------- libsmartcols/src/line.c | 27 +++++-------------- libsmartcols/src/smartcolsP.h | 1 + libsmartcols/src/symbols.c | 60 +++---------------------------------------- libsmartcols/src/table.c | 49 ++++------------------------------- 6 files changed, 33 insertions(+), 172 deletions(-) commit deb1c903272d45e8a1975b1da151d4deb3defe3b Author: Karel Zak Date: Fri Apr 22 13:59:06 2016 +0200 libmount: remove duplicate code For petty long time we have strdup_to_struct_member() macro to avoid duplicate code when strdup() strings in setter functions. Let's use it for libmount. Signed-off-by: Karel Zak include/strutils.h | 13 ++++++--- libfdisk/src/ask.c | 2 +- libmount/src/fs.c | 78 +++++++----------------------------------------------- libmount/src/tab.c | 26 ++---------------- 4 files changed, 22 insertions(+), 97 deletions(-) commit b6782d869710557b1f2252c03dda23b5fa246ac3 Author: Karel Zak Date: Fri Apr 22 13:39:31 2016 +0200 tests: move getopt to separate directory Signed-off-by: Karel Zak tests/expected/getopt/basic | 9 + .../getopt/options-alternative_option_clash | 2 + .../getopt/options-alternative_option_long | 2 + .../getopt/options-alternative_option_short | 2 + tests/expected/getopt/options-compatible | 5 + tests/expected/getopt/options-csh | 2 + .../expected/getopt/options-invalid_getopt_option | 3 + tests/expected/getopt/options-invocation_model_one | 2 + .../getopt/options-invocation_model_three_as_one | 2 + .../getopt/options-invocation_model_two_as_one | 2 + .../getopt/options-invocation_without_parameters | 3 + .../getopt/options-long_option_ambiguous_1 | 3 + tests/expected/getopt/options-longopts | 2 + tests/expected/getopt/options-name_option_long | 4 + tests/expected/getopt/options-name_option_short | 4 + tests/expected/getopt/options-no-arguments | 3 + tests/expected/getopt/options-non-option | 4 + tests/expected/getopt/options-posix_correctly | 4 + tests/expected/getopt/options-quiet_option_long | 2 + tests/expected/getopt/options-quiet_option_short | 2 + .../getopt/options-quiet_output_option_long | 5 + .../getopt/options-quiet_output_option_short | 5 + .../getopt/options-same_long_short_options | 2 + tests/expected/getopt/options-sh | 2 + .../getopt/options-test_for_enhanced_getopt | 1 + tests/expected/getopt/options-unknown_options | 4 + tests/expected/getopt/options-unquoted_option_bash | 5 + tests/expected/getopt/options-unquoted_option_tcsh | 5 + tests/expected/getopt/options-weird_quoting_bash | 5 + tests/expected/getopt/options-weird_quoting_tcsh | 2 + tests/expected/misc/getopt | 9 - .../expected/misc/getopt2-alternative_option_clash | 2 - .../expected/misc/getopt2-alternative_option_long | 2 - .../expected/misc/getopt2-alternative_option_short | 2 - tests/expected/misc/getopt2-invalid_getopt_option | 3 - tests/expected/misc/getopt2-invocation_model_one | 2 - .../misc/getopt2-invocation_model_three_as_one | 2 - .../misc/getopt2-invocation_model_two_as_one | 2 - .../misc/getopt2-invocation_without_parameters | 3 - .../expected/misc/getopt2-long_option_ambiguous_1 | 3 - tests/expected/misc/getopt2-longopts | 2 - tests/expected/misc/getopt2-name_option_long | 4 - tests/expected/misc/getopt2-name_option_short | 4 - tests/expected/misc/getopt2-quiet_option_long | 2 - tests/expected/misc/getopt2-quiet_option_short | 2 - .../expected/misc/getopt2-quiet_output_option_long | 5 - .../misc/getopt2-quiet_output_option_short | 5 - .../expected/misc/getopt2-same_long_short_options | 2 - .../expected/misc/getopt2-test_for_enhanced_getopt | 1 - tests/expected/misc/getopt2-unknown_options | 4 - tests/expected/misc/getopt2-unquoted_option_bash | 5 - tests/expected/misc/getopt2-unquoted_option_tcsh | 5 - tests/expected/misc/getopt2-weird_quoting_bash | 5 - tests/expected/misc/getopt2-weird_quoting_tcsh | 2 - tests/expected/misc/getopt3-compatible | 5 - tests/expected/misc/getopt3-csh | 2 - tests/expected/misc/getopt3-no-arguments | 3 - tests/expected/misc/getopt3-non-option | 4 - tests/expected/misc/getopt3-posix_correctly | 4 - tests/expected/misc/getopt3-sh | 2 - tests/ts/getopt/basic | 49 +++++ tests/ts/getopt/options | 231 +++++++++++++++++++++ tests/ts/misc/getopt | 49 ----- tests/ts/misc/getopt2 | 193 ----------------- tests/ts/misc/getopt3 | 63 ------ 65 files changed, 378 insertions(+), 403 deletions(-) commit d08b58c491031ce084f6b473300bbc2fd74d6c21 Author: Karel Zak Date: Fri Apr 22 13:14:12 2016 +0200 mount: add note about loopdev reuse to mount.8 Signed-off-by: Karel Zak sys-utils/mount.8 | 4 ++++ 1 file changed, 4 insertions(+) commit b2c2c42a8e77a8b2eff2735b03b9a91a19c5e091 Author: Stanislav Brabec Date: Tue Apr 12 20:23:25 2016 +0200 mount: Handle EROFS before calling mount() syscall If the loop device is already initialized read-only, the new code for loop device reuse returns -EROFS. There is no solution of this situation. But mount can behave in the same way, as it does for EROFS returned by mount syscall: Try again in read-only mode. Before: mount: /mnt/2: mount failed: Read-only file system After: mount: /btrfs.img is used as read only loop, mounting read-only Note: It would be nice to mention loop device name in the warning message, but it is not available in the mount context. Signed-off-by: Stanislav Brabec sys-utils/mount.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit bdf46c4df9aa9201afce6ae29f72268c54293bd7 Author: Stanislav Brabec Date: Tue Apr 12 20:22:56 2016 +0200 libmount: reuse existing loop device According to the Al Viro[1], kernel has no way to detect that a single file is used by multiple loop devices, and multiple mounts of the same file using different loop devices will result in a data corruption. Exactly this now happens, if multiple btrfs sub-volumes in one file are mounted with "-oloop". Make use of multiple -oloop mounting the same file safe: Do a loop devices lookup, and if a loop device is already initialized, use it. Hopefully it is possible, as "losetup -d" will return OK, even if the device itself is in use, and is not released. Problems: There is a risk of race condition between the lookup and real mount. Once loop device is initialized read-only, kernel offers no way to turn it to read-write. It has to fail. References: https://lkml.org/lkml/2016/2/26/897 Signed-off-by: Stanislav Brabec libmount/src/context_loopdev.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit 6e258026754ff7db97d6ac390e26ad1cc2e866e0 Author: Stanislav Brabec Date: Tue Apr 12 20:22:36 2016 +0200 libmount: Re-organize is_mounted_same_loopfile() First parse options, then initialize context. No change in function. The change is needed for loop device reuse. Signed-off-by: Stanislav Brabec libmount/src/context_loopdev.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) commit e402d6d3b149c34faa5abd5a0cef8284b4ae1af3 Author: Karel Zak Date: Fri Apr 22 11:29:46 2016 +0200 getopt: keep pointer to 'name' in control struct It's seems more readable than call free(argv[0]). Signed-off-by: Karel Zak misc-utils/getopt.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) commit fd0b6a5a42746c7fd7a858b3e451c14b2b709c9d Merge: fc75981 b13fedd Author: Karel Zak Date: Fri Apr 22 11:21:16 2016 +0200 Merge branch 'scan-build' of https://github.com/kerolasa/lelux-utiliteetit * 'scan-build' of https://github.com/kerolasa/lelux-utiliteetit: getopt: fix memory leaks and integer overflows [ASAN & valgrind] lib: avoid double free in loopdev.c setpwnam: fix memory leak libmount: fix memory leak build-sys: test functions does not return void commit fc75981a229a52ee8f5245c4a036dd151e4a70fc Author: Yuriy M. Kaminskiy Date: Fri Apr 8 00:38:56 2016 +0300 fsck: fix racing between unlock/unlink and open Process A Process B Process C open() [creates file] lock() [succeed] open() [open existing] lock()... running() close() [...succeed] unlink() running() open() [creates file] {BAD!} lock() [succeed] {BAD!} running() {BAD!} close() Cons: leaves empty (unlocked/harmless) .lock files in /run/fsck/ Signed-off-by: Yuriy M. Kaminskiy disk-utils/fsck.c | 1 - 1 file changed, 1 deletion(-) commit 854d0fef7f2bbae6e13a2b2ec8116b7e29541d45 Author: James Bottomley Date: Fri Apr 15 08:10:20 2016 -0700 nsenter: enter namespaces in two passes We have two use cases for user namespaces, one to elevate the privilege of an unprivileged user, in which case we have to enter the user namespace before all other namespaces (otherwise there isn't enough permission to enter any other namespace). And the other one is where we're deprivileging a user and thus have to enter the user namespace last (because that's the point at which we lose the privileges). On the first pass, we start at the position one after the user namespace clearing the file descriptors as we close them after calling setns(). If setns() fails on the first pass, ignore the failure assuming that it will succeed after we enter the user namespace. Addresses: https://github.com/karelzak/util-linux/issues/315 Signed-off-by: James Bottomley Acked-by: "Eric W. Biederman" Signed-off-by: Karel Zak sys-utils/nsenter.c | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) commit b13fedd485cb2e9663c1c69a5cb8c512f9ad4771 Author: Sami Kerola Date: Mon Mar 14 21:06:30 2016 +0000 getopt: fix memory leaks and integer overflows [ASAN & valgrind] The getopt(1) is short living command, and one could argue ensuring all allocations are freed at end of execution is waste of time. There is a point in that, but making test-suite runs to be less noisy with ASAN is also nice as it encourages reading the errors when/if they happen. Reviewed-by: Yuriy M. Kaminskiy Reviewed-by: Karel Zak Signed-off-by: Sami Kerola misc-utils/getopt.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) commit 34f6177a24cf602d0720b82f2064e6830ba34ffb Author: Sami Kerola Date: Sun Apr 3 17:43:19 2016 +0100 lib: avoid double free in loopdev.c Found with scan-build. Reviewed-by: Yuriy M. Kaminskiy Signed-off-by: Sami Kerola lib/loopdev.c | 1 + 1 file changed, 1 insertion(+) commit 31af559e306d3a084038e50d6d11d0ecc9d0c748 Author: Sami Kerola Date: Sun Apr 3 17:39:41 2016 +0100 setpwnam: fix memory leak Found with scan-build. Signed-off-by: Sami Kerola login-utils/setpwnam.c | 1 + 1 file changed, 1 insertion(+) commit ac943a662d67196f0087965ee1513f878160e2af Author: Sami Kerola Date: Sun Apr 3 17:34:53 2016 +0100 libmount: fix memory leak Found with scan-build. Signed-off-by: Sami Kerola libmount/src/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cf582a2e86752fbaf884328ad3d2cd1904f9dbb4 Author: Sami Kerola Date: Sun Apr 3 17:31:42 2016 +0100 build-sys: test functions does not return void Found using scan-build. Signed-off-by: Sami Kerola configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1bd62f72d8281cdd089fbef43652656dd3c60642 Author: Karel Zak Date: Tue Apr 19 12:45:00 2016 +0200 libblkid: fix mistake in debug message Signed-off-by: Karel Zak libblkid/src/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bfebe74e3babe8c188a51269acc2673f1aea283f Author: Karel Zak Date: Tue Apr 19 12:39:05 2016 +0200 libblkid: reduce probing area for crazy CDROMs Linux kernel reports devices greater than area readable by read(2). The readable area is usually 2-3 CD blocks smaller (CD block is 2048-bytes) than size returned by BLKGETSIZE. This patch checks for this issues to avoid I/O errors in probing functions. Reported-by: Thomas Schmitt Signed-off-by: Karel Zak libblkid/src/probe.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) commit 445e6b1ec82642a298419bdd18a81110593bfbaa Author: Petr Uzel Date: Mon Apr 18 16:22:05 2016 +0200 libblkid: make blkid_do_wipe() work with probes with offset When a probe is created with an offset, e.g. via blkid_probe_set_device(), this offset is correctly used when looking for the signatures, but is not respected by blkid_do_wipe() function. Therefore the signature is removed from an invalid location. Usecase: Wiping signatures from an area on the block device where partition is to be created (but as it does not exist yet, there's no device node for it and probe on the whole block device has to be used with correct offset and length). Reproducer: ======================== wiper.c =========================== const char *dev; unsigned long offset; unsigned long size; int main(int argc, char** argv) { if (argc != 4) { printf("usage: wiper dev offset size\n"); exit(1); } dev = argv[1]; offset = strtoull(argv[2], NULL, 10); size = strtoull(argv[3], NULL, 10); printf("dev=%s, off=%llu, size=%llu\n", dev, offset, size); int fd = open (dev, O_RDWR); if (fd == -1) { perror("open"); exit(1); } blkid_loff_t wipe_offset = offset * SECTOR_SIZE; blkid_loff_t wipe_size = size * SECTOR_SIZE; int ret; blkid_probe pr; pr = blkid_new_probe(); if (!pr) return 0; ret = blkid_probe_set_device(pr, fd, wipe_offset, wipe_size); ret = blkid_probe_enable_superblocks(pr, 1); ret = blkid_probe_set_superblocks_flags(pr, BLKID_SUBLKS_MAGIC); while (blkid_do_probe(pr) == 0) { ret = blkid_do_wipe(pr, 0); } blkid_free_probe(pr); close(fd); } ======================== wiper.c =========================== Steps to reproduce: modprobe scsi_debug parted -s /dev/sdX mklabel gpt parted -s /dev/sdX mkpart first 2048s 4095s mkfs.ext2 /dev/sdX1 wipefs -np /dev/sdX1 ./wiper /dev/sdX1 2048 2048 Actual result: wiper gets into endless loop, because blkid_do_wipe() wipes at wrong location (1080), leaving the signature on /dev/sdc1. So it is again found by blkid_do_probe(), and so on. Expected result: wiper clears the ext2 signature at offset 1049656(=1080+2048*512). Signed-off-by: Petr Uzel libblkid/src/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 799746848439c5e778930f01456c26155e34f69a Author: Karel Zak Date: Mon Apr 18 13:19:12 2016 +0200 pylibmount: include c.h ... for sys/sysmacros.h and major() and minor() macros. Reported-by: Mike Frysinger Signed-off-by: Karel Zak libmount/python/pylibmount.h | 1 + 1 file changed, 1 insertion(+) commit c79657ca85978521b4030a9e3486373ebaaaf10f Author: Yuriy M. Kaminskiy Date: Wed Apr 13 17:36:36 2016 +0300 losetup: fix outdated comment From abb2a420924c792be33aa3ed825b1348ea7d51a9 Mon Sep 17 00:00:00 2001 From: "Yuriy M. Kaminskiy" Date: Wed, 13 Apr 2016 17:30:10 +0300 Subject: [PATCH] losetup: fix outdated comment --direct-io argument was made optional by f98d9641a371421640a8f1cfe497030758f86dca, but this comment was not updated accordingly Signed-off-by: Yuriy M. Kaminskiy sys-utils/losetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 71d5088f056040bdfd5e9ded57b2f8607aa58dec Merge: d97dc0e 592fe01 Author: Karel Zak Date: Mon Apr 18 11:01:26 2016 +0200 Merge branch '2016wk15' of git://github.com/kerolasa/lelux-utiliteetit * '2016wk15' of git://github.com/kerolasa/lelux-utiliteetit: mount: try to tell what mount was doing when it failed dmesg: --notime should not suppress --show-delta script: check status of writes when closing outputs script: avoid trying fclose(NULL) sulogin: make fopen O_CLOEXEC specifier usage portable script: close file descriptors on exec docs: optinal option arguments should be long-only commit d97dc0ee2505e80c8e9fca89aa2001b2ec2c3695 Author: Lubomir Rintel Date: Mon Apr 18 09:01:23 2016 +0200 mkswap: tolerate ENOTSUP when failing to relabel It might be that the underlying filesystem just doesn't support SELinux labeling. This fixes creating swap on vfat live media: # livecd-iso-to-disk.sh --msdos --swap-size-mb 666 ... Signed-off-by: Lubomir Rintel disk-utils/mkswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 592fe0175f25a5d50d14de4eecdb7f22be4bdb39 Author: Sami Kerola Date: Sat Apr 16 19:05:58 2016 +0100 mount: try to tell what mount was doing when it failed Earlier output did not give enough information to system admin to fix an issue in /etc/fstab effectively. $ sudo mount -a mount: mount(2) failed: No such file or directory Addresses: https://bugs.launchpad.net/bugs/1557145 Signed-off-by: Sami Kerola sys-utils/mount.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit fdba1750fc9404206b900fac1dfc37772103b022 Author: Sami Kerola Date: Sat Apr 16 18:35:02 2016 +0100 dmesg: --notime should not suppress --show-delta The --show-delta is off by default, which means it can be only on when user has requested to see these time stamps. The --notime option should not turn the delta outputing off, because then option order matters and no-one wants that. Example of the old output: $ dmesg --notime --show-delta | sed -n 's/ version.*//p; q' [< 0.000000>] Linux $ dmesg --show-delta --notime | sed -n 's/ version.*//p; q' Linux Addresses: https://bugs.launchpad.net/bugs/1544595 Signed-off-by: Sami Kerola sys-utils/dmesg.c | 1 - 1 file changed, 1 deletion(-) commit 22d5cc87e6ce0e492f0db3209d51c89b48c81d14 Author: Sami Kerola Date: Sat Apr 16 17:54:25 2016 +0100 script: check status of writes when closing outputs This should make possible output issues more obvious, for example when a disk will get full. Signed-off-by: Sami Kerola term-utils/script.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 4b0b416acb182576ab1000a1df1ad3722a25f071 Author: Sami Kerola Date: Sat Apr 16 17:43:01 2016 +0100 script: avoid trying fclose(NULL) Here is a one-liner to reproduce the issue. $ mkdir example && cd example && chmod 0500 . && script Script started, file is typescript script: cannot open typescript: Permission denied Script done, file is typescript Segmentation fault (core dumped) Addresses: https://bugs.launchpad.net/bugs/1537518 Signed-off-by: Sami Kerola term-utils/script.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 400423824a6810aa0ec09b0d1cae34e420cfa781 Author: Sami Kerola Date: Sat Apr 16 15:43:17 2016 +0100 sulogin: make fopen O_CLOEXEC specifier usage portable The close at exit specifier "e" is glibc extension, so use it only if when the extension is available. Proposed-by: Ruediger Meier Signed-off-by: Sami Kerola login-utils/sulogin-consoles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 760e5e682dbaf2c4f5ed5a27119cc8a95ccce993 Author: Sami Kerola Date: Sat Apr 2 21:30:15 2016 +0100 script: close file descriptors on exec The commands spawned from script(1) will never need access various file descriptors the script(1) is using. Reviewed-by: Ruediger Meier Reviewed-by: Karel Zak Signed-off-by: Sami Kerola term-utils/script.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit 326c5c93b917a623f346155c8b3438b379d9fd60 Author: Sami Kerola Date: Sat Apr 16 15:30:39 2016 +0100 docs: optinal option arguments should be long-only Deprecate adding new short optional option arguments. They are problematic. Proposed-by: Ruediger Meier Acked-by: Karel Zak Reviewed-by: Benno Schulenberg Reference: https://lists.gnu.org/archive/html/coreutils/2012-11/msg00004.html Reference: http://marc.info/?l=util-linux-ng&m=146062997618853&w=2 Signed-off-by: Sami Kerola Documentation/boilerplate.c | 10 +++++----- Documentation/howto-man-page.txt | 22 ++++++++++++++++++++-- Documentation/howto-usage-function.txt | 2 +- 3 files changed, 26 insertions(+), 8 deletions(-) commit 703251401cb11ee5d00a6b8f8bd9dc80c160f476 Author: Terry Burton Date: Thu Apr 14 12:27:52 2016 +0100 flock: Introduce no-fork option. When guarding a command with flock it is sometimes preferable to not leave a flock process waiting around for the command to exit. sys-utils/flock.1 | 8 +++++++ sys-utils/flock.c | 68 +++++++++++++++++++++++++++++++++---------------------- 2 files changed, 49 insertions(+), 27 deletions(-) commit a772281dff903b9e761c4d8a6c2ecad7d5f944ba Author: Karel Zak Date: Fri Apr 15 14:48:29 2016 +0200 libmount: make kernel_fs_postparse() more robust Signed-off-by: Karel Zak libmount/src/tab_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 4b85aef355e4a1a783c7fcf693575e85c366d90b Author: Karel Zak Date: Fri Apr 15 14:30:43 2016 +0200 libmount: fix mnt_table_parse_stream() logic Signed-off-by: Karel Zak libmount/src/tab_parse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit edeb6223fed8f5e5b4088d34007c3860c928906a Author: Karel Zak Date: Fri Apr 15 14:10:23 2016 +0200 tests: make tests more portable due to mtab Signed-off-by: Karel Zak libmount/src/tab_parse.c | 2 ++ tests/functions.sh | 10 +++++++ tests/ts/libmount/context | 4 +-- tests/ts/libmount/context-py | 4 +-- tests/ts/libmount/update | 64 +++++++++++++++++++++------------------- tests/ts/mount/devname | 14 ++++++--- tests/ts/mount/remount | 10 +++++-- tests/ts/mount/rlimit | 3 ++ tests/ts/mount/umount-alltargets | 5 +++- 9 files changed, 75 insertions(+), 41 deletions(-) commit b529694f615a927bf10341558daa09725dd0294f Author: Karel Zak Date: Fri Apr 15 12:05:55 2016 +0200 libmount: fix mnt_table_parse_mtab() logic Signed-off-by: Karel Zak libmount/src/context_umount.c | 6 +++--- libmount/src/tab_parse.c | 33 +++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 15 deletions(-) commit 3904d876368f049fc2cf8ffcb6db9e7493e9cfe5 Author: Karel Zak Date: Fri Apr 15 11:29:22 2016 +0200 tests: remove USE_LIBMOUNT_FORCE_MOUNTINFO Signed-off-by: Karel Zak libmount/src/version.c | 4 ++-- tests/ts/libmount/context | 5 +++-- tests/ts/libmount/context-py | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) commit 6c820514f97c1f75aa31a904e19722f57c810d5a Author: Karel Zak Date: Fri Apr 15 10:47:12 2016 +0200 umount: add note about FS names differences to the man page Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1327209 Signed-off-by: Karel Zak sys-utils/umount.8 | 6 ++++++ 1 file changed, 6 insertions(+) commit e778642a9eb96975fcf3baa61dfa10add628af1a Author: Karel Zak Date: Thu Apr 14 14:26:54 2016 +0200 libmount: don't support /etc/mtab by default The file mtab is evil and already unused by mainstream distributions. Now libmount is able to detect mtab->/proc/mounts and use /proc/self/mountinfo if necessary. This heuristic seems overkill in many cases. It's also dangerous on systems where mountinfo is strongly required (systemd based distros). This patch #ifdefs mtab code and forces libmount to always use /proc/self/mountinfo. The new configure option --enable-libmount-support-mtab is necessary to enable old behavior to support mtab. Signed-off-by: Karel Zak configure.ac | 10 +++++----- libmount/src/context.c | 13 +++++++++---- libmount/src/tab_parse.c | 18 +++++++++++------- libmount/src/tab_update.c | 2 ++ 4 files changed, 27 insertions(+), 16 deletions(-) commit 3e584e8576aef83f934e8409d07758550dd019cb Author: Ruediger Meier Date: Wed Apr 6 15:43:07 2016 +0200 build-sys: add --enable-libuuid-force-uuidd To build libuuid with uuidd support even though the daemon is disabled (--disable-uuidd). Signed-off-by: Ruediger Meier configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 949e5c960037c377d8c6f696758082e0f20e98f6 Author: Karel Zak Date: Wed Apr 13 14:41:47 2016 +0200 wipefs: force GPT detection The library libblkid (as well as fdisks) requires protective MBR when probe for GPT by default. This is unnecessary for wipefs where we're more promiscuous and we want to delete as much as possible. This patch enables BLKID_PARTS_FORCE_GPT for wipefs. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1326474 Signed-off-by: Karel Zak misc-utils/wipefs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit b6abdc22f43c479eb1b082de59d46f3a80443bc5 Author: Karel Zak Date: Fri Apr 8 10:58:34 2016 +0200 build-sys: remove obsolete comment Signed-off-by: Karel Zak sys-utils/Makemodule.am | 4 ---- 1 file changed, 4 deletions(-) commit c3f323cb2cb6076ac3a509fb240cf4d7b97199eb Author: Ruediger Meier Date: Wed Apr 6 12:30:18 2016 +0200 tests: don't depend on GNU md5sum Signed-off-by: Ruediger Meier .travis-functions.sh | 2 +- tests/expected/misc/rev | 4 ++-- tests/functions.sh | 2 +- tests/ts/cramfs/fsck-endianness | 3 ++- tests/ts/cramfs/mkfs | 3 ++- tests/ts/fdisk/mbr-dos-mode | 1 + tests/ts/fdisk/mbr-nondos-mode | 1 + tests/ts/fdisk/oddinput | 1 + tests/ts/fdisk/sunlabel | 1 + tests/ts/misc/rev | 5 +++-- tests/ts/mount/rlimit | 3 ++- tests/ts/sfdisk/movedata | 5 +++-- 12 files changed, 20 insertions(+), 11 deletions(-) commit c8d211478f4a562628fb400355861ca81f8a446b Author: Ruediger Meier Date: Wed Apr 6 12:30:17 2016 +0200 tests: test_md5 prints md5sum only We want to to use it for other tests without depending on gnu md5sum and without cut or awk. Signed-off-by: Ruediger Meier tests/expected/md5/md5 | 14 +++++++------- tests/helpers/test_md5.c | 2 +- tests/ts/md5/md5 | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) commit 2e31d1c3a5d729c4a9062e37210a1c01623327d6 Author: Sami Kerola Date: Sun Apr 3 09:35:29 2016 +0100 chrt: validate priority before trying to use it Earlier message: $ chrt -i 1 ls chrt: failed to set pid 0's policy: Invalid argument basically told 'something failed', while the new one tries to be more helpful. $ chrt -i 1 ls chrt: unsupported priority value for the policy: 1: see --max for valid range Addresses: https://bugs.debian.org/791707 Signed-off-by: Sami Kerola schedutils/chrt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 962a7dc3b0372d718e1686a2d5734cbde4713cab Author: Sami Kerola Date: Sat Apr 2 16:58:14 2016 +0100 colcrt: avoid the command getting hung [afl] Some inputs make getwc(3) not to progress file descriptor and neither to report EILSEQ. Detect such situation and skip the bad input. Signed-off-by: Sami Kerola tests/colcrt | Bin 0 -> 14720 bytes tests/expected/colcrt/regressions-hang1 | 3 +++ tests/ts/colcrt/hang1 | 1 + tests/ts/colcrt/regressions | 3 ++- text-utils/colcrt.c | 7 +++++++ 5 files changed, 13 insertions(+), 1 deletion(-) commit 2238214ddc81d8ecab386d9e38d68f9357e2ad74 Author: Karel Zak Date: Thu Mar 24 11:51:12 2016 +0100 libmount: try absolute target before canonicalize The path canonicalization is expensive and in many cases unwanted due to problems with readlink() on unreachable NFS and automounters. This patch add a possibility to search also by $(CWD)/ if the is relative to reduce number of situation when we convert the path to the canonical absolute path. The common use-case: # cd /some/long/path # umount ./mountpoint old version: 15543: libmount: TAB: [0x560a99a54230]: lookup TARGET: './test' 15543: libmount: CACHE: [0x560a99a54290]: canonicalize path ./test 15543: libmount: CACHE: [0x560a99a54290]: add entry [ 1] (path): /mnt/test: ./test 15543: libmount: TAB: [0x560a99a54230]: lookup canonical TARGET: '/mnt/test' 15543: libmount: CXT: [0x560a99a54050]: umount fs: /mnt/test new version: 15597: libmount: TAB: [0xabf230]: lookup TARGET: './test' 15597: libmount: TAB: [0xabf230]: lookup absolute TARGET: '/mnt/test' 15597: libmount: CXT: [0xabf050]: umount fs: /mnt/test Signed-off-by: Karel Zak include/canonicalize.h | 10 ++++++++++ lib/canonicalize.c | 42 +++++++++++++++++++++++++++++++++++++++++- libmount/src/tab.c | 14 ++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) commit b2bff0666101213d5ce9fc4166d8fc5b17581f57 Author: Karel Zak Date: Wed Apr 13 11:52:43 2016 +0200 script: use empty-slave heuristic more carefully script(1) waits for empty slave FD (shell stdin) before it writes to master. This feature has been intorduiced by 54c6611d6f7b73609a5331f4d0bcf63c4af6429e to avoid misbehavior when we need to send EOF to the shell. Unfortunately, this feature has been used all time for all messages. This is wrong because command in the session (or shell) may ignore stdin at all and wait forever in busy loop is really bad idea. Test case: script /dev/null tailf /etc/passwd ... script process taking 100% CPU. This patch forces script to use empty-stave detection only when we need to write EOF. The busy loop has been modified to use nanosleep and it does not wait forever... Addresses: http://bugs.debian.org/820843 Signed-off-by: Karel Zak term-utils/script.c | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-)