Changes between v2.37 and v2.38-rc1 -------------------------------------------- commit b99355fce5a79febbd60c5774ba25e55678947d0 Author: Karel Zak Date: Mon Jan 31 15:57:47 2022 +0100 build-sys: release++ (v2.38-rc1) Signed-off-by: Karel Zak NEWS | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) commit dbb1964e010a81e7b535c2e968680965975b4752 Author: Karel Zak Date: Mon Jan 31 15:57:39 2022 +0100 docs: update v2.38-ReleaseNotes Signed-off-by: Karel Zak Documentation/releases/v2.38-ReleaseNotes | 912 ++++++++++++++++++++++++++++++ 1 file changed, 912 insertions(+) commit 9da8a4411a60ac39a744296887a0c57b008c58c2 Author: Karel Zak Date: Mon Jan 31 13:00:36 2022 +0100 docs: update AUTHORS file Signed-off-by: Karel Zak AUTHORS | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) commit 0aac1a7ba57141d796d6872fd9ea0b46698be033 Author: Karel Zak Date: Mon Jan 31 12:50:18 2022 +0100 po: merge changes Signed-off-by: Karel Zak po/ca.po | 7496 ++++++++++++++++++++++++++++---------------------- po/cs.po | 7828 +++++++++++++++++++++++++++++++---------------------- po/da.po | 7697 ++++++++++++++++++++++++++++++---------------------- po/de.po | 7764 ++++++++++++++++++++++++++++++---------------------- po/es.po | 7628 ++++++++++++++++++++++++++++++--------------------- po/et.po | 7474 ++++++++++++++++++++++++++++---------------------- po/eu.po | 7466 ++++++++++++++++++++++++++++---------------------- po/fi.po | 7575 +++++++++++++++++++++++++++++---------------------- po/fr.po | 7588 ++++++++++++++++++++++++++++++--------------------- po/gl.po | 7451 ++++++++++++++++++++++++++++---------------------- po/hr.po | 7747 ++++++++++++++++++++++++++++++---------------------- po/hu.po | 7507 ++++++++++++++++++++++++++++---------------------- po/id.po | 7509 ++++++++++++++++++++++++++++---------------------- po/it.po | 7491 ++++++++++++++++++++++++++++---------------------- po/ja.po | 7695 ++++++++++++++++++++++++++++++---------------------- po/nl.po | 7657 +++++++++++++++++++++++++++++---------------------- po/pl.po | 7779 ++++++++++++++++++++++++++++++---------------------- po/pt.po | 7592 ++++++++++++++++++++++++++++++--------------------- po/pt_BR.po | 7812 ++++++++++++++++++++++++++++++---------------------- po/ru.po | 7545 +++++++++++++++++++++++++++++---------------------- po/sl.po | 7494 ++++++++++++++++++++++++++++---------------------- po/sv.po | 7735 ++++++++++++++++++++++++++++++---------------------- po/tr.po | 7653 +++++++++++++++++++++++++++++---------------------- po/uk.po | 7590 ++++++++++++++++++++++++++++++--------------------- po/util-linux.pot | 7046 ++++++++++++++++++++++++++--------------------- po/vi.po | 7643 +++++++++++++++++++++++++++++---------------------- po/zh_CN.po | 7716 ++++++++++++++++++++++++++++++---------------------- po/zh_TW.po | 7491 ++++++++++++++++++++++++++++---------------------- 28 files changed, 123846 insertions(+), 88823 deletions(-) commit e6b7408bde755d3212aab87dce17f113df810874 Author: Jose Riha Date: Mon Jan 31 12:42:32 2022 +0100 po: add sk.po (from translationproject.org) po/sk.po | 20850 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 20850 insertions(+) commit abd48a95ea62088e6c9ca4a7d74b0b3e785ec3e3 Author: Boyuan Yang <073plan@gmail.com> Date: Mon Jan 31 12:42:32 2022 +0100 po: update zh_CN.po (from translationproject.org) po/zh_CN.po | 1017 +++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 743 insertions(+), 274 deletions(-) commit 316e09ba9f26561b6df8d933904976126192295d Author: Мирослав Николић Date: Mon Jan 31 12:42:32 2022 +0100 po: update sr.po (from translationproject.org) po/sr.po | 6280 ++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 3454 insertions(+), 2826 deletions(-) commit 864c3878959d6e26466ca121eaf76ea5f76efba9 Author: Rafael Fontenelle Date: Mon Jan 31 12:42:32 2022 +0100 po: update pt_BR.po (from translationproject.org) po/pt_BR.po | 812 +++++++++++++++++++++++++----------------------------------- 1 file changed, 338 insertions(+), 474 deletions(-) commit bc55ff895253ce42cceb0d2d82058c4a2816c775 Author: Jakub Bogusz Date: Mon Jan 31 12:42:32 2022 +0100 po: update pl.po (from translationproject.org) po/pl.po | 100 +++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 52 insertions(+), 48 deletions(-) commit ac076e919fb054bf1983a75e10cc285a3a9d99d1 Author: Antonio Ceballos Roa Date: Mon Jan 31 12:42:32 2022 +0100 po: update es.po (from translationproject.org) po/es.po | 788 ++++++++++++++++++++++++++------------------------------------- 1 file changed, 326 insertions(+), 462 deletions(-) commit 47d86d2d3ecbdc9879dfc11ff13513f6d2e018b4 Author: Mario Blättermann Date: Mon Jan 31 12:42:31 2022 +0100 po: update de.po (from translationproject.org) po/de.po | 108 +++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 56 insertions(+), 52 deletions(-) commit a4e3a0578b9fc46c3e984737b5464eb44826a01a Author: Petr Písař Date: Mon Jan 31 12:42:31 2022 +0100 po: update cs.po (from translationproject.org) po/cs.po | 98 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 51 insertions(+), 47 deletions(-) commit 752127eb27bc806834b10516aef5f2eb561a165e Author: Karel Zak Date: Mon Jan 31 12:38:49 2022 +0100 tests: update build-sys test Signed-off-by: Karel Zak tests/expected/build-sys/config-all | 64 ++++++++++----------- tests/expected/build-sys/config-all-non-nls | 64 ++++++++++----------- tests/expected/build-sys/config-audit | 64 ++++++++++----------- tests/expected/build-sys/config-chfnsh-libuser | 66 +++++++++++----------- tests/expected/build-sys/config-chfnsh-no-password | 62 ++++++++++---------- tests/expected/build-sys/config-chfnsh-pam | 62 ++++++++++---------- tests/expected/build-sys/config-core | 64 ++++++++++----------- tests/expected/build-sys/config-devel | 66 +++++++++++----------- tests/expected/build-sys/config-devel-non-asan | 66 +++++++++++----------- tests/expected/build-sys/config-devel-non-docs | 66 +++++++++++----------- tests/expected/build-sys/config-fuzz | 1 - tests/expected/build-sys/config-non-libblkid | 36 ++++++------ tests/expected/build-sys/config-non-libmount | 36 ++++++------ tests/expected/build-sys/config-non-libs | 25 ++++---- tests/expected/build-sys/config-non-libsmartcols | 43 +++++++------- tests/expected/build-sys/config-non-libuuid | 56 +++++++++--------- tests/expected/build-sys/config-non-nls | 64 ++++++++++----------- tests/expected/build-sys/config-selinux | 66 +++++++++++----------- tests/expected/build-sys/config-slang | 64 ++++++++++----------- tests/expected/build-sys/config-static | 64 ++++++++++----------- 20 files changed, 548 insertions(+), 551 deletions(-) commit a53df7c0b5f1921a5ee380aba54797ac7967e261 Author: Karel Zak Date: Mon Jan 31 11:50:42 2022 +0100 build-sys: add cryptsetup config-gen template Signed-off-by: Karel Zak tools/config-gen.d/cryptsetup.conf | 3 +++ 1 file changed, 3 insertions(+) commit 582eb71d737b6c23dd5ec19db0e9aa1d4d7abee9 Author: Stanislav Brabec Date: Mon Jan 31 10:53:20 2022 +0100 fstrim: Add fstab option X-fstrim.notrim Sometimes it makes sense to skip fstrim for selected file mounts, but still be able to use fstrim.service. Add a possibility to specify "X-fstrim.notrim" in fstab. Do not use "notrim", as it collides with the kernel rbd driver. [kzak@redhat.com: - rename x-fstrim to X-fstrim] Signed-off-by: Stanislav Brabec Signed-off-by: Karel Zak sys-utils/fstrim.8.adoc | 2 +- sys-utils/fstrim.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) commit 1d615681a3650fed0fd9ecf323d599605f026736 Merge: 511a51261 bdc8c71d3 Author: Karel Zak Date: Mon Jan 31 10:12:16 2022 +0100 Merge branch 'patch-2' of https://github.com/mariobl/util-linux * 'patch-2' of https://github.com/mariobl/util-linux: Improve markup in findmnt.8.adoc commit 511a512611bfc0bc740b2e698ef0c7ae5e56891a Author: Karel Zak Date: Mon Jan 31 10:05:29 2022 +0100 hwclock: get/set param cleanup * move all code to hwclock-rtc.c * use ul_strtou64() to simplify code * use base=0 for ul_strtou64() to handle 10 and 16 base * allocate for strtok() (we keep command line options read-only) Signed-off-by: Karel Zak sys-utils/hwclock-rtc.c | 91 ++++++++++++++++++++++++++++--------------------- sys-utils/hwclock.c | 12 +++---- sys-utils/hwclock.h | 23 ++----------- 3 files changed, 61 insertions(+), 65 deletions(-) commit bdc8c71d3540dcafeb7fb2c8c362599232e9250a Author: Mario Blättermann Date: Sat Jan 29 12:25:16 2022 +0100 Improve markup in findmnt.8.adoc misc-utils/findmnt.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 63d8183479e0ccfe5ed46033413ec52880aa2b39 Author: Karel Zak Date: Fri Jan 28 12:15:39 2022 +0100 hwclock: cleanup hwclock_params[] use * remove it from header file * keep it 'static const' Signed-off-by: Karel Zak sys-utils/hwclock-rtc.c | 15 +++++++++++++++ sys-utils/hwclock.c | 9 +++++---- sys-utils/hwclock.h | 8 +------- 3 files changed, 21 insertions(+), 11 deletions(-) commit e0e98b1534261e135dfe0e6ce8c0b7bb72b0b66a Author: Bastian Krause Date: Fri Jan 21 16:45:03 2022 +0100 docs: document --param-get, --param-set Signed-off-by: Bastian Krause sys-utils/hwclock.8.adoc | 5 +++++ 1 file changed, 5 insertions(+) commit b22b78b1be6df917d5c449d2f5e45d0a67f14502 Author: Bastian Krause Date: Fri Jan 21 16:09:43 2022 +0100 hwclock: add --param-set option Implement the RTC_PARAM_SET RTC ioctl in hwclock. The ioctl interface was introduced with [1], which went mainline in Kernel v5.16. The parameters are independent of hardware/driver. This means we can read and set parameters in a generic way. The new --param-set hwclock function accepts aliases for parameters currently existent (Kernel v5.16). They can be extended later on. As fallback and for values, hexadecimal (if prefixed with 0x) and decimal values, as defined in [2], are accepted. Example: $ hwclock --param-set bsm=0x0 [1] https://lore.kernel.org/all/20211018151933.76865-1-alexandre.belloni@bootlin.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h Signed-off-by: Bastian Krause bash-completion/hwclock | 5 +++++ sys-utils/hwclock-rtc.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ sys-utils/hwclock.c | 20 ++++++++++++++--- sys-utils/hwclock.h | 3 +++ 4 files changed, 85 insertions(+), 3 deletions(-) commit 6097b12df708a91651972f73cac2984692196073 Author: Bastian Krause Date: Fri Jan 21 16:09:35 2022 +0100 hwclock: add --param-get option Implement the RTC_PARAM_GET RTC ioctl in hwclock. The ioctl interface was introduced with [1], which went mainline in Kernel v5.16. The parameters are independent of hardware/driver. This means we can read and set parameters in a generic way. The new --param-get hwclock function accepts aliases for parameters currently existent (Kernel v5.16). They can be extended later on. As fallback, hexadecimal (if prefixed with 0x) and decimal values, as defined in [2], are accepted. Example: $ hwclock --param-get features [1] https://lore.kernel.org/all/20211018151933.76865-1-alexandre.belloni@bootlin.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h Signed-off-by: Bastian Krause bash-completion/hwclock | 5 +++++ sys-utils/hwclock-rtc.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ sys-utils/hwclock.c | 40 ++++++++++++++++++++++++++++++++--- sys-utils/hwclock.h | 34 ++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+), 3 deletions(-) commit ee1e12448e1978230de2f7fb11e0a9216b27d788 Author: Bastian Krause Date: Fri Jan 21 16:06:41 2022 +0100 hwclock: increase indent in help text This leaves more space for a longer option in a future commit. Signed-off-by: Bastian Krause sys-utils/hwclock.c | 60 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 23 deletions(-) commit 177c9ec7c7aa0f49413f4cb5f347edf721d5a5ba Author: Karel Zak Date: Fri Jan 28 11:28:06 2022 +0100 findmnt: add to the man page note about SOURCES References: https://github.com/util-linux/util-linux/pull/1576 Signed-off-by: Karel Zak misc-utils/findmnt.8.adoc | 2 ++ 1 file changed, 2 insertions(+) commit da8177316f87a56925d0ac5ca8d07b4d8e38586a Author: Goffredo Baroncelli Date: Sat Jan 22 15:08:08 2022 +0100 findmnt: allow SOURCES field even without '--fstab' The SOURCES output field was fully enabled only when "--fstab" is enabled too. This patch enables SOURCES even without "--fstab". $ ./findmnt -o TARGET,SOURCES TARGET SOURCES / /dev/sdg3 ├─/mnt/btrfs-raid1 /dev/sdb2 │ /dev/sde2 │ /dev/sda2 └─/tmp/t /dev/mapper/pool-v2 /dev/mapper/pool-v1 If '--fstab' is passed, and in fstab the filesystem is referred by UUID, only one UUID for filesystem is showed: $ ./findmnt -o TARGET,SOURCES --fstab TARGET SOURCES / UUID=d7a06504-cc14-435d-a5df-674da09c2894 /mnt/btrfs-raid1 UUID=b39b0b27-ff80-4cb4-bf48-0be939ff0788 However if you pass '-e', all the devices are showed $ ./findmnt -o TARGET,SOURCES --fstab -e TARGET SOURCES / /dev/sdg3 /mnt/btrfs-raid1 /dev/sdb2 /dev/sde2 /dev/sda2 [kzak@redhat.com: - support all tags (not only LABEL or UUID), - fix small memory leak, - simplify code] Signed-off-by: Goffredo Baroncelli Signed-off-by: Karel Zak misc-utils/findmnt.c | 104 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 75 insertions(+), 29 deletions(-) commit 0ef41cb69eb510c278c7d60d950d83aa5270e20f Author: Karel Zak Date: Fri Jan 28 09:32:52 2022 +0100 findmnt: fix compiler warning [-Werror=sign-compare] misc-utils/findmnt.c:1496:43: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] References: 68191a41174a691ac290a04171e9932f2028435a Signed-off-by: Karel Zak misc-utils/findmnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5c89558e56c7e3ed74ffecfadb2e6bc037e72b4e Merge: 4a7c84956 68191a411 Author: Karel Zak Date: Fri Jan 28 09:31:18 2022 +0100 Merge branch 'output-all' of https://github.com/t-8ch/util-linux commit 4a7c84956fe7afba9769607b10a61e7e6a22efef Merge: a64e99118 36a3923c8 Author: Karel Zak Date: Fri Jan 28 09:26:39 2022 +0100 Merge branch 'mount-nosymfollow' of https://github.com/jwilk-forks/util-linux * 'mount-nosymfollow' of https://github.com/jwilk-forks/util-linux: mount: Allow bind-mounting with "nosymfollow" commit 68191a41174a691ac290a04171e9932f2028435a Author: Thomas Weißschuh Date: Thu Jan 27 18:00:12 2022 +0100 findmnt: properly exclude poll columns from --output-all Previously columns excluded from --output-all where in fact stored as column index 0. This however is COL_ACTION which is a polled column leading to the following error: findmnt --output-all findmnt: ACTION column is requested, but --poll is not enabled Signed-off-by: Thomas Weißschuh misc-utils/findmnt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit a64e99118d3378efec9b77bc44e07436bd8fd600 Author: Karel Zak Date: Thu Jan 27 13:38:59 2022 +0100 libfdisk: don't use too small free segments by default Signed-off-by: Karel Zak libfdisk/src/gpt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit 921c7da55ec78350e4067b3fd6b7de6f299106ee Author: Karel Zak Date: Thu Jan 27 10:50:45 2022 +0100 libfdisk: (gpt) align size of partition by default LastUsableLBA (field in GPT header) is calculated to use all free space on the device. The problem is that size of this area is unaligned to optimal I/O (or physical sector size) on devices where the logical sector is 512 bytes, but the physical sector size is 4K. (Note that after LastUsableLBA is backup GPT header and size of this backup is calculated by logical sectors.) The problem is visible for the last partition on the device because this partition ends on LastUsableLBA. The ideal solution would be align directly LastUsableLBA number in the GPT header. Unfortunately, this solution is useless for libfdisk, because we have to be backwardly compatible with sfdisk scripts generated by old versions where is explicitly specified partition size. It seems usable compromise is to align only last partition if the size of the partition is unspecified or specified by relative number (+100M) -- in this case we already align partition, so there is no change in fdisk semantic (well, last partition will be smaller than in previous libfdisk versions). The unaligned partition size is a problem for dm-crypt where device size is used dynamically, and when unaligned, DM uses 512-bytes with a negative impact on performance. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2044108 Addresses: https://marc.info/?l=dm-crypt&m=164306225923513&w=2 Signed-off-by: Karel Zak libfdisk/src/gpt.c | 18 +++++++++++++----- tests/expected/fdisk/gpt-resize | 8 ++++---- tests/expected/libfdisk/gpt-all-defaults | 2 +- tests/expected/libfdisk/gpt-all-defaults-with-typo | 2 +- tests/expected/libfdisk/mkpart-gpt | 2 +- tests/expected/sfdisk/gpt-all-defaults | 2 +- tests/expected/sfdisk/gpt-attrs | 12 ++++++------ tests/expected/sfdisk/gpt-attrs-guid | 12 ++++++------ tests/expected/sfdisk/gpt-attrs-space | 12 ++++++------ tests/expected/sfdisk/gpt-attrs-with-typo | 12 ++++++------ tests/expected/sfdisk/wipe-gpt-to-dos | 4 ++-- tests/expected/sfdisk/wipe-gpt-to-dos-auto | 4 ++-- tests/expected/sfdisk/wipe-partition | 4 ++-- 13 files changed, 51 insertions(+), 43 deletions(-) commit 36a3923c8ab5ec1b939caee39f97268b4794456c Author: Jakub Wilk Date: Wed Jan 26 21:30:04 2022 +0100 mount: Allow bind-mounting with "nosymfollow" Signed-off-by: Jakub Wilk libmount/src/mountP.h | 2 +- sys-utils/mount.8.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 064604a3174e1d4057060256851ca26e801dba04 Author: Siu Ching Pong -Asuka Kenji- Date: Wed Jan 26 05:37:23 2022 +0800 libfdisk: incorrect GUID for NetBSD Fixes: https://github.com/util-linux/util-linux/issues/1580 Signed-off-by: Karel Zak include/pt-gpt-partnames.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 562990b5520ec8331dab25d139af8cb15d37e5a1 Author: Jan Kara Date: Thu Jan 20 13:16:39 2022 +0100 loopdev: Do not treat errors when detecting overlap as fatal When looking for overlapping loop device we can fail getting some loop device properties when we race with device autoclear. Just squelsh these errors and try next loop device. Signed-off-by: Jan Kara lib/loopdev.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit fb4b6b11544df405fb0f486b399938a8ee3f03e6 Author: Jan Kara Date: Thu Jan 20 13:16:38 2022 +0100 loopdev: Properly translate errors from ul_path_read_*() A few callsites do not translate error from ul_path_read_*() and just treat it as error code leading to confusing EPERM errors. Signed-off-by: Jan Kara lib/loopdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 3e1fc3bbee99384cf43c2677cf77756a0ef002c0 Author: Jan Kara Date: Thu Jan 20 12:47:05 2022 +0100 mount: Fix race in loop device reuse code Small timing changes in the kernel loop device handling broke the following loop: while :; do mount -o loop,ro isofs.iso isofs/; umount isofs/; done which quickly reports: mount: /mnt: can't read superblock on /dev/loop0. umount: /mnt: not mounted. And this loop is broken because of a subtle interaction with systemd-udevd that also opens the loop device. The race seems to be in mount(8) handling itself and the altered kernel timing makes it happen. It look like: bash systemd-udevd mount -o loop,ro isofs.iso isofs/ /dev/loop0 is created and bound to isofs.iso, autoclear is set for loop0 opens /dev/loop0 umount isofs/ loop0 still lives because systemd-udev still has device open mount -o loop,ro isofs.iso isofs/ gets to mnt_context_setup_loopdev() loopcxt_find_overlap() sees loop0 is still valid and with proper parameters reuse = true; close /dev/loop0 last fd closed => loop0 is cleaned up loopcxt_get_fd() opens loop0 but it is no longer the device we wanted! calls mount(2) which fails because we cannot read from the loop device Fix the problem by rechecking that loop device is still attached after opening the device. This makes sure the kernel will not autoclear the device anymore. Signed-off-by: Jan Kara libmount/src/context_loopdev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) commit 4eda4ec8af067702fcb23ec50a541411c5845594 Author: Karel Zak Date: Tue Jan 25 16:31:02 2022 +0100 script: add separator to header, update tests * add separator before "" * update test (due to 4d8edee5eeb3ea5457eeff321bca7dd64108eb8f) Signed-off-by: Karel Zak term-utils/script.c | 4 ++-- tests/expected/script/options-append | 4 ++-- tests/expected/script/options-force | 4 ++-- tests/expected/script/options-quiet | 4 ++-- tests/expected/script/options-return | 8 ++++---- tests/expected/script/options-size | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) commit bfcdfccf8af0ac822e1f4d927138b9b8225930e6 Author: Karel Zak Date: Tue Jan 25 16:18:31 2022 +0100 script: don't use \n when we log COMMAND The timing file format as well as typescript header do not expect line breaks. Replaces it white-space. Signed-off-by: Karel Zak term-utils/script.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 4d8edee5eeb3ea5457eeff321bca7dd64108eb8f Author: Karel Zak Date: Tue Jan 25 16:05:46 2022 +0100 script: add COMMAND= to log header Fixes: https://github.com/util-linux/util-linux/pull/1566 Co-Author: Henrik Bach Signed-off-by: Karel Zak term-utils/script.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) commit 417982d0236a12756923d88e627f5e4facf8951c Author: Stanislav Brabec Date: Tue Jan 25 11:50:21 2022 +0100 uuidd: Whitelist libuuid clock file Return back ProtectSystem to strict, and enable access to /var/lib/libuuid only. Note: As LIBUUID_CLOCK_FILE does not use @localstatedir@, we use /var here as well. Signed-off-by: Ali Abdallah Signed-off-by: Stanislav Brabec Signed-off-by: Karel Zak misc-utils/uuidd.service.in | 2 ++ 1 file changed, 2 insertions(+) commit cc999cce3234dde3f8fbdfc904a7839815172557 Author: Karel Zak Date: Tue Jan 25 11:04:13 2022 +0100 build-sys: generate all man pages for distribution tarball Now "make dist" and "make distcheck" follows autoconf. It means that disabled tools or tools that cannot compile are ignored, and man-pages for these tools are not generated. This is a problem for people without asciidoctor (adoc -> man generator). Fixes: https://github.com/util-linux/util-linux/issues/1577 Signed-off-by: Karel Zak Makefile.am | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) commit 4c989ad4748bc863989f86d6a4a7cc582294a2b1 Author: Karel Zak Date: Mon Jan 24 15:38:43 2022 +0100 docs: add man-common/in-bytes.adoc This commit unifies and improves --bytes option. Fixes: https://github.com/util-linux/util-linux/issues/1572 Signed-off-by: Karel Zak disk-utils/partx.8.adoc | 2 +- man-common/Makemodule.am | 1 + man-common/in-bytes.adoc | 7 +++++++ misc-utils/fincore.1.adoc | 2 +- misc-utils/findmnt.8.adoc | 2 +- misc-utils/lsblk.8.adoc | 2 +- misc-utils/lslocks.8.adoc | 2 +- sys-utils/ipcs.1.adoc | 3 ++- sys-utils/lscpu.1.adoc | 2 +- sys-utils/lsmem.1.adoc | 2 +- 10 files changed, 17 insertions(+), 8 deletions(-) commit f27876f9c1056bf41fd940d5c4990b4277e0024f Author: Karel Zak Date: Mon Jan 24 14:08:08 2022 +0100 uuidd: fix open/lock state issue * warn on open/lock state issue * remove ProtectSystem=strict from systemd service setting, because it makes clock state file read-only openat(AT_FDCWD, "/var/lib/libuuid/clock.txt", O_RDWR|O_CREAT|O_CLOEXEC, 0660) = -1 EROFS (Read-only file system) Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2040366 Signed-off-by: Karel Zak misc-utils/uuidd.c | 9 ++++++--- misc-utils/uuidd.service.in | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) commit 57202f5713afa2af20ffbb6ab5331481d0396f8d Author: Karel Zak Date: Wed Nov 24 13:53:25 2021 +0100 libmount: fix UID check for FUSE umount [CVE-2021-3995] Improper UID check allows an unprivileged user to unmount FUSE filesystems of users with similar UID. Signed-off-by: Karel Zak libmount/src/context_umount.c | 14 +++----------- libmount/src/mountP.h | 1 + libmount/src/optstr.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 11 deletions(-) commit f5ea9eee5e45f9349e67506e3f7c81d8087c1cde Author: Karel Zak Date: Fri Jan 21 14:49:47 2022 +0100 libblkid: optimize ioctl calls in blkid_probe_set_device() * call FDGETFDCSTAT only for block devices * don't check floppies for device-mapper, CD-ROM features or zones Signed-off-by: Karel Zak libblkid/src/probe.c | 64 ++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 30 deletions(-) commit 01b63ee348bc9744ec44fe5f77c2844dc12ec76b Author: Karel Zak Date: Fri Jan 21 12:57:29 2022 +0100 findmnt: (verify) support fstype patterns mount(8) supports fstype patterns/lists (like "udf,iso9660") in fstab. Let's support the same by --verify. Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e209dd35d2b116e0b8ccf3dd0436a0783cc4e572 Author: Karel Zak Date: Fri Jan 21 12:24:43 2022 +0100 findmnt: add reason to "cannot detect on-disk filesystem type" warning References: https://unix.stackexchange.com/questions/563688/findmnt-verify-gives-warning-cannot-detect-on-disk-filesystem-type Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 0b2cd9dc7363cd1141632ea986f8804338c67dc8 Author: Karel Zak Date: Fri Jan 21 12:10:44 2022 +0100 findmnt: (verify) ignore passno for btrfs "Traditional filesystems need to run their respective fsck utility in case the filesystem was not unmounted cleanly and the log needs to be replayed before mount. This is not needed for btrfs. You should set fs_passno to 0." https://btrfs.wiki.kernel.org/index.php/FAQ#When_will_Btrfs_have_a_fsck_like_tool.3F" Fixes: https://github.com/util-linux/util-linux/issues/1575 Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit c3ad1845ae35d45120c0051aebecf835a9fd76e7 Merge: 83e6a3f9d 7167a4545 Author: Karel Zak Date: Fri Jan 21 11:24:27 2022 +0100 Merge branch 'mkswap-pagesize' of https://github.com/jwilk-forks/util-linux * 'mkswap-pagesize' of https://github.com/jwilk-forks/util-linux: mkswap: (adoc) suggest looking up page size portably commit 83e6a3f9d2aecd0ffa8e5867bb8d7f0647fd3a74 Merge: 7cda56ae8 cca7821a0 Author: Karel Zak Date: Fri Jan 21 11:23:35 2022 +0100 Merge branch 'mount-spelling' of https://github.com/jwilk-forks/util-linux * 'mount-spelling' of https://github.com/jwilk-forks/util-linux: mount: (adoc) fix comma splice commit 7cda56ae83ee172b1728ed42ae70afadc01e3667 Author: Karel Zak Date: Fri Jan 21 11:21:48 2022 +0100 libblkid: reset errno after failed floppy test Signed-off-by: Karel Zak libblkid/src/probe.c | 1 + 1 file changed, 1 insertion(+) commit 7167a4545cbe28cb8bc3d9f7ceab6ad3a9a5879d Author: Jakub Wilk Date: Thu Jan 20 19:16:09 2022 +0100 mkswap: (adoc) suggest looking up page size portably Signed-off-by: Jakub Wilk disk-utils/mkswap.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cca7821a04b07a9843bb7b695dede4d522b7eddc Author: Jakub Wilk Date: Thu Jan 20 19:00:16 2022 +0100 mount: (adoc) fix comma splice Signed-off-by: Jakub Wilk sys-utils/mount.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2d24f9639917b1691266b7a82ce9273b4904c0c4 Author: Karel Zak Date: Mon Jan 17 12:37:13 2022 +0100 libblkid: reopen floppy without O_NONBLOCK Vladimir Sementsov-Ogievskiy wrote: > The commit "floppy: reintroduce O_NDELAY fix" was removed from kernel, > so we faced the bug described and discussed here: > https://bugzilla.suse.com/show_bug.cgi?id=3D1181018 > > Discussion in kernel list on reverting the commit: > https://www.spinics.net/lists/stable/msg493061.html > > In short, I can quote Jiri Kosina's comment: > > opening floppy device node with O_NONBLOCK is asking for all kinds > of trouble > > So opening floppy with O_NONBLOCK in blkid leads to failure of blkid, > probable failure of mount and unpleasant error messages in dmesg (see > also patch 02 for details). Based on patch from Vladimir. CC: Jiri Kosina Reported-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Karel Zak include/fileutils.h | 3 +++ lib/fileutils.c | 19 +++++++++++++++++++ libblkid/src/probe.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) commit d241d28c9e625a6c8e96235f78a2af876d0db4d9 Author: Karel Zak Date: Tue Jan 18 12:46:58 2022 +0100 unshare: fix typo in uint_to_id() Reported-by: Daniel Gerber Signed-off-by: Karel Zak sys-utils/unshare.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8bf585f7bbba3ccbe3784f1e4c618dafdd29d54e Author: Sean Anderson Date: Sat Jan 15 11:29:26 2022 -0500 unshare: Fix doc comments Several doc comments use the wrong terminology, or have mismatches descriptions. Fix them. Fixes: ff5dc96eb ("unshare: Add options to map blocks of user/group IDs") Signed-off-by: Sean Anderson Reported-by: Daniel Gerber sys-utils/unshare.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 9c05f4b6bf62a20a64a8e5735c7f3dcf0229e895 Author: Karel Zak Date: Tue Jan 18 12:30:11 2022 +0100 lib/strutils: make sure mem2strcpy() buffer is zeroized Let's make the function robust for work with strings and uninitialized buffers. Reported-by: Sean Anderson Signed-off-by: Karel Zak include/strutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 38e93216e8f484b55bd141cff3e4933cc6b35873 Author: Karel Zak Date: Mon Jan 17 16:24:21 2022 +0100 lscpu: remove unintended change Signed-off-by: Karel Zak sys-utils/lscpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 28f3c81943dc806e82d8ef5c235dfec60cd96580 Author: Karel Zak Date: Mon Jan 17 14:10:36 2022 +0100 tests: update lscpu output References: f592b88d0cd965e20ca1f492cadb3b8c8fd48a40 Signed-off-by: Karel Zak sys-utils/lscpu.c | 3 ++- 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-nested-virt | 1 + tests/expected/lscpu/lscpu-s390-zvm | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) commit ed1f6f10b12be36fd0d7080163e0920fe09df970 Author: Karel Zak Date: Mon Jan 17 12:36:11 2022 +0100 libblkid: remove unnecessary ifdef Signed-off-by: Karel Zak libblkid/src/probe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit e725fbb785aef8515e6a74b206a25203506547eb Merge: d85de4218 10490b33f Author: Karel Zak Date: Mon Jan 17 11:32:58 2022 +0100 Merge branch 'master' of https://github.com/mupuf/util-linux * 'master' of https://github.com/mupuf/util-linux: meson: do not generate fstrim.service if we do not have systemd commit d85de421826cc488f21ee70b8fdb8fb3f55318b7 Merge: f592b88d0 8fd1e7663 Author: Karel Zak Date: Mon Jan 17 11:31:08 2022 +0100 Merge branch 'more-zero' of https://github.com/stoeckmann/util-linux * 'more-zero' of https://github.com/stoeckmann/util-linux: more: improve zero size handling commit 8fd1e76631343aa2f0dadf8dcc511889e54e14f9 Author: Tobias Stoeckmann Date: Sun Jan 16 22:14:23 2022 +0100 more: improve zero size handling Sami Kerola pointed out that /proc contains files with zero size but content in ec4153cc28c718e064a1992a76a63ec7696d33a6. Eventually fixes for better type handling have been committed with ba105bb5eb0052ee7d85d0903ad4ae9e87114930 and error handling when "more" is called with directories in 32a4efc5675ca238d382a0027f7f4723b8b3af28. This commit fixes a regression and wrong file size handling: checkf ends execution prematurely if st.st_size is 0. The idea was to skip the check_magic call which would otherwise claim that a text file would not be one, e.g. /proc/self/wchan would fail otherwise. This has two consequences: 1. The last check in checkf is never true, because if st_size is 0 we already left the function (file_size and st_size are both off_t). Proof of Concept (use a window with less lines than /proc/cpuinfo): $ echo "hello world" > /tmp/more-poc $ more /tmp/more-poc /proc/cpuinfo - Press space to switch to next file - You see >100% in status line 2. Leaving early does not set the close on exit flag for empty files. 3. Since the last line is never reached, ~(off_t)0 is never set, which implies that the check in display_file is never true. The st.st_size = 0 case is supposed to be special. Simplify this regression fix by considering ctl->file_size = 0 to be special. This eleminates the ~(off_t)0 magic, which would be -1. Signed-off-by: Tobias Stoeckmann text-utils/more.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit 10490b33f7411c9fd358872c1969062b2a70f114 Author: Martin Roukala (né Peres) Date: Sun Jan 16 13:25:35 2022 +0200 meson: do not generate fstrim.service if we do not have systemd When systemd is disabled, the variable `systemdsystemunitdir` is missing, and thus we cannot install fstrim.service to it. This commit simply disables installing this service if systemd is not found or disabled. Signed-off-by: Martin Roukala (né Peres) sys-utils/meson.build | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) commit f592b88d0cd965e20ca1f492cadb3b8c8fd48a40 Author: Thomas Weißschuh Date: Sat Jan 15 09:54:08 2022 +0100 lspcu: Print dummy modelname if none present The logic in print_summary_cputype() starts a new hierarchy level under the CPUs "Model name" entry. If the model is unknown the hierarchy level will be skipped. This is visually confusing in the human-readable version and changes the schema of the JSON tree. sys-utils/lscpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 1e090fdc6e9729cd016867e44cdf8881fc3b7ede Author: Karel Zak Date: Wed Jan 12 16:08:08 2022 +0100 lsblk: sort usage() output Signed-off-by: Karel Zak misc-utils/lsblk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 554e866b94fc9965fef089cf480abea474dc9e34 Author: Karel Zak Date: Wed Jan 12 16:06:59 2022 +0100 lsblk: add --noempty Signed-off-by: Karel Zak misc-utils/lsblk.8.adoc | 3 +++ misc-utils/lsblk.c | 11 ++++++++++- misc-utils/lsblk.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) commit 9cd4666951672ddbd173cfaf3251aef61df49b14 Author: Karel Zak Date: Wed Jan 12 15:24:59 2022 +0100 docs: add link to GitHub TODO items Signed-off-by: Karel Zak Documentation/TODO | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 01e94325e676f36b364032a6f5a9acacfff4dbfb Author: Karel Zak Date: Wed Jan 12 15:01:46 2022 +0100 build-sys: improve setns, unshare and prlimit checks Addresses: https://github.com/util-linux/util-linux/issues/1526 Signed-off-by: Karel Zak configure.ac | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) commit c04c380b7adde7403e6b0823319d82277be3b91c Merge: 12d671858 bf3e1c789 Author: Karel Zak Date: Tue Jan 11 14:17:03 2022 +0100 Merge branch 'master' of https://github.com/anya-evergreen/util-linux * 'master' of https://github.com/anya-evergreen/util-linux: Return immediately when quit is seen commit 12d671858894163144f10b528ef05c11d045b8e0 Merge: 629af341a 764bb68af Author: Karel Zak Date: Tue Jan 11 13:55:30 2022 +0100 Merge branch 'sys-utils-unshare-pdeathsig-race' of https://github.com/earlchew/util-linux * 'sys-utils-unshare-pdeathsig-race' of https://github.com/earlchew/util-linux: unshare: Fix PDEATHSIG race for --kill-child commit 629af341af3fe415c4906c3233e97aad3339f9c6 Merge: 9e882685a f2f980177 Author: Karel Zak Date: Tue Jan 11 13:55:20 2022 +0100 Merge branch 'sys-utils-unshare-fork-signal-handling' of https://github.com/earlchew/util-linux * 'sys-utils-unshare-fork-signal-handling' of https://github.com/earlchew/util-linux: unshare: Propagate inherited signal handling to forked child commit 9e882685a3db3fd5e0870e7b94a4ea25ddc199c7 Author: Karel Zak Date: Mon Jan 10 16:32:44 2022 +0100 blkid: don't print all devices if only garbage specified There is small regression. The old version (before 64cfe6ac37631a6347bd4005c72dd2d37e737f5e) returns nothing when # blkid /dontexist specified on command line. Signed-off-by: Karel Zak misc-utils/blkid.c | 6 ++++++ 1 file changed, 6 insertions(+) commit f2f9801779e1664b7fa2d31c58fdb499191902ba Author: Earl Chew Date: Sun Jan 9 14:01:21 2022 -0800 unshare: Propagate inherited signal handling to forked child In #1086, signal(3) is used along with SIG_IGN, and SIG_DFL, to prevent premature termination of the parent. The present approach causes the forked child to have different inherited signal handling behaviour than original behaviour inherited by the parent. $ /usr/bin/unshare cat /proc/self/status | grep Sig SigQ: 0/15523 SigPnd: 0000000000000000 SigBlk: 0000000000000000 SigIgn: 0000000000000000 SigCgt: 0000000000000000 $ /usr/bin/unshare --fork cat /proc/self/status | grep Sig SigQ: 0/15523 SigPnd: 0000000000000000 SigBlk: 0000000000000000 SigIgn: 0000000000004002 SigCgt: 0000000000000000 As a consequence, if the command is killed, the outcome is different if --fork is used: $ /usr/bin/unshare sh -c 'kill $$' ; echo $? Terminated 143 $ /usr/bin/unshare --fork sh -c 'kill $$' ; echo $? 0 Instead use sigprocmask(2) to ensure that signal handling behaviour is propagated from the grandparent to the forked child. Signed-off-by: Earl Chew sys-utils/unshare.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) commit 764bb68af8e6d1b6c10a154c1dace64c450100c0 Author: Earl Chew Date: Sat Jan 1 14:44:47 2022 -0800 unshare: Fix PDEATHSIG race for --kill-child Kill the child explicitly should the parent terminate just before the child invokes prctl(PR_SET_PDEATHSIG). The underlying issue can be reproduced as follows: #!/bin/bash rm -f /tmp/unshare.log.* strace -ff -tt -o /tmp/unshare.log /usr/bin/unshare --kill-child --fork true head -1 /tmp/unshare.log.* while : ; do PARENT=$( /usr/bin/unshare --kill-child --fork bash -c 'echo $PPID' & sleep 0 # sleep 0.00$RANDOM kill -9 $! 2>/dev/null ) [ "$PARENT" != 1 ] || { echo "$PARENT" ; break ; } done Signed-off-by: Earl Chew sys-utils/unshare.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit b9d930d6c357a39c9b06e1c519d3ca872168d9fa Author: Karel Zak Date: Fri Jan 7 14:05:36 2022 +0100 libfdisk: (gpt) provide last LBA where is partitions array Addresses: https://github.com/util-linux/util-linux/issues/1554 Signed-off-by: Karel Zak libfdisk/src/gpt.c | 11 ++++++++++- libfdisk/src/libfdisk.h.in | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) commit 789bffdd7070b11749913072ebdacae72154d140 Author: Karel Zak Date: Fri Jan 7 13:49:40 2022 +0100 sulogin: fix compiler warning [-Werror=implicit-fallthrough=] and make sure errno is reset before read() Signed-off-by: Karel Zak login-utils/sulogin.c | 5 +++++ 1 file changed, 5 insertions(+) commit c03c5b58936ff0b84d323148b7cdf8a9f16f1274 Merge: d72c82f4d fc996d72e Author: Karel Zak Date: Fri Jan 7 13:47:58 2022 +0100 Merge branch 'syslog-su-pid' of https://github.com/thesamesam/util-linux * 'syslog-su-pid' of https://github.com/thesamesam/util-linux: su: use LOG_PID for syslog commit d72c82f4d18e2bbf29a09693152a8e3d89fa7b5f Author: Shigeki Morishima Date: Wed Jul 21 11:04:32 2021 +0900 sulogin: Display all kinds of errno during password input. If some error happens during password input, all kinds of errno will be displayed for investigation of the problem. Signed-off-by: Shigeki Morishima login-utils/sulogin.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit fc996d72e4469f1486feda25c76652549704635f Author: Sam James Date: Fri Jan 7 01:54:41 2022 +0000 su: use LOG_PID for syslog Enable PID in syslog lines for `su`. In Gentoo Linux, we recently switched `su` providers from shadow to util-linux. It was notiiced that syslog output differs slightly with util-linux (no PID): ``` Jan 7 20:00:50 localhost su: (to root) root on pts/5 Jan 7 20:00:50 localhost su: pam_unix(su:session): session opened for user root(uid=0) by sam(uid=0) ``` ... whereas shadow's `su` gave (with PID): ``` Jan 7 20:52:50 localhost su[22245]: Successful su for root by root Jan 7 20:52:50 localhost su[22245]: + /dev/pts/5 root:root ``` This change enables PID logging to give shadow-like syslog output for `su`: ``` Jan 7 20:54:32 localhost su[10827]: (to root) root on pts/6 Jan 7 20:54:32 localhost su[10827]: pam_unix(su:session): session opened for user root(uid=0) by sam(uid=0) ``` Signed-off-by: Sam James login-utils/su-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3afbdb58ea55a27b94a94c8fa28e79640d365ba5 Author: Karel Zak Date: Thu Jan 6 14:52:50 2022 +0100 libfdisk: (gpt) make fdisk -x output more readable The field "First LBA" is confusing; let's use "First usable LBA" as it's the official UEFI name for the field. Addresses: https://github.com/util-linux/util-linux/issues/1554 Signed-off-by: Karel Zak libfdisk/src/gpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 47831cc02ac0d71c335caecef1753f4c8861277c Author: tamz Date: Thu Jan 6 11:56:58 2022 +0100 agetty: resolve tty name even if stdin is specified [kzak@redhat.com: - use "const" for options->tty (and friends) as expected by get_terminal_name()] Addresses: https://github.com/util-linux/util-linux/issues/1546 Signed-off-by: tamz Signed-off-by: Karel Zak term-utils/agetty.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) commit a10b48c8492bcfc5242866c756769477d27a2584 Author: Vojtech Trefny Date: Thu Jan 6 09:11:27 2022 +0100 losetup: Add missing pipe to man example for setting up loop device "-f" and "loopdev" cannot be used together, the pipe was lost when converting the man pages to asciidoc. Signed-off-by: Vojtech Trefny sys-utils/losetup.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 22abf6df385b524acd78542fd8a3452ee1492002 Author: Karel Zak Date: Wed Jan 5 11:15:36 2022 +0100 libsmartcols: fix lines groups for multi-line cells Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2031303 Signed-off-by: Karel Zak libsmartcols/src/print.c | 83 +++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 29 deletions(-) commit dd69e525fd847a9af54326b72209d99c279b70d1 Author: Karel Zak Date: Wed Jan 5 11:04:05 2022 +0100 libsmartcols: add multi-line cells to samples Signed-off-by: Karel Zak libsmartcols/samples/grouping-overlay.c | 26 ++++++++++++++++---------- libsmartcols/samples/grouping-simple.c | 23 +++++++++++++++++------ 2 files changed, 33 insertions(+), 16 deletions(-) commit caa85688c2a4925bf84d65fb504d9b5df968835c Author: Karel Zak Date: Tue Jan 4 12:57:52 2022 +0100 meson: fix bash_completion.get_variable() use Addresses: https://github.com/util-linux/util-linux/pull/1549 Signed-off-by: Karel Zak meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ae478a85c1a4f9ed20d3de8047df95edb035ccbb Author: Karel Zak Date: Tue Jan 4 12:55:25 2022 +0100 tests: update mountinfo files References: 166e87368ae88bf31112a30e078cceae637f4cdb Signed-off-by: Karel Zak tests/expected/findmnt/filter-options | 1 - tests/expected/findmnt/filter-options-nameval-neg | 3 +-- tests/expected/findmnt/filter-types-neg | 1 - tests/expected/findmnt/outputs-default | 3 +-- tests/expected/findmnt/outputs-force-tree | 3 +-- tests/expected/findmnt/outputs-kernel | 3 +-- tests/expected/libmount/tabdiff-mount | 1 - tests/expected/libmount/tabdiff-move | 1 - tests/expected/libmount/tabdiff-remount | 1 - tests/expected/libmount/tabdiff-umount | 1 - tests/expected/libmount/tabfiles-parse-mountinfo | 11 ----------- tests/expected/libmount/tabfiles-py-parse-mountinfo | 11 ----------- tests/ts/findmnt/files/mountinfo | 1 - tests/ts/findmnt/files/mountinfo-nonroot | 1 - tests/ts/libmount/files/mountinfo | 1 - 15 files changed, 4 insertions(+), 39 deletions(-) commit aa519054ecfc9fd0d51d8f43328fecc4babdb05c Author: Karel Zak Date: Tue Jan 4 12:17:41 2022 +0100 meson: keep bash-completion symlinks in variable This is small consolidation, let's call meson_make_symlink from one place in loop. Addresses: https://github.com/util-linux/util-linux/pull/1549 Signed-off-by: Karel Zak meson.build | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) commit c18ed0a6e681311c031a173a8a7f10d70ab33011 Author: Karel Zak Date: Tue Jan 4 12:05:58 2022 +0100 build-sys: install lastb bash-completion Signed-off-by: Karel Zak bash-completion/Makemodule.am | 3 +++ 1 file changed, 3 insertions(+) commit 166e87368ae88bf31112a30e078cceae637f4cdb Author: Karel Zak Date: Tue Jan 4 10:37:55 2022 +0100 libmount: remove support for deleted mount table entries The "(deleted)" suffix has been originally used by kernel for deleted mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3 (Dec 2014) kernel does not use this suffix for mount stuff in /proc at all. Let's remove this support from libmount too. Signed-off-by: Karel Zak libmount/docs/libmount-sections.txt | 1 - libmount/src/fs.c | 11 ----------- libmount/src/libmount.h.in | 1 - libmount/src/libmount.sym | 1 - libmount/src/mountP.h | 1 - libmount/src/tab_parse.c | 7 ------- misc-utils/findmnt.c | 19 +------------------ 7 files changed, 1 insertion(+), 40 deletions(-) commit 355d3ef726278e03aa80430acc21d965d5c1566d Author: Karel Zak Date: Mon Jan 3 13:23:54 2022 +0100 mount: (man) fix example Fixes: https://github.com/util-linux/util-linux/issues/1539 Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit e193b097f7c7bba3c1705602324e0c4c6a924799 Merge: 6472cd54e f56f27ba1 Author: Karel Zak Date: Mon Jan 3 13:19:25 2022 +0100 Merge branch 'patch-3' of https://github.com/mariobl/util-linux * 'patch-3' of https://github.com/mariobl/util-linux: lsfd.1.adoc: Fix markup man pages: Fix punctuation, wording and markup commit 6472cd54ecfce875d5f33af2a1d5fe4f411032f1 Merge: 8ca793375 74c9dbae0 Author: Karel Zak Date: Mon Jan 3 13:13:09 2022 +0100 Merge branch 'master' of https://github.com/lishengyu/util-linux * 'master' of https://github.com/lishengyu/util-linux: fdisk: when use fdisk -l, open device in nonblock mode commit 8ca793375ec363b47ad065541c3cc1e5cd7f8f3a Merge: 30ec16710 38401453c Author: Karel Zak Date: Mon Jan 3 13:12:34 2022 +0100 Merge branch 'master' of https://github.com/HeroesLoveToRoujiamo/util-linux * 'master' of https://github.com/HeroesLoveToRoujiamo/util-linux: fdisk: open device in nonblock mode commit 30ec16710745326da1b5b0cce13bf737cff94156 Merge: f69acd2ec 3f7734ae6 Author: Karel Zak Date: Mon Jan 3 13:06:47 2022 +0100 Merge branch 'meson' of https://github.com/t-8ch/util-linux * 'meson' of https://github.com/t-8ch/util-linux: meson: only install pkgconfig if library is built meson: install manpages and bash completions meson: install examples to correct directory meson: headers: Install headers meson: headers: use util-linux version of version defines commit f69acd2ece87c6bc94ee5d8befb7a489ae9b3a04 Merge: d2dff42e5 dbb2fb390 Author: Karel Zak Date: Mon Jan 3 13:03:40 2022 +0100 Merge branch 'wording' of https://github.com/stoeckmann/util-linux * 'wording' of https://github.com/stoeckmann/util-linux: Fix wording in comments and documentation commit d2dff42e5b9423a05bb066063de9b794b613bcef Merge: aaa2218bb 1a48eee7b Author: Karel Zak Date: Mon Jan 3 13:03:06 2022 +0100 Merge branch 'fix_in_man-page' of https://github.com/losh/util-linux * 'fix_in_man-page' of https://github.com/losh/util-linux: Fix difference between short description and longer description by adding prefix commit aaa2218bb71558857a934d29fac1eb76f5de90bc Merge: 72be01d7e bae1a1ab6 Author: Karel Zak Date: Mon Jan 3 13:01:30 2022 +0100 Merge branch 'remove-duplicate' of https://github.com/surdina/util-linux * 'remove-duplicate' of https://github.com/surdina/util-linux: Remove duplicate 'setlocale' call commit 72be01d7ea5dca990160b4a64bbd52b87df3113f Merge: 5148c84eb 4a3e0a1b1 Author: Karel Zak Date: Mon Jan 3 12:55:29 2022 +0100 Merge branch 'typo_blkid_manpage' of https://github.com/sevenmaster/util-linux * 'typo_blkid_manpage' of https://github.com/sevenmaster/util-linux: Fixed minor typo in blkid manpage commit 3f7734ae6a1da38ee513e3df1b3366fd31a8c079 Author: Thomas Weißschuh Date: Thu Dec 30 22:57:24 2021 +0100 meson: only install pkgconfig if library is built libblkid/meson.build | 10 ++++++---- libfdisk/meson.build | 10 ++++++---- libmount/meson.build | 10 ++++++---- libsmartcols/meson.build | 10 ++++++---- libuuid/meson.build | 12 +++++++----- 5 files changed, 31 insertions(+), 21 deletions(-) commit 38bb89ee84d4cb79c16926611b7ced4f62f6d597 Author: Thomas Weißschuh Date: Thu Dec 30 16:35:03 2021 +0100 meson: install manpages and bash completions Signed-off-by: Thomas Weißschuh meson.build | 158 +++++++++++++++++++++++++++++++++++++-- tools/meson-make-manpage-stub.sh | 5 ++ 2 files changed, 156 insertions(+), 7 deletions(-) commit 12ebed03c3ae3939296cccd7d4b19898e8ccf3fd Author: Thomas Weißschuh Date: Thu Dec 30 16:33:33 2021 +0100 meson: install examples to correct directory Signed-off-by: Thomas Weißschuh meson.build | 2 +- misc-utils/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 7a7982f94e6a7208d61c3128d25a2b95fa44faa6 Author: Thomas Weißschuh Date: Thu Dec 30 16:31:10 2021 +0100 meson: headers: Install headers Fixes #1365 Signed-off-by: Thomas Weißschuh libblkid/meson.build | 5 ++++- libfdisk/meson.build | 5 ++++- libmount/meson.build | 5 ++++- libsmartcols/meson.build | 5 ++++- libuuid/meson.build | 1 + 5 files changed, 17 insertions(+), 4 deletions(-) commit f02de6de85c5c120e30607fdf15527fc0714f3dd Author: Thomas Weißschuh Date: Thu Dec 30 16:30:14 2021 +0100 meson: headers: use util-linux version of version defines This matches what autotools is doing. Signed-off-by: Thomas Weißschuh libblkid/meson.build | 6 +++++- libfdisk/meson.build | 8 ++++---- libmount/meson.build | 8 ++++---- libsmartcols/meson.build | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) commit dbb2fb39064f192b2faae1a515dfe5c55fa02526 Author: Tobias Stoeckmann Date: Thu Dec 30 13:49:47 2021 +0100 Fix wording in comments and documentation No functional change involved. Signed-off-by: Tobias Stoeckmann disk-utils/mkfs.c | 2 +- include/fileeq.h | 2 +- sys-utils/fsfreeze.8.adoc | 2 +- sys-utils/irqtop.1.adoc | 2 +- text-utils/rev.1.adoc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) commit 74c9dbae073d328f0358628be0dfd2e2f63eaa2b Author: lishengyu Date: Thu Dec 30 20:07:34 2021 +0800 fdisk: when use fdisk -l, open device in nonblock mode When autoclose is set (kernel default) opening a CD-rom device causes the tray to close. Signed-off-by: lishengyu disk-utils/fdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bae1a1ab6d253251bbe4c60e8240ade39ac67f0e Author: Alexandra Surdina Date: Mon Dec 27 18:18:23 2021 +0100 Remove duplicate 'setlocale' call Co-authored by: khaleesi Co-authored by: stoeckmann misc-utils/look.c | 2 -- 1 file changed, 2 deletions(-) commit 1a48eee7bfc09cdfa4b2627c5bde024a91679f30 Author: LoSh Date: Mon Dec 27 17:03:14 2021 +0100 Fix difference between short description and longer description by adding prefix misc-utils/look.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4a3e0a1b1083487afa08b93b6115ae67a7058b25 Author: 95p Date: Mon Dec 27 17:03:18 2021 +0100 Fixed minor typo in blkid manpage misc-utils/blkid.8.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit bf3e1c789337f65575fb2e2c6969e080e16e8c3c Author: Anya Date: Tue Dec 21 14:26:28 2021 +0000 Return immediately when quit is seen When a quit character is seen, immediately return that command, as it is the correct operation to perform in this case. A bigger fix is needed here, in that we need to have a *queue* of operations to perform, rather than a single one text-utils/more.c | 1 + 1 file changed, 1 insertion(+) commit 5148c84eb3fabdef66e4b87b0135608ed04c236f Author: Ali Saidi Date: Fri Dec 17 09:34:15 2021 -0600 lscpu: add additional arm cpu part numbers Add additional cpu part numbers I can find publicaly available Signed-off-by: Ali Saidi sys-utils/lscpu-arm.c | 6 ++++++ 1 file changed, 6 insertions(+) commit f56f27ba136b15b223608668ffdf96fba3f0f486 Author: Mario Blättermann Date: Thu Dec 16 13:40:40 2021 +0100 lsfd.1.adoc: Fix markup misc-utils/lsfd.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 38401453c522a7bf099c4e5a41056310dcd635b8 Author: changlianzhi Date: Thu Dec 16 10:56:25 2021 +0800 fdisk: open device in nonblock mode When autoclose is set (kernel default) opening a CD-rom device causes the tray to close. Signed-off-by: changlianzhi disk-utils/fdisk-list.c | 2 +- lib/ismounted.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 344b0cd4e8e09dc68394d2a549ae078789053108 Author: Mario Blättermann Date: Wed Dec 15 15:03:05 2021 +0100 man pages: Fix punctuation, wording and markup disk-utils/sfdisk.8.adoc | 6 +++--- misc-utils/findmnt.8.adoc | 8 ++++---- misc-utils/hardlink.1.adoc | 21 +++++++-------------- sys-utils/adjtime_config.5.adoc | 2 +- sys-utils/blkzone.8.adoc | 2 +- sys-utils/fstrim.8.adoc | 2 +- sys-utils/hwclock.8.adoc | 2 +- sys-utils/irqtop.1.adoc | 2 +- sys-utils/lsns.8.adoc | 5 +---- sys-utils/mount.8.adoc | 8 ++++---- sys-utils/nsenter.1.adoc | 2 +- 11 files changed, 25 insertions(+), 35 deletions(-) commit 312b64d9d1cedeac8d926cc503ffb4fbe023ade0 Author: Tobias Stoeckmann Date: Sat Oct 23 13:44:23 2021 +0200 su: Verify default SIGCHLD handling. The SIGCHLD handler could have been ignored by parent process. Make sure that we have default handling activated. Signed-off-by: Tobias Stoeckmann login-utils/su-common.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 161d3fd6c62167d3cd5f6e255648ba7391c28eb4 Author: Karel Zak Date: Mon Dec 13 13:34:42 2021 +0100 findmnt: (verify) add hint about systemctl daemon-reload Let's inform that systemd uses stuff older than fstab. Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) commit 1db0715169954a8f3898f7ca9d3902cd6c27084d Author: Karel Zak Date: Mon Dec 13 13:22:56 2021 +0100 mount: add hint about systemctl daemon-reload This commit implements an extra hint for systemd based distros to inform users that units currently used by systemd are older than fstab. This situation is usually unwanted, and 'systemctl daemon-reload' is recommended. The message is printed only on terminal to avoid extra messages in logs, etc. Addresses: https://github.com/systemd/systemd/pull/20476 Signed-off-by: Karel Zak include/pathnames.h | 2 ++ sys-utils/mount.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) commit 0cfb8c5c3205a92ae81def278cdded63ea47094f Author: Karel Zak Date: Mon Dec 13 13:19:18 2021 +0100 include/c: add cmp_timespec() and cmp_stat_mtime() It's like timercmp() in libc, but for timespec and for stat.st_mtim (or stat.st_mtime for old struct stat versions). Signed-off-by: Karel Zak include/c.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) commit b66b5b970e34fcf114d78d65b8be504f91b04065 Author: Karel Zak Date: Mon Dec 13 13:13:05 2021 +0100 build-sys: add USE_SYSTEMD Add info that systemd support is expected for tools where we do not link with any systemd libs, but we want to support some systemd stuff. Signed-off-by: Karel Zak configure.ac | 1 + 1 file changed, 1 insertion(+) commit 0aa42a8107d023e2cf4898d7ad205650ca4524f0 Author: Karel Zak Date: Fri Dec 10 16:22:07 2021 +0100 libblkid: check blkid_get_cache() return value [coverity scan] CID 374488: Error handling issues (CHECKED_RETURN) Calling "blkid_get_cache" without checking return value (as is done elsewhere 4 out of 5 times). It's probably unnecessary as we check the cache pointer later, but let's make it more robust for static analyzers. Signed-off-by: Karel Zak libblkid/src/evaluate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 7b5f2c977764dddf8667597275b44a3c821b1190 Merge: c80b3f320 fe66c5334 Author: Karel Zak Date: Fri Dec 10 15:20:28 2021 +0100 Merge branch 'lsfd-blkdev' of https://github.com/masatake/util-linux * 'lsfd-blkdev' of https://github.com/masatake/util-linux: tests: (lsfd) call ts_skip_nonroot earlier lsfd: fix a typo in comment lsfd: declare local variables at the beginning of block tests: (lsfd) add a case for listing a fd opening a block device tests: (lsfd) add a factory for opening a block device to the helper command lsfd: use the list of block devices in /proc/devices for decoding SOURCE column lsfd: add a helper function for reading bdevs in /prode/devices lsfd: move the code for reading /proc/devices to lsfd.c commit c80b3f3200486d8f11a56afa9bb2c27b9cc4ffe3 Author: Jeremi Piotrowski Date: Wed Dec 8 09:09:53 2021 -0800 libblkid/src/probe: check for ENOMEDIUM from ioctl(CDROM_LAST_WRITTEN) The CD device on Azure VMs returns CDS_DISC_OK from CDROM_DRIVE_STATUS even when no disc is present. In that case an ENOMEDIUM from CDROM_LAST_WRITTEN follows. Catch that and return error to prevent probing which results in hundreds of "unaligned transfer" warnings in the kernel logbuffer. Signed-off-by: Jeremi Piotrowski libblkid/src/probe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit fe66c5334d10d0ee527dccc1160f7924205802da Author: Masatake YAMATO Date: Thu Dec 9 00:33:49 2021 +0900 tests: (lsfd) call ts_skip_nonroot earlier Signed-off-by: Masatake YAMATO tests/ts/lsfd/column-kthread | 3 +-- tests/ts/lsfd/option-pid | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) commit d5c462952ad6c8b940253150fde21530c9767cad Author: Masatake YAMATO Date: Wed Dec 8 15:11:05 2021 +0900 lsfd: fix a typo in comment Signed-off-by: Masatake YAMATO misc-utils/lsfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3401af7c45890792f090c3a4579f4b13fc7720c1 Author: Masatake YAMATO Date: Wed Dec 8 14:55:06 2021 +0900 lsfd: declare local variables at the beginning of block Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 6599eb5f1adf3a6d20d412346dddbd3e26e7ae8e Author: Masatake YAMATO Date: Thu Dec 9 00:44:50 2021 +0900 tests: (lsfd) add a case for listing a fd opening a block device Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-ro-block-device | 14 ++++++ tests/ts/lsfd/mkfds-ro-block-device | 75 +++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) commit cb16b318d3726d3d839aa66a7a8e2c4b36ab5c04 Author: Masatake YAMATO Date: Wed Dec 8 22:30:57 2021 +0900 tests: (lsfd) add a factory for opening a block device to the helper command Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) commit fd2ae1e1b03cb8e9a76aa55c47769991f7dd5d4d Author: Karel Zak Date: Thu Dec 9 13:20:50 2021 +0100 findmnt: add SOURCES column to print all devices with the same tag It's the same like TARGETS for lsblk (the same device is possible to mount on more mountpoints). Here in findmnt we support by a new column SOURCES scenario when more devices (filesystems) use the same tag (LABEL, UUID, e.g.). For example: $ findmnt --fstab -oTARGET,SOURCES --evaluate --json UUID=b45897ca-ffc4-4089-8404-5d6072f5aee1 { "filesystems": [ { "target": "/mnt/test", "sources": [ "/dev/sdb1", "/dev/sdc" ] } ] } Fixes: https://github.com/util-linux/util-linux/issues/1078 Signed-off-by: Karel Zak misc-utils/findmnt.8.adoc | 2 +- misc-utils/findmnt.c | 51 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 3 deletions(-) commit c4762c436b2ee637d7752597cec950598d7d4486 Author: Karel Zak Date: Thu Dec 9 12:07:16 2021 +0100 sfdisk add --backup-pt-sectors The current option --backup is usable only when used with others sfdisk commands. The new command --backup-pt-sectors create backup and exit. Signed-off-by: Karel Zak bash-completion/sfdisk | 1 + disk-utils/sfdisk.8.adoc | 24 ++++++++++++++++++------ disk-utils/sfdisk.c | 37 +++++++++++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 8 deletions(-) commit 03fdf11833a7dc9ae9128be12e6fffc013a3855b Author: Karel Zak Date: Thu Dec 9 10:56:07 2021 +0100 isfdisk: improve --backup documentation * add reference to backup section * add note that backup is done always after startup * remove TODO item about --backup, it seems that back after open is only way how we can make it with current libfdisk, because fdisk_locate_disklabel() returns current in-memory rather than on-disk situation. Addresses: https://github.com/util-linux/util-linux/issues/850 Signed-off-by: Karel Zak Documentation/TODO | 6 ------ disk-utils/sfdisk.8.adoc | 10 ++++++---- 2 files changed, 6 insertions(+), 10 deletions(-) commit c340ff0508da940a188582f1ed04baad2ab9118a Author: Karel Zak Date: Wed Dec 8 16:55:03 2021 +0100 lslocks: add INODE and MAJ:MIN columns This is useful for use-cases (for example shell scripts) where we cannot filter by PIDs. Addresses: https://github.com/util-linux/util-linux/issues/1527 Signed-off-by: Karel Zak misc-utils/lslocks.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) commit 57d5ee16fffac5265db6a4d6785116358c16b5ea Author: Masatake YAMATO Date: Wed Dec 8 23:41:52 2021 +0900 lsfd: use the list of block devices in /proc/devices for decoding SOURCE column For decoding the SOURCE column of a fd opening a block devices, the origina code uses /proc/partitions only. However, this is not enough for decoding /dev/nullb0. Though is is a block device node, the block device behind the node is not listed in /proc/partitions. This change uses the information min /proc/devices as the fallback of /proc/partitions. Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 16 +++++++++++++++- misc-utils/lsfd.1.adoc | 3 +++ misc-utils/lsfd.c | 2 ++ misc-utils/lsfd.h | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) commit 00726e786564fef052fbc356b6435d156cecaf95 Author: Masatake YAMATO Date: Wed Dec 8 23:48:09 2021 +0900 lsfd: add a helper function for reading bdevs in /prode/devices Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 70 ++++++++++++++++++++++++++++++++++++++++++++----------- misc-utils/lsfd.h | 1 + 2 files changed, 57 insertions(+), 14 deletions(-) commit 3c0074005bbe3401131298e933ce1b787a895de2 Author: Masatake YAMATO Date: Wed Dec 8 23:02:45 2021 +0900 lsfd: move the code for reading /proc/devices to lsfd.c The original code is only for reading the names of character device drivers. For making the code reusable in reading that of block device drivers, rearrange the code an move it to the common area, lsfd.c. Signed-off-by: Masatake YAMATO misc-utils/lsfd-cdev.c | 86 ++++++-------------------------------------------- misc-utils/lsfd.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 76 deletions(-) commit ae9cf963f5f48a835f0cfc8e828f7c1414cf0376 Author: Karel Zak Date: Wed Dec 8 15:17:01 2021 +0100 prlimit: make syscall use more robust This is only cosmetic change to make code robust and compatible with other spaces where we use syscall(). Signed-off-by: Karel Zak sys-utils/prlimit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 35c138e43dba41f4ebe58c6d24d494cd20c2d9a7 Merge: 301d8fdf2 6458b7dac Author: Karel Zak Date: Wed Dec 8 14:16:08 2021 +0100 Merge branch 'patch-1' of https://github.com/Delapouite/util-linux * 'patch-1' of https://github.com/Delapouite/util-linux: uuidgen.1.adoc: mention uuidparse in SEE ALSO commit 301d8fdf26e7ce89054ed31df54f30ae7ee598f8 Merge: ada8dfaa0 db5aa5e5d Author: Karel Zak Date: Wed Dec 8 14:15:14 2021 +0100 Merge branch 'fix-overflow' of https://github.com/ChanthMiao/util-linux * 'fix-overflow' of https://github.com/ChanthMiao/util-linux: Fix integer overflow for alpha like linux commit ada8dfaa087aeb6c79e3f37165140c5555fc5a4b Merge: 2a596d704 7040b1f25 Author: Karel Zak Date: Wed Dec 8 14:13:36 2021 +0100 Merge branch 'patch-2' of https://github.com/mariobl/util-linux * 'patch-2' of https://github.com/mariobl/util-linux: lsfd.1.adoc: Improve punctuation and add translator comments lsfd.1.adoc: Fix yet another entry in the filter examples list lsfd.1.adoc: Fix wording and markup commit 6458b7dac2a8b0177e3024702b1b5b4591cdb76d Author: Bruno Heridet Date: Tue Dec 7 07:56:22 2021 +0100 uuidgen.1.adoc: mention uuidparse in SEE ALSO This indication mirrors the one found in uuidparse.1.adoc misc-utils/uuidgen.1.adoc | 1 + 1 file changed, 1 insertion(+) commit 7040b1f25145360ca8945d175db8135d848a4149 Author: Mario Blättermann Date: Mon Dec 6 20:11:17 2021 +0100 lsfd.1.adoc: Improve punctuation and add translator comments misc-utils/lsfd.1.adoc | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) commit 2a596d704fc730091a803784c0634d7eeefca87a Author: Karel Zak Date: Mon Dec 6 10:39:00 2021 +0100 hardlink: make reflink detection more robust [coverity scan] Signed-off-by: Karel Zak misc-utils/hardlink.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) commit db5aa5e5d8932c73f1b9f01fe567fa343898b825 Author: chanthmiao Date: Sun Dec 5 16:58:17 2021 +0800 Fix integer overflow for alpha like linux sys-utils/swapon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ea5c3ae5d21f74f976984efd9c921ed375c1e649 Author: Mario Blättermann Date: Thu Dec 2 20:59:02 2021 +0100 lsfd.1.adoc: Fix yet another entry in the filter examples list misc-utils/lsfd.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 902bc3cb18a82757d9021a278309c12195a67b2b Author: Mario Blättermann Date: Thu Dec 2 20:41:14 2021 +0100 lsfd.1.adoc: Fix wording and markup misc-utils/lsfd.1.adoc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) commit 2401078c9cf9ddec105e44af074cf2fcbd4ef153 Author: Karel Zak Date: Thu Dec 2 15:00:44 2021 +0100 hardlink: use open(O_CREAT) with mode Signed-off-by: Karel Zak misc-utils/hardlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0a7d5db621ff3aa4fb15438dd23715ef44e33bfe Author: Karel Zak Date: Thu Dec 2 14:25:59 2021 +0100 tests: update hardlink output Signed-off-by: Karel Zak tests/expected/hardlink/options-maximum-size-8191 | 14 +++++++------- tests/expected/hardlink/options-maximum-size-8192 | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) commit 66a38e97afe5bdbccda3098fc74506f4f1159cc5 Author: Karel Zak Date: Thu Dec 2 14:15:49 2021 +0100 hardlink: add reflinks support (add --reflinks and --skip-reflinks) Let's make XFS and BTRFS users more happy. The option --skip-reflinks forces hardlink to detect files with shared extends and --reflinks forces hardlink to create clones (FICLONE ioctl) rather than hardlinks. Addresses: https://github.com/util-linux/util-linux/issues/1447 Signed-off-by: Karel Zak misc-utils/hardlink.1.adoc | 19 +++- misc-utils/hardlink.c | 239 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 241 insertions(+), 17 deletions(-) commit d504b862cc36281bc6f41a45509fe78d5b93d42a Author: Karel Zak Date: Thu Dec 2 10:24:56 2021 +0100 unshare: fix memory leak [coverity scan] Signed-off-by: Karel Zak sys-utils/unshare.c | 3 +++ 1 file changed, 3 insertions(+) commit 4939964c9d1977522de1a3de03ebb3011ca866de Author: Karel Zak Date: Wed Dec 1 15:42:52 2021 +0100 hardlink: call size_to_human_string() only when necessary Signed-off-by: Karel Zak misc-utils/hardlink.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) commit fd1e57a79e90a88213e0b55c3ad232d5312ee25c Author: Karel Zak Date: Wed Dec 1 15:38:50 2021 +0100 hardlink: simplify file_link() Signed-off-by: Karel Zak misc-utils/hardlink.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) commit a4c0e359d4e44dc3f3c5706854a537c63c4233db Author: Sean Anderson Date: Wed Nov 24 13:26:18 2021 -0500 unshare: Document --map-{groups,users,auto} This documents the new options added in the previous few commits. I have added another example to better demonstrate the these options. The actual use is fairly straightforward, but the descriptions are on the pithier side. Signed-off-by: Sean Anderson sys-utils/unshare.1.adoc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) commit e67b0ba3889d6090fab19b4739d6c735456a851f Author: Sean Anderson Date: Wed Nov 24 13:26:17 2021 -0500 unshare: Add option to automatically create user and group maps This option is designed to handle the "garden path" user/group ID mapping: - The user has one big map in /etc/sub[u,g]id - The user wants to map as many user and group IDs as they can, especially the first 1000 users and groups. The "auto" map is designed to handle this. We find the first map matching the current user, and then map the whole thing to the ID range starting at ID 0. Signed-off-by: Sean Anderson include/pathnames.h | 3 ++ sys-utils/unshare.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 85 insertions(+), 2 deletions(-) commit ff5dc96ebf2bf83150ba1fa73f4498ed2210c29c Author: Sean Anderson Date: Wed Nov 24 13:26:16 2021 -0500 unshare: Add options to map blocks of user/group IDs This adds the ability to map multiple user/group IDs when creating a new user namespace. Regular processes cannot map any user other than the effective user, so we need to use the setuid helpers newuidmap and newgidmap, provided by shadow. Typically, users will be assigned blocks of user/group IDs in /etc/sub{u,g}id, although it is also possible to use NSS. There is a second advantage in using these helpers: because we never write to /proc/self/gid_map, we don't have to disable setgroups. Because the process of mapping IDs is almost identical, whether we are mapping user IDs or group IDs, we put both in a common "map_range" structure. These are read in by (ab)using string_to_idarray. In addition to any map created with --map-users, we still need to handle a map of size one created with --map-user. This makes constructing the helpers' command line the trickiest part of the whole process. newuidmap/ newgidmap check to see if any ranges overlap before creating a mapping. To avoid failing, we carve out a hole in the mapping for the singular map. In the worst case, we may have three separate maps. Signed-off-by: Sean Anderson sys-utils/unshare.c | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 251 insertions(+), 4 deletions(-) commit 783bb52a96e901133662fe93f8671c982db3934a Author: Sean Anderson Date: Wed Nov 24 13:26:15 2021 -0500 unshare: Add some helpers for forking and synchronizing There is (or rather, will be) a common pattern in unshare like /* parent */ /* child */ fork() do_some_work() sync() wait(); do_more_work(); wait() exit(); where the parent has to do some tasks (unshare(), fork() again, etc) before the child can do its work. At the moment this is implemented explicitly with a pipe(). Add some helper functions to abstract this process away. In addition, switch to eventfd() instead of pipe(). As the man page for eventfd(2) notes, > Applications can use an eventfd file descriptor instead of a pipe (see > pipe(2)) in all cases where a pipe is used simply to signal events. The > kernel overhead of an eventfd file descriptor is much lower than that of > a pipe, and only one file descriptor is required (versus the two required > for a pipe). Signed-off-by: Sean Anderson sys-utils/unshare.c | 109 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 41 deletions(-) commit 82ea629868122b1c2dc870ae8869af6e6e258edb Author: Sean Anderson Date: Wed Nov 24 13:26:14 2021 -0500 unshare: Add waitchild helper This refactors out the waitpid() logic into a function which will be reused for the upcoming patches. Signed-off-by: Sean Anderson sys-utils/unshare.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) commit adc21ee18fb8af79adaf9d4254ab0f935e38f784 Author: Sean Anderson Date: Wed Nov 24 13:26:13 2021 -0500 include/c: Add abs_diff macro This macro calculates abs(a - b). It is especially useful for unsigned numbers. Signed-off-by: Sean Anderson include/c.h | 8 ++++++++ 1 file changed, 8 insertions(+) commit 9a1b1f82b75fe0cbc9d9b356fe1f7c62be45e635 Author: Karel Zak Date: Wed Dec 1 12:35:42 2021 +0100 libmount: disable mtab only on statfs() success only Signed-off-by: Karel Zak libmount/src/context_umount.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit e9de8d3bc1a4e198c4dc46999546b5f41ef3e2f5 Author: Karel Zak Date: Tue Nov 30 15:02:10 2021 +0100 lsns: fix compilation on old systems without linux/nsfs.h Addresses: https://github.com/util-linux/util-linux/pull/1521 Reported-by: Anatoly Pugachev Signed-off-by: Karel Zak sys-utils/lsns.c | 131 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 58 deletions(-) commit 97c61e5ee55d51e98dab40f8466d9b9f10483ac3 Author: Karel Zak Date: Tue Nov 30 14:24:40 2021 +0100 lscpu: (arm) remove extra whitespace Signed-off-by: Karel Zak sys-utils/lscpu-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 27da9ab0cd5a841d67edf15cb0ef2401ae0520d5 Merge: 5ab35198d 5462d4438 Author: Karel Zak Date: Tue Nov 30 14:21:38 2021 +0100 Merge branch 'mantypo' of https://github.com/vice/util-linux * 'mantypo' of https://github.com/vice/util-linux: script.1.adoc: correct socond as second commit 5462d4438335e1a1cfbc8ab5de50447c72cc263a Author: Vicente Jimenez Aguilar Date: Tue Nov 30 12:07:54 2021 +0100 script.1.adoc: correct socond as second term-utils/script.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5ab35198d270cbe7584bcd0e0801963658ef658d Author: panchenbo Date: Tue Nov 30 14:25:57 2021 +0800 Add Earlier Phytium cores sys-utils/lscpu-arm.c | 2 ++ 1 file changed, 2 insertions(+) commit 135dd1dd14712a3a19ec723729a2943e38b1e4be Merge: 575a66678 225154fed Author: Karel Zak Date: Mon Nov 29 16:06:30 2021 +0100 Merge branch 'lsfd-test-normalize-protoname' of https://github.com/masatake/util-linux * 'lsfd-test-normalize-protoname' of https://github.com/masatake/util-linux: tests: (lsfd) normalize protoname before comparing commit 575a66678b44f744d76a132ee30b9cec84e6dfe0 Merge: d5ebd3ffb 3ebd59397 Author: Karel Zak Date: Mon Nov 29 16:04:53 2021 +0100 Merge branch 'mkfds-fix-fd-leak-via-dup2' of https://github.com/masatake/util-linux * 'mkfds-fix-fd-leak-via-dup2' of https://github.com/masatake/util-linux: tests: (lsfd) fix file descriptor leaks reported by coverity commit d5ebd3ffbbb54656b6f6afc0c696d0b11a76600c Merge: b86ed6240 6860e8ef1 Author: Karel Zak Date: Mon Nov 29 16:03:40 2021 +0100 Merge branch 'lsfd--test-minor-fixes' of https://github.com/masatake/util-linux * 'lsfd--test-minor-fixes' of https://github.com/masatake/util-linux: tests: (lsfd) give missing test descriptions tests: (lsfd) don't compare inodes commit b86ed62409ea653cbb618f51755846c9f120c8c0 Author: Karel Zak Date: Mon Nov 29 15:32:27 2021 +0100 irqtop: don't ignore sscanf() return code [coverity scan] Signed-off-by: Karel Zak sys-utils/irq-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit c88fc0c3d056ee1eeb3ac82caf11a3779b85349a Author: Karel Zak Date: Mon Nov 29 15:30:10 2021 +0100 hwclock: don't ignore sscanf() return code [coverity scan] Signed-off-by: Karel Zak sys-utils/hwclock.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) commit 573f4cc9404e1bee82402d498d26f39e438399ba Author: Karel Zak Date: Mon Nov 29 15:26:49 2021 +0100 utmpdump: don't ignore sscanf() return code [coverity scan] Signed-off-by: Karel Zak login-utils/utmpdump.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 14069f1e5929ea8213197232558ac9102a8c35dc Author: Karel Zak Date: Mon Nov 29 15:21:55 2021 +0100 libblkid: ignore scanf() result when read number of stripes [coverity scan] Signed-off-by: Karel Zak libblkid/src/topology/lvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3ebd593974780fa8be234e9716b15ddfa8db094b Author: Masatake YAMATO Date: Mon Nov 29 23:04:04 2021 +0900 tests: (lsfd) fix file descriptor leaks reported by coverity The oldfd argument of dup2 is not closed automatically. It must be closed explicitly. Close #1517. Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 56 ++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 22 deletions(-) commit 6860e8ef153ad5539245b578373bdf65957d7cc0 Author: Masatake YAMATO Date: Mon Nov 29 23:12:23 2021 +0900 tests: (lsfd) give missing test descriptions Signed-off-by: Masatake YAMATO tests/ts/lsfd/column-kthread | 2 +- tests/ts/lsfd/option-pid | 2 +- tests/ts/lsfd/option-summary | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit 28ba2421cc3d31677739de5ad31bdffc67dcb224 Author: Masatake YAMATO Date: Mon Nov 29 23:01:04 2021 +0900 tests: (lsfd) don't compare inodes The numbers for the inodes (cwd and rtd) are different in platforms (or file systems). Signed-off-by: Masatake YAMATO tests/expected/lsfd/column-kthread | 10 +++++----- tests/ts/lsfd/column-kthread | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) commit 225154fedffe5b3898508cb13a2e5b5251c7816c Author: Masatake YAMATO Date: Mon Nov 29 22:26:03 2021 +0900 tests: (lsfd) normalize protoname before comparing This is a follow-up commit to a60ac11fe0087584f37329b4733edfade3452c64. > In the commit, the protoname of (AF_UNIX, SOCK_DGRAM) sockets was also > changed to "UNIX-DGRAM". However, it was renamed back to "UNIX" in > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0edf0824e0dc359ed76bf96af986e6570ca2c0b9 To make this test case more portable, this change makes the test case accept "UINX-DGRAM" in addition to "UINX", too. Signed-off-by: Masatake YAMATO tests/ts/lsfd/mkfds-socketpair | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 399b78ea30a915e69f7b4ab6ad711d5f1ca5cbdc Author: Karel Zak Date: Mon Nov 29 14:00:42 2021 +0100 lsfd: check ul_strtou*() return code [coverity scan] Signed-off-by: Karel Zak misc-utils/lsfd-file.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) commit acc47228f09202383e19ba844679e129531f63c1 Author: Karel Zak Date: Mon Nov 29 13:46:17 2021 +0100 lsfd: fix copy & past error [coverity scan] 1235 if (right->type != NODE_NUM) { 1236 snprintf(parser->errmsg, ERRMSG_LEN, 1237 _("error: unexpected right operand type %s for: %s"), >>> CID 374358: Incorrect expression (COPY_PASTE_ERROR) >>> "left" in "left->type" looks like a copy-paste error. 1238 NODE_CLASS(left)->name, 1239 op2_class->name); 1240 return false; 1241 } Signed-off-by: Karel Zak misc-utils/lsfd-filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f22ef0fefd6fc5cd1c0c8cf8cc9ab129ed58c4aa Author: Karel Zak Date: Mon Nov 29 13:41:36 2021 +0100 lsfd: fix use-after-free and resource leak [coverity scan] >>> CID 374363: Memory - illegal accesses (USE_AFTER_FREE) >>> Dereferencing freed pointer "t". 764 snprintf(parser->errmsg, ERRMSG_LEN, 765 _("error: unsupported column data type: %d, column: %s"), 766 jtype, t->val.str); 856 default: 857 warnx("unexpected token type: %d", t->type); >>> CID 374360: Resource leaks (RESOURCE_LEAK) >>> Variable "t" going out of scope leaks the storage it points to. 858 return NULL; Signed-off-by: Karel Zak misc-utils/lsfd-filter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 49fe65af3a876520cf025058c3adfdf149c4461a Author: Karel Zak Date: Mon Nov 29 13:35:35 2021 +0100 lsfd: make sure we do not use uninitialized struct stat [coverity scan] 540 if (is_association(f, NS_MNT)) >>> CID 374364: Uninitialized variables (UNINIT) >>> Using uninitialized value "sb.st_ino". 541 proc->ns_mnt = sb.st_ino; Signed-off-by: Karel Zak misc-utils/lsfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 41a27709e9028940578a5cdae17292e432fa23fa Author: Karel Zak Date: Mon Nov 29 13:25:16 2021 +0100 lib/path: make path use more robust [coverity scan] *** CID 374365: Null pointer dereferences (FORWARD_NULL) /lib/path.c: 364 in ul_path_stat() Signed-off-by: Karel Zak lib/path.c | 5 ++++- lib/sysfs.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) commit 27f68508fec0ff6fc6ab00ebb73a2bbf0abdfbfc Author: Karel Zak Date: Mon Nov 29 13:11:13 2021 +0100 lslocks: check scanf() return code [coverity scan] Signed-off-by: Karel Zak misc-utils/lslocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit d31a1c95d297778b2c74f8bd009be68224a9f358 Merge: 40f48263c 42c8ad637 Author: Karel Zak Date: Mon Nov 29 11:13:00 2021 +0100 Merge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux * 'patch-1' of https://github.com/ThomasKaiser/util-linux: Add Apple cores, fix Phytium core names commit 40f48263cbf7442b91dc9164716c279db537dc46 Merge: 3228876f1 4660286e9 Author: Karel Zak Date: Mon Nov 29 11:08:05 2021 +0100 Merge branch 'master' of https://github.com/AndrewGMorgan/util-linux commit 3228876f17f5c72fb0566be0c06c14fec422ff29 Merge: 5d19f1dc9 a60ac11fe Author: Karel Zak Date: Mon Nov 29 11:06:58 2021 +0100 Merge branch 'lsfd-testcase-for-socketpair' of https://github.com/masatake/util-linux commit 5d19f1dc9db0406597b928be2e7459c86e3881ff Merge: d6f6cc8c6 f2c3f2c7b Author: Karel Zak Date: Mon Nov 29 11:05:12 2021 +0100 Merge branch 'lsfd' of https://github.com/mator/util-linux * 'lsfd' of https://github.com/mator/util-linux: build-sys: add configure option to disable lsfd don't build lsfd, if linux header kcmp.h is missing commit 42c8ad6378b2d6e48e72ca5039159580e12b4589 Author: ThomasKaiser Date: Sun Nov 28 16:39:47 2021 +0100 Add Apple cores, fix Phytium core names See https://www.spinics.net/lists/arm-kernel/msg879381.html and https://en.wikipedia.org/wiki/FeiTeng_(processor)#Future_processors (S2500 and D2000 are SoCs and contain 4 or 8 FTC663 cores). sys-utils/lscpu-arm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit 4660286e9cdff6d95b49295674b96f83af10ea36 Author: Andrew G. Morgan Date: Sat Nov 27 21:00:22 2021 -0800 Complete Linux-PAM compliance for forked child in su and login. As documented here: http://www.linux-pam.org/Linux-PAM-html/adg-interface-by-app-expected.html#adg-pam_end The child that is about to exec*() the user shell is supposed to pam_end() with PAM_DATA_SILENT. This gives the modules a last chance to do a minor cleanup of the module state before the user's shell is launched. Signed-off-by: Andrew G. Morgan login-utils/login.c | 3 +++ login-utils/su-common.c | 3 +++ 2 files changed, 6 insertions(+) commit d6f6cc8c64e4ca3c32a5529787e899ffd81e56b9 Author: Paul Sarena Date: Fri Nov 26 18:14:25 2021 -0800 sfdisk man: Escape ((…)) to avoid AsciiDoc interpreting and stripping from manpage disk-utils/sfdisk.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a60ac11fe0087584f37329b4733edfade3452c64 Author: Masatake YAMATO Date: Sat Nov 27 09:39:42 2021 +0900 tests: (lsfd) make DGRAM socketpair to mitigate the change of protoname The protoname for a socket can be get from its xattr slot of /proc/$PID/fd/$FD. The protoname for (AF_UNIX, SOCK_STREAM) sockets was changed from "UNIX" to "UNIX-STREAM" in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=94531cfcbe79c3598acf96806627b2137ca32eb9 As the result, the test case, mkfds-socketpair doesn't work well on a newer kernel. To mitigate the impact of the change in the kernel, use (AF_UNIX, SOCK_DGRAM) for making a socket pair. In the commit, the protoname of (AF_UNIX, SOCK_DGRAM) sockets was also changed to "UNIX-DGRAM". However, it was renamed back to "UNIX" in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0edf0824e0dc359ed76bf96af986e6570ca2c0b9 Partially close #1511. Signed-off-by: Masatake YAMATO tests/ts/lsfd/mkfds-socketpair | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f2c3f2c7bc1f52b7ff442baa1f2a6b49d273f2e1 Author: Anatoly Pugachev Date: Sat Nov 27 02:48:28 2021 +0300 build-sys: add configure option to disable lsfd configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit f4d700d78afbd91be5cb458ddf9e7c39712dc73c Author: Anatoly Pugachev Date: Fri Nov 26 20:28:00 2021 +0300 don't build lsfd, if linux header kcmp.h is missing configure.ac | 3 +++ 1 file changed, 3 insertions(+) commit 3819419ed9694ad083cfc7105dafc2a88c2f726b Author: Paul Sarena Date: Fri Nov 26 15:34:02 2021 -0800 Escape ((…)) in AsciiDoc to fix broken example In AsciiDoc, double parentheses are used to mark flow index terms, but in this document, their use is intended to be interpreted by the shell's arithmetic expansion. By escaping them with a backslash in the AsciiDoc, they pass through as-is to the manpage and other targets. So, instead of a rendered result of `dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$0x00000438 bs=1 conv=notrunc`, we get `dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc`. Seperately, when interpreted by a shell's arithmetic expansion, the 0x00000438 hex is converted to decimal 1080 `dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=1080 bs=1 conv=notrunc` misc-utils/wipefs.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 57d9fd2bea629f211bdd30a12cacc759c0b4f93b Author: Karel Zak Date: Fri Nov 26 19:45:29 2021 +0100 hardlink: fix compiler warning [-Wformat=] misc-utils/hardlink.c:726:48: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘__nlink_t’ Reported-by: Anatoly Pugachev Signed-off-by: Karel Zak misc-utils/hardlink.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 1b44d0923281173409c71aef551334e78820878d Merge: fe56bcfa8 0d681980c Author: Karel Zak Date: Fri Nov 26 12:12:54 2021 +0100 Merge branch 'topic/lsfd' commit fe56bcfa8f125c53fd7ee0eb6670d07b83d9bd8e Merge: 64cfe6ac3 f6385a6ad Author: Karel Zak Date: Thu Nov 25 12:35:24 2021 +0100 Merge branch 'patch-3' of https://github.com/Hello71/util-linux * 'patch-3' of https://github.com/Hello71/util-linux: loopdev: accept ENOSYS for LOOP_CONFIGURE commit 64cfe6ac37631a6347bd4005c72dd2d37e737f5e Author: Karel Zak Date: Thu Nov 25 11:54:26 2021 +0100 blkid: check device type and name before probe For calls "blkid /dev/*", it seems better to check the device type and name before we open the device in libblkid. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2026511 Signed-off-by: Karel Zak misc-utils/blkid.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) commit 7eb6d9ce4526b968e30f7e538cbbbdf9938e5891 Author: Karel Zak Date: Thu Nov 25 11:54:11 2021 +0100 libblkid: check UBI char device name Signed-off-by: Karel Zak libblkid/src/probe.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit ab5304a7a34bfa45d9bee205ca4e26f03db6e79d Author: Karel Zak Date: Thu Nov 25 11:52:46 2021 +0100 lib/sys: add sysfs_chrdev_devno_to_devname() Signed-off-by: Karel Zak include/sysfs.h | 2 ++ lib/sysfs.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) commit f6385a6adeea6be255d68016977c5dd5eaab05da Author: Alex Xu <351006+Hello71@users.noreply.github.com> Date: Wed Nov 24 20:34:10 2021 +0000 loopdev: accept ENOSYS for LOOP_CONFIGURE qemu returns this if it doesn't understand the ioctl. according to ioctl(2) it should actually return EINVAL, but considering that it's been doing this for at least 20 years already, I doubt there's much appetite for change, considering that it has a slightly better error message if propagated back to the user and changing it to EINVAL may break other programs. lib/loopdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0d681980c4efbcc7f280bae3bcbe8920ba8324eb Author: Karel Zak Date: Wed Nov 24 15:00:45 2021 +0100 lsfd: cleanup --summary semantic Signed-off-by: Karel Zak misc-utils/lsfd.1.adoc | 4 ++-- misc-utils/lsfd.c | 36 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 19 deletions(-) commit 4441e511635f3e4116b59a77da1e4ca68552c3cc Author: Karel Zak Date: Wed Nov 24 12:22:27 2021 +0100 findmnt: add support to print deleted targets Signed-off-by: Karel Zak misc-utils/findmnt.8.adoc | 3 +++ misc-utils/findmnt.c | 22 +++++++++++++++++++--- misc-utils/findmnt.h | 15 ++++++++------- 3 files changed, 30 insertions(+), 10 deletions(-) commit 9c590e53800de83adbc111957ab008b410c1dd9d Author: Karel Zak Date: Wed Nov 24 12:20:15 2021 +0100 libmount: add mnt_fs_is_deleted() Signed-off-by: Karel Zak libmount/docs/libmount-sections.txt | 1 + libmount/src/fs.c | 11 +++++++++++ libmount/src/libmount.h.in | 1 + libmount/src/libmount.sym | 1 + libmount/src/mountP.h | 1 + libmount/src/tab_parse.c | 4 +++- 6 files changed, 18 insertions(+), 1 deletion(-) commit 0cbb001a1e082c540011fced1eb1b0fef9e7a27e Author: Karel Zak Date: Mon Nov 22 13:18:54 2021 +0100 nsenter: add --wdns to change working directory The current --wd= changes CWD to the path which is opened *before* nsenter calls setns(). It may be useful if you want to use in namespace something from your current namespace. In this case, the option --wd works like a "tunnel" between namespaces. For some other use-cases, this is useless and you want to be sure that CWD always points to the target namespace. For this purpose this patch implements --wdns . Example: Setup the namespaces: # unshare --mount  # mount /dev/sdc /mnt/A # touch /mnt/A/fooooo  # echo $$ 2425872 Enter the namespace from another session: # nsenter --all --target 2425872 --wd=/mnt/A ls -a . .. # nsenter --all --target 2425872 --wdns=/mnt/A ls -a . .. fooooo lost+found Fixes: https://github.com/util-linux/util-linux/issues/1500 Signed-off-by: Karel Zak bash-completion/nsenter | 1 + sys-utils/nsenter.1.adoc | 7 +++++-- sys-utils/nsenter.c | 27 +++++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) commit 8e718304070a21146f4ee16dfc8f2a6018102ec0 Author: Karel Zak Date: Mon Nov 22 10:34:14 2021 +0100 login: (adoc) add hint about PAM and env.variables Fixes: https://github.com/util-linux/util-linux/issues/1507 Signed-off-by: Karel Zak login-utils/login.1.adoc | 2 ++ 1 file changed, 2 insertions(+) commit 9c4de946a3b002b1d23d3d7f088b22bdea46ecbc Author: Karel Zak Date: Mon Nov 22 10:23:52 2021 +0100 flock: (adoc) fix example Fixes: https://github.com/util-linux/util-linux/issues/1506 Signed-off-by: Karel Zak sys-utils/flock.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9d745bbb9866f9d0b2025b0f319558f193d30531 Author: Karel Zak Date: Mon Nov 22 10:22:09 2021 +0100 script: (adoc) improve man page readability Signed-off-by: Karel Zak term-utils/script.1.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 84d38ae3eca523ef990cb848563cc63de25266e6 Author: Karel Zak Date: Fri Nov 19 14:19:03 2021 +0100 libblkid: don't mark cache as "probed" if /sys not available For "mount --all" we need to read the cache more than once in a short time. The library checks the delay between probes, and if the delay is too short, it does not read devices. This is a problem on boot when there are no /sys, and the cache is empty. In this case, we need to check for /sys until it's available constantly. https://github.com/util-linux/util-linux/issues/1492 Signed-off-by: Karel Zak libblkid/src/devname.c | 26 +++++++++++++++++--------- libblkid/src/resolve.c | 2 +- libblkid/src/tag.c | 8 +++++--- 3 files changed, 23 insertions(+), 13 deletions(-) commit 93c53207c08d044bddae7b9d559c80affbd449c6 Author: Karel Zak Date: Fri Nov 19 12:55:54 2021 +0100 lslogins: remove unwanted debug message Signed-off-by: Karel Zak login-utils/lslogins.c | 3 --- 1 file changed, 3 deletions(-) commit 2b0a4de36c94326f474da75bb50db0b6e90213cb Author: Masatake YAMATO Date: Fri Nov 19 00:14:50 2021 +0900 lsfd: add --dump-counters option User may wonder how the built-in counters are defined. Describing their definitions in lsfd(1) is one of choice. However, the definitions may drastically change in the future development. --dump-counters option is for making lsfd self descriptive. Users who understand the filter expressions can understand directly the meaning of the counters. Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 3 +++ misc-utils/lsfd.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) commit dd65121a3d8132ad25528fcb3991449cfb7dfcb6 Author: Masatake YAMATO Date: Fri Nov 19 00:11:13 2021 +0900 lsfd.1.doc: write anout --summary and --counter options Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 61 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) commit 7d8c81d7fe35cd7975670eb5263cc842a29cfb08 Author: Masatake YAMATO Date: Mon Nov 1 04:52:48 2021 +0900 lsfd: implement --summary and --counter options Signed-off-by: Masatake YAMATO misc-utils/Makemodule.am | 2 + misc-utils/lsfd-counter.c | 56 +++++++ misc-utils/lsfd-counter.h | 30 ++++ misc-utils/lsfd.c | 295 ++++++++++++++++++++++++++++++++++++- misc-utils/meson.build | 2 + tests/expected/lsfd/option-summary | 3 + tests/ts/lsfd/lsfd-functions.bash | 9 ++ tests/ts/lsfd/option-summary | 62 ++++++++ 8 files changed, 454 insertions(+), 5 deletions(-) commit 4bacc84a90f3695b748b4918b74dc7cc35647b02 Author: Masatake YAMATO Date: Sat Oct 30 06:53:30 2021 +0900 lsfd: add a helper function for building filter Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) commit adb7db4c6380d2e4bc2ba5c33ae465120417ef96 Author: Masatake YAMATO Date: Sat Nov 13 19:48:16 2021 +0900 lsfd: (filter) make some data structures its source file local Unintentionally they were extern'ed. Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 6f7d3562fec91c7711269295d3b5c1d3457e8f9d Author: Masatake YAMATO Date: Sat Nov 13 19:14:34 2021 +0900 lsfd: don't define a local variable in the middle of a block Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 97b848314830ec114e1152379cfed063a582af8f Author: Masatake YAMATO Date: Thu Nov 18 23:43:11 2021 +0900 lsfd.1.doc: use delimited literal block notation in the EXAMPLE section Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 85 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 34 deletions(-) commit 79327ade841699c5002515756056ab08df31736c Author: Karel Zak Date: Thu Nov 18 15:20:02 2021 +0100 findmnt: filter entries before add to the tree References: 2a83759765aeedf41d6a053150bf6c3873491b8 Signed-off-by: Karel Zak misc-utils/findmnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d05e2f53e7ad42854af476a53ee670ea4b50134e Merge: 2a8375976 319563bf3 Author: Karel Zak Date: Thu Nov 18 14:42:20 2021 +0100 Merge branch 'fix_syscall_usage' of https://github.com/dengraf/util-linux * 'fix_syscall_usage' of https://github.com/dengraf/util-linux: Do not include sys/syscall.h if not available commit 2a83759765aeedf41d6a053150bf6c3873491b80 Author: Karel Zak Date: Thu Nov 18 14:31:38 2021 +0100 findmnt: make sure all entries are in tree output For example /proc/self/mountinfo when mounted in chroot environment does not contain all nodes and parent-child relation is not always possible to create. Signed-off-by: Karel Zak misc-utils/findmnt.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) commit 319563bf31bacc6d97ccc054b07b792c15f60c99 Author: David Engraf Date: Thu Nov 18 14:08:35 2021 +0100 Do not include sys/syscall.h if not available Some platforms do not provide sys/syscall.h. The configure script already checks for the existance of the file. Include sys/syscall.h only in case HAVE_SYS_SYSCALL_H has been set. include/fileutils.h | 4 ++-- include/pidfd-utils.h | 4 ++-- lib/cpuset.c | 2 ++ lib/randutils.c | 2 +- schedutils/ionice.c | 2 ++ schedutils/sched_attr.h | 2 +- sys-utils/hwclock.c | 2 ++ 7 files changed, 12 insertions(+), 6 deletions(-) commit b8f2fce2a20944cd8b1a7e91dfa04f9725ec3eb8 Author: Karel Zak Date: Thu Nov 18 11:47:08 2021 +0100 libmount: (--all) continue although /proc is not mounted Now 'mount --all' ends with error if /proc is not mounted and there is some other entry before /proc in fstab. This commit improves this situation and ignores all mount table related errors if the table is empty. This is important for situation when there is for example "/" as the first line in fstab. Addresses: https://github.com/util-linux/util-linux/issues/1492 Signed-off-by: Karel Zak libmount/src/context.c | 25 +++++++++++++++++-------- libmount/src/context_mount.c | 9 ++++++++- sys-utils/mount.8.adoc | 2 +- 3 files changed, 26 insertions(+), 10 deletions(-) commit 77447ab822aafa5ae242bfc9592b9700a45e1361 Author: Masatake YAMATO Date: Wed Nov 17 04:58:51 2021 +0900 lsfd.1.adoc: remove redundant parenthesis from the examples Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit f8b460b6546805773927aff4f7c61704761bd177 Author: Masatake YAMATO Date: Wed Nov 17 04:53:20 2021 +0900 lsfd.1.adoc: add caution about the CLI stability Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 3 +++ 1 file changed, 3 insertions(+) commit 154f1089f5f52dc1b1395fffc3377c6c1f599ed6 Author: Masatake YAMATO Date: Wed Nov 17 04:56:09 2021 +0900 lsfd.1.adoc: fix a typo Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit aab112dd248a3e6fcbd8b18b35b3f97bd71a7bbf Author: Karel Zak Date: Tue Nov 16 12:58:58 2021 +0100 lsblk: (adoc) improve --all description Signed-off-by: Karel Zak misc-utils/lsblk.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3e0190173a1fd8231579fe3062c24a1d6335b718 Author: Karel Zak Date: Tue Nov 16 10:48:32 2021 +0100 mount: (adoc) add hint about /proc and /sys to --all description Addresses: https://github.com/util-linux/util-linux/issues/1492 Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 2 ++ 1 file changed, 2 insertions(+) commit cb49adb703b2a0b0cb4dcad0b985e186149ce65c Author: Karel Zak Date: Mon Nov 15 14:44:02 2021 +0100 fsck: clear SIGCHLD inherited setting Signed-off-by: Karel Zak disk-utils/fsck.c | 2 ++ 1 file changed, 2 insertions(+) commit e18f896eb1df011bff2c8cede5f14dd2295b9dd5 Author: Karel Zak Date: Mon Nov 15 14:44:02 2021 +0100 more: clear SIGCHLD inherited setting Signed-off-by: Karel Zak text-utils/more.c | 3 +++ 1 file changed, 3 insertions(+) commit ec711d72d15626c15a0a4c2dba907452bcb652d0 Author: Karel Zak Date: Mon Nov 15 14:44:02 2021 +0100 unshare: clear SIGCHLD inherited setting Signed-off-by: Karel Zak sys-utils/unshare.c | 3 +++ 1 file changed, 3 insertions(+) commit 10d7224f7bd85cc71e878fc00bd6e2473dcf6ba9 Author: Karel Zak Date: Mon Nov 15 14:44:02 2021 +0100 nsenter: clear SIGCHLD inherited setting Signed-off-by: Karel Zak sys-utils/nsenter.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 330dcf98682a478bd776f339ac2afafdccbdd790 Author: Tobias Stoeckmann Date: Sun Nov 14 11:54:28 2021 +0100 vipw: improve child error handling Always set SIGCHLD handler to default, even if the caller of vipw has set SIGCHLD to ignore. If SIGCHLD is ignored no zombie processes would be created, which in turn could mean that kill is called with an already recycled pid. Also improved error message if child process fails. Proof of Concept: 1. Compile nochld: -- #include #include int main(void) { char *argv[] = { "vipw", NULL }; signal(SIGCHLD, SIG_IGN); execvp("vipw", argv); return 1; } -- 2. Run nochld 3. Suspend child vi, which suspends vipw too: `kill -STOP childpid` 4. Kill vi: `kill -9 childpid` 5. You can see with ps that childpid is no zombie but disappeared 6. Bring vipw back into foreground `fg` 7. See misleading warning message You will get an improperly formatted warning message. Also the wake up kill call sent SIGCONT to "childpid" which could have been assigned to another process already. This is definitely not a vulnerability. It would take super user operations, at which point an attacker would have already elevated permissions. Signed-off-by: Tobias Stoeckmann login-utils/vipw.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit fdeb5db701271e7f32f03f095f5783c1b84f9553 Merge: d4686cd18 2f628e8f9 Author: Karel Zak Date: Fri Nov 12 15:18:22 2021 +0100 Merge branch 'nsenter-all-avoid-entering-nonexisting-ns' of https://github.com/Jongy/util-linux * 'nsenter-all-avoid-entering-nonexisting-ns' of https://github.com/Jongy/util-linux: nsenter: Do not try to enter nonexisting namespaces when --all is used commit 2f628e8f9ff7b72c4041a79bf3ff28f214cafb6f Author: Yonatan Goldschmidt Date: Fri Nov 12 15:27:51 2021 +0200 nsenter: Do not try to enter nonexisting namespaces when --all is used This PR changes is_same_namespace() to is_usable_namespace(). If a namespace file is missing for the running PID, then it is considered not usable and we do not try to enter it. Signed-off-by: Yonatan Goldschmidt sys-utils/nsenter.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) commit d4686cd1867cae16bb9b994bfe37feeeb7c934bc Author: Karel Zak Date: Fri Nov 12 12:14:39 2021 +0100 tests: (hardlink) add info about number of files to test Signed-off-by: Karel Zak tests/expected/hardlink/options-maximum-size-8191 | 1 + tests/expected/hardlink/options-maximum-size-8192 | 1 + tests/ts/hardlink/options | 3 +++ 3 files changed, 5 insertions(+) commit af5f0078fd621688ccf1e0eb9b52b452f9fa419b Author: Karel Zak Date: Fri Nov 12 11:50:41 2021 +0100 hardlink: add verbose messages when skip file Signed-off-by: Karel Zak misc-utils/hardlink.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit 0037eb44d85fef95f852866eb9778b6786ebaadf Author: Karel Zak Date: Thu Nov 11 11:35:08 2021 +0100 irqtop: fix options parsing Reported-by: Peter Seiderer Signed-off-by: Karel Zak sys-utils/irqtop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d1732bba383a95786b5ec7bc1f4a173b644fe871 Author: Karel Zak Date: Wed Nov 10 10:56:02 2021 +0100 bash-completion: fix irqtop Forgot update the option as introduced by commit 17f7caa45105f0cbf8bf9b562468fba2c5d4a549. Signed-off-by: Karel Zak bash-completion/irqtop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 232e85af3fe1f2809d5d12afdbe75c760bad5481 Author: Karel Zak Date: Wed Nov 10 10:50:08 2021 +0100 irqtop: small coding style change Signed-off-by: Karel Zak sys-utils/irqtop.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit 17f7caa45105f0cbf8bf9b562468fba2c5d4a549 Author: zhenwei pi Date: Wed Nov 10 11:16:42 2021 +0800 irqtop: add -c/--cpu-stat option Since a23aecc1bf("irqtop: add per-cpu stats"), irqtop always shows per-cpu stats. Test on a modern AMD server with 2 socket(256 CPU), irqtop shows messy output with too many columns. In this patch, add -c/--cpu-stat option to enable/disable per-cpu stats. And 'auto' option auto-detect window size, only show per-cpu stats if the length of per-cpu stats is shorter than the width of window. [kzak@redhat.com: - shorten the commit message - rename --cpu to --cpu-stat - use scols_table_enable_nowrap() rather than trim in irqtop.c - reduce --help for the new option] Signed-off-by: zhenwei pi Signed-off-by: Karel Zak bash-completion/irqtop | 7 ++++++- sys-utils/irqtop.1.adoc | 3 +++ sys-utils/irqtop.c | 41 +++++++++++++++++++++++++++++++++-------- 3 files changed, 42 insertions(+), 9 deletions(-) commit b1c137a948e0c935bc3fae0303d48a34a3c91e1e Author: Karel Zak Date: Wed Nov 10 09:31:53 2021 +0100 bash-completion: add --json to dmesg Signed-off-by: Karel Zak bash-completion/dmesg | 1 + 1 file changed, 1 insertion(+) commit 1f17eefb2baf2d2953ae63777b917c29fd9404e9 Author: Karel Zak Date: Tue Nov 9 11:08:24 2021 +0100 mkswap: add --quiet * add --quiet to suppress output and warning messages * check for mutually exclusive arguments --check vs. --quiet Fixes: https://github.com/util-linux/util-linux/issues/1499 Signed-off-by: Karel Zak disk-utils/mkswap.8.adoc | 3 +++ disk-utils/mkswap.c | 58 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 17 deletions(-) commit 5f8ba8fb11dbbce34a7155271cad22d6054d80f3 Merge: 0e2b04dd4 9b59641bc Author: Karel Zak Date: Tue Nov 9 10:14:52 2021 +0100 Merge branch 'sysfs_partitions' of https://github.com/Portisch/util-linux * 'sysfs_partitions' of https://github.com/Portisch/util-linux: sysfs: fallback for partitions not including parent name commit 9b59641bcec3df9c451eea4c7057751a153a3fcb Author: Portisch Date: Mon Nov 8 12:31:39 2021 +0100 sysfs: fallback for partitions not including parent name lib/sysfs.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 0e2b04dd48d473a491ad8e4b685de921286a68e6 Merge: 506b54513 1524cb278 Author: Karel Zak Date: Mon Nov 8 16:14:12 2021 +0100 Merge branch 'travis' of https://github.com/evverx/util-linux * 'travis' of https://github.com/evverx/util-linux: ci: no longer refer to Travis CI commit 506b54513bfb7723cec77301cd16d7290c4a882c Author: Karel Zak Date: Mon Nov 8 16:03:03 2021 +0100 dmesg: add --json output format Fixes: https://github.com/util-linux/util-linux/issues/1495 Signed-off-by: Karel Zak sys-utils/dmesg.1.adoc | 3 ++ sys-utils/dmesg.c | 90 +++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 73 insertions(+), 20 deletions(-) commit 195993d504de1697923451289bf86feed009b29e Author: Karel Zak Date: Mon Nov 8 15:43:30 2021 +0100 lib/jsonwrt: check if JSON handler is initialized Signed-off-by: Karel Zak include/jsonwrt.h | 1 + lib/jsonwrt.c | 5 +++++ 2 files changed, 6 insertions(+) commit c5073a6966446309970bff3d60683d924a6431a3 Merge: b383155ac c881bec5f Author: Karel Zak Date: Mon Nov 8 14:25:12 2021 +0100 Merge branch 'ci-coverity' of https://github.com/evverx/util-linux * 'ci-coverity' of https://github.com/evverx/util-linux: ci: add a GHAction sending data to Coverity commit b383155ac6a94f14f5c661d2e4a62c1eef5b6e27 Author: Karel Zak Date: Mon Nov 8 14:01:55 2021 +0100 sfdisk: fix typo in --move-data when check partition size Signed-off-by: Karel Zak disk-utils/sfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 534679d0f4fcb2a194a1e3e0342230fecd5d9d99 Author: Karel Zak Date: Mon Nov 8 13:53:02 2021 +0100 sfdisk: update docs, add examples to the man page Signed-off-by: Karel Zak disk-utils/sfdisk.8.adoc | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) commit f7dbb76b63b7d3f2c96943f14cd7f2d36c91ecad Author: Karel Zak Date: Mon Nov 8 13:43:44 2021 +0100 libfdisk: (script) rewrite start= and size= parsing * let's use the same code for both supported formats * add support for '+,' to enlarge by start move (see previous commit) Signed-off-by: Karel Zak libfdisk/src/script.c | 290 ++++++++++++++++++++++++++++---------------------- 1 file changed, 165 insertions(+), 125 deletions(-) commit 226c844dec2dbda235e74f834d59ba1d25122ce0 Author: Karel Zak Date: Mon Nov 8 13:38:45 2021 +0100 libfdisk: enlarge partition by move start down Now it's possible move start of the partition only when offset or absolute value is specified. This commit implements resize to "use all available free space before the current start". We already support the same for end of the partition (resize to use all free space after the partition). Signed-off-by: Karel Zak libfdisk/src/partition.c | 79 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 4 deletions(-) commit 317e2de52d8fcfa79fd99010828d08220eba00f4 Author: Karel Zak Date: Mon Nov 8 13:09:06 2021 +0100 docs: update IRC address Signed-off-by: Karel Zak README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1524cb27855c241a6d066400e57e68832a669913 Author: Evgeny Vereshchagin Date: Mon Nov 8 04:16:56 2021 +0000 ci: no longer refer to Travis CI and also add a link to Coveralls coverage reports to Documentation/howto-test to make it a little easier to find them. Signed-off-by: Evgeny Vereshchagin .travis-functions.sh | 368 ------------------------------------------ .travis.yml | 75 --------- Documentation/howto-tests.txt | 9 +- 3 files changed, 2 insertions(+), 450 deletions(-) commit 45020b672666a9372d783ddde7ed0c5d08f42161 Author: Karel Zak Date: Wed Nov 3 15:09:13 2021 +0100 build-sys: disable IPC tools on Darwin Fixes: https://github.com/util-linux/util-linux/issues/1432 Signed-off-by: Karel Zak configure.ac | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) commit c881bec5fe10eff9cf06e2db4dc479d798f9eae6 Author: Evgeny Vereshchagin Date: Wed Nov 3 06:22:17 2021 +0000 ci: add a GHAction sending data to Coverity To get it to work a secret named COVERITY_SCAN_TOKEN should be added to the util-linux repository: https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository It has to match the util-linux project token, which can be found at https://scan.coverity.com/projects/karelzak-util-linux?tab=project_settings Signed-off-by: Evgeny Vereshchagin .github/workflows/cibuild-setup-ubuntu.sh | 7 +++- .github/workflows/cibuild.sh | 65 ++++++++++++++++++++++++++++++- .github/workflows/coverity.yml | 24 ++++++++++++ Documentation/howto-tests.txt | 2 +- 4 files changed, 94 insertions(+), 4 deletions(-) commit b027550704f20f74c3196964472651b5efbc896d Author: Evgeny Vereshchagin Date: Tue Nov 2 15:18:19 2021 +0000 ci: build coverage reports on Coveralls Signed-off-by: Evgeny Vereshchagin .github/workflows/cibuild-setup-ubuntu.sh | 1 + .github/workflows/cibuild.sh | 16 +++++++++++++++- .github/workflows/cibuild.yml | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) commit cd252c664cc5493fb1bbd5a91517d8c7c22b3d0a Author: Karel Zak Date: Wed Nov 3 13:58:21 2021 +0100 docs: update github URL Signed-off-by: Karel Zak .travis-functions.sh | 4 ++-- Documentation/TODO | 24 ++++++++++++------------ Documentation/howto-contribute.txt | 2 +- Documentation/howto-tests.txt | 8 ++++---- README | 6 +++--- man-common/bugreports.adoc | 2 +- po-man/util-linux-man.pot | 2 +- sys-utils/blkzone.c | 2 +- tests/functions.sh | 2 +- tests/ts/hwclock/systohc | 2 +- tests/ts/script/race | 2 +- util-linux.doap | 2 +- 12 files changed, 29 insertions(+), 29 deletions(-) commit 91aadd943ffc0c6eba9d85b19cb4927510a17adc Author: Evgeny Vereshchagin Date: Tue Nov 2 16:02:16 2021 +0000 cifuzz: switch to the util-linux organization Signed-off-by: Evgeny Vereshchagin .github/workflows/cifuzz.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 23e51a5f6054041844d4b6c5c54e0e81db97c53d Author: Karel Zak Date: Tue Nov 2 15:52:37 2021 +0100 build-sys: fir distcheck for fileeq.h Signed-off-by: Karel Zak include/Makemodule.am | 1 + 1 file changed, 1 insertion(+) commit 93fbe820475258792d214622682f40178cecfd7f Author: Karel Zak Date: Tue Nov 2 15:48:38 2021 +0100 build-sys: (meson) fix hardlink Signed-off-by: Karel Zak lib/meson.build | 1 + misc-utils/meson.build | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) commit 31e1fab2af79bc9000b42cff4161d674e503c2a3 Author: Mario Blättermann Date: Tue Nov 2 14:00:24 2021 +0100 lsfd.1.adoc: Add missing underscores misc-utils/lsfd.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 441f9b9303d015f1777aec7168807d58feacca31 Author: Karel Zak Date: Tue Nov 2 12:19:28 2021 +0100 login: improve coding style Signed-off-by: Karel Zak login-utils/login.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 7e58b71dfa9bf27f574fd79424f56206f44fa806 Author: Daan De Meyer Date: Sat Oct 30 15:56:14 2021 +0100 login: Restore tty size after calling vhangup() If login receives the tty to work on via stdin, stdout and stderr, login might end up closing the remaining open file descriptors to the tty just before it calls vhangup(). When the last open file descriptors to a tty are closed, it's configured size is reset to 0x0. To avoid this from happening, save the size before closing the stdin, stdout and stderr file descriptors and reapply the size after the tty is re-opened. Fixes #1484 login-utils/login.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 45c1eb21626ee6b0f68197b46306bb9099e75378 Author: Karel Zak Date: Tue Nov 2 09:15:13 2021 +0100 lsfd: remove unused --sysroot It's unnecessary to redirect to any /proc dump if we can use 'test_mkfds'. Signed-off-by: Karel Zak misc-utils/lsfd.1.adoc | 3 --- misc-utils/lsfd.c | 9 +-------- 2 files changed, 1 insertion(+), 11 deletions(-) commit a6a8fd0decb6a0849188e8451f85387fe1d3af61 Author: Masatake YAMATO Date: Fri Oct 22 17:10:02 2021 +0900 lsfd: delete an unnecessary semicolon Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c647ebc2b68f152d202dd8abedbe5161245aa795 Author: Masatake YAMATO Date: Fri Oct 22 12:48:47 2021 +0900 lsfd: introduce -p/--pid option, pids filter working in the early stage $ time sudo ./lsfd -Q '(PID == 1) or (PID == 2)' > /dev/null real 0m0.508s user 0m0.230s sys 0m0.267s $ time sudo ./lsfd -p 1,2 > /dev/null real 0m0.088s user 0m0.036s sys 0m0.033s $ [ $(./lsfd -p 1,2) = $(./lsfd -Q '(PID == 1) or (PID == 2)') ] $ echo $? 0 Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 168b2ad8ec41e5bf856f39b765960466d23cf2da Merge: 3320cd80d 58c3bc12a Author: Karel Zak Date: Mon Nov 1 14:18:21 2021 +0100 Merge branch 'mount_fuzz' of https://github.com/evverx/util-linux * 'mount_fuzz' of https://github.com/evverx/util-linux: mount_fuzz: reject giant files early commit 3320cd80dce7b42d1e5586189d282f151c35d482 Merge: 0a08200bd 25a125ee8 Author: Karel Zak Date: Mon Nov 1 12:50:33 2021 +0100 Merge branch 'topic/hardlink' commit 25a125ee89d0da9e4b815b1ca27b001c7d07ce8a Author: Karel Zak Date: Mon Nov 1 12:49:16 2021 +0100 tests: update hardlink --maximum-size Signed-off-by: Karel Zak tests/expected/hardlink/options-maximum-size-8191 | 79 ++++++++--------------- tests/expected/hardlink/options-maximum-size-8192 | 59 ++++++++--------- tests/ts/hardlink/options | 14 ++-- 3 files changed, 63 insertions(+), 89 deletions(-) commit 40a824567f01873d31df16a28997ddc0fc45a328 Author: Daniele Pizzolli Date: Mon Oct 11 09:30:45 2021 +0200 hardlink: add new option: -S/--maximum-size Support limiting comparison by maximum file size. [kzak@redhat.com: - resolve conflicts] Signed-off-by: Daniele Pizzolli Signed-off-by: Karel Zak misc-utils/hardlink.1.adoc | 3 ++ misc-utils/hardlink.c | 17 ++++++- tests/expected/hardlink/options-maximum-size-8191 | 59 +++++++++++++++++++++++ tests/expected/hardlink/options-maximum-size-8192 | 33 +++++++++++++ tests/ts/hardlink/options | 17 +++++++ 5 files changed, 127 insertions(+), 2 deletions(-) commit f3212b9165ada01d7fc761c5bb29ecb0449eb0c1 Author: Karel Zak Date: Mon Nov 1 12:00:21 2021 +0100 hardlink: add --cache-size Signed-off-by: Karel Zak misc-utils/hardlink.1.adoc | 28 ++++++++++++++++++++++------ misc-utils/hardlink.c | 15 ++++++++++++--- 2 files changed, 34 insertions(+), 9 deletions(-) commit b547b4a7752c4dd8bcf31d747d91a3c35161f9c4 Author: Karel Zak Date: Mon Nov 1 11:14:24 2021 +0100 lib/fileeq: fix for small memsiz lib/fileeq.c | 2 ++ 1 file changed, 2 insertions(+) commit 64c8db3cdead7d0e9a28168c80a3c53e13459221 Author: Karel Zak Date: Mon Nov 1 10:46:32 2021 +0100 hardlink: rename --buffer-size to --io-size Addresses: https://github.com/karelzak/util-linux/pull/1467 Signed-off-by: Karel Zak misc-utils/hardlink.1.adoc | 13 +++++++------ misc-utils/hardlink.c | 31 +++++++++++++++++-------------- 2 files changed, 24 insertions(+), 20 deletions(-) commit 58c3bc12a54c9d78fe0999036a3cca70bdda1d6e Author: Evgeny Vereshchagin Date: Sat Oct 30 18:09:30 2021 +0000 mount_fuzz: reject giant files early It should help to address https://github.com/google/oss-fuzz/issues/6703 Signed-off-by: Evgeny Vereshchagin libmount/src/fuzz.c | 4 ++++ 1 file changed, 4 insertions(+) commit 259bed153a9e97d3eec0f7d90ed0cef6fa407332 Author: Karel Zak Date: Fri Oct 29 13:42:58 2021 +0200 hardlink: rewrite files content comparison Example: # hardlink --ignore-time --dry-run /var/lib Old version, based on memcmp(), nothing cached: Mode: dry-run Files: 93453 Linked: 36172 files Compared: 0 xattrs Compared: 25755615 files Saved: 80.11 MiB Duration: 204.557185 seconds New version, --method=memcmp, 32 bytes cached: Mode: dry-run Method: memcmp Files: 93453 Linked: 36172 files Compared: 0 xattrs Compared: 25755615 files Saved: 80.11 MiB Duration: 5.248426 seconds New version, zero-copy (Linux crypto API), sha1, crc32 and sha256: Mode: dry-run Method: sha1 Files: 93453 Linked: 36172 files Compared: 0 xattrs Compared: 25755615 files Saved: 80.11 MiB Duration: 2.870973 seconds Mode: dry-run Method: crc32 Files: 93453 Linked: 36172 files Compared: 0 xattrs Compared: 25755615 files Saved: 80.11 MiB Duration: 2.582651 seconds Mode: dry-run Method: sha256 Files: 93453 Linked: 36172 files Compared: 0 xattrs Compared: 25755615 files Saved: 80.11 MiB Duration: 3.152825 seconds The default is sha256 to be robust.. Signed-off-by: Karel Zak configure.ac | 1 + misc-utils/Makemodule.am | 2 +- misc-utils/hardlink.1.adoc | 8 ++ misc-utils/hardlink.c | 181 ++++++++++++++++++++------------------------- 4 files changed, 92 insertions(+), 100 deletions(-) commit ee2d371c615f5f8617fb67fad8c61f062c41da89 Author: Karel Zak Date: Fri Oct 29 13:37:36 2021 +0200 include/fileeq: add functions to compare files content Signed-off-by: Karel Zak include/all-io.h | 1 - include/fileeq.h | 53 +++++ lib/Makemodule.am | 4 + lib/fileeq.c | 638 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 695 insertions(+), 1 deletion(-) commit 4cfabab2a2cb8b1526cdfc247cd42d7acc5c41b6 Author: Masatake YAMATO Date: Fri Oct 22 12:48:47 2021 +0900 lsfd: introduce -p/--pid option, pids filter working in the early stage $ time sudo ./lsfd -Q '(PID == 1) or (PID == 2)' > /dev/null real 0m0.508s user 0m0.230s sys 0m0.267s $ time sudo ./lsfd -p 1,2 > /dev/null real 0m0.088s user 0m0.036s sys 0m0.033s $ [ $(./lsfd -p 1,2) = $(./lsfd -Q '(PID == 1) or (PID == 2)') ] $ echo $? 0 Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 23 ++++++++++++ misc-utils/lsfd.c | 71 +++++++++++++++++++++++++++++++++--- tests/expected/lsfd/option-pid | 13 +++++++ tests/ts/lsfd/option-pid | 81 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 184 insertions(+), 4 deletions(-) commit 0a08200bd5664d1849e477f7f776ab4d13bb8422 Author: Lorenzo Beretta Date: Mon Oct 25 15:28:02 2021 +0200 chsh: fflush stdout before reading from stdin Same problem as described in https://github.com/karelzak/util-linux/pull/1481 Signed-off-by: Lorenzo Beretta login-utils/chsh.c | 1 + 1 file changed, 1 insertion(+) commit 05907d0d9e7c85f33e168feab1eb36b464425054 Author: Lorenzo Beretta Date: Mon Oct 25 14:06:00 2021 +0200 chfn: flush stdout before reading stdin and fix uninitialized variable Same problem as described in https://github.com/karelzak/util-linux/pull/1481 Signed-off-by: Lorenzo Beretta login-utils/chfn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e40bce636305bb06a02810784701afd4f52b3dc0 Merge: 94c8821bc b75bc0e78 Author: Karel Zak Date: Mon Oct 25 12:21:15 2021 +0200 Merge branch 'refactor-tests' of https://github.com/Ajchler/util-linux * 'refactor-tests' of https://github.com/Ajchler/util-linux: tests: split additional tests into subtests tests: split several tests into subtests tests: split test into subtest tests: split cal/colorw test into subtests tests: split cal/color test into subtests commit 94c8821bc8a5c37d5c17f80e76265f0eebd69664 Author: Karel Zak Date: Mon Oct 25 11:53:55 2021 +0200 build-sys: disable libmount when missing mntent.h Addresses: https://github.com/karelzak/util-linux/issues/1432 Signed-off-by: Karel Zak configure.ac | 2 ++ 1 file changed, 2 insertions(+) commit dc6a38ed286c6f311fa5c3af93b3033ce9e14b96 Author: Karel Zak Date: Mon Oct 25 11:45:46 2021 +0200 build-sys: include xlocale.h for locale_t on MacOS Addresses: https://github.com/karelzak/util-linux/issues/1432 Signed-off-by: Karel Zak lib/c_strtod.c | 4 ++++ 1 file changed, 4 insertions(+) commit 3854515ca11ffc68c6bbdd4e5673c7f7521f3043 Author: Karel Zak Date: Mon Oct 25 11:39:09 2021 +0200 build-sys: (hardlink) check for llistxattr and lgetxattr It seems check for sys/xattr.h is not enough. The header file exists on MacOS, but without these functions. Addresses: https://github.com/karelzak/util-linux/issues/1432 Signed-off-by: Karel Zak configure.ac | 2 ++ misc-utils/hardlink.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) commit 10f5f79485964ab52272ebe79c3b0047b1f84d82 Author: Karel Zak Date: Mon Oct 25 11:26:15 2021 +0200 libbuid: use _UL_LIBUUID_UUID_H to cover uuid.h It seems _UUID_UUID_H is too generic. Addresses: https://github.com/karelzak/util-linux/issues/1432 Signed-off-by: Karel Zak libuuid/src/uuid.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit a4bb8b3543c442ea1650899e58903b96a4751026 Author: Karel Zak Date: Mon Oct 25 11:15:01 2021 +0200 docs: add hint for non-public reports Fixes: https://github.com/karelzak/util-linux/issues/1482 Signed-off-by: Karel Zak README | 2 ++ 1 file changed, 2 insertions(+) commit 72f8a8d42f8ee29f76428ddc804df7c08fefe024 Merge: 1cf6e936e 34a9b6558 Author: Karel Zak Date: Mon Oct 25 10:42:22 2021 +0200 Merge branch 'flush' of https://github.com/ericonr/util-linux * 'flush' of https://github.com/ericonr/util-linux: vipw: flush stdout before getting answer. commit 1cf6e936e308166fffdc2d703c4ade2e8cbe5e51 Author: Ludwig Nussel Date: Thu Oct 21 15:00:59 2021 +0200 agetty: use getttynam() if available /etc/ttys seems to be a rather archaic concept that is not meant to exist on Linux. Nevertheless it does. glibc has getttynam() which correctly parses /etc/ttys. So let's give it a try before falling back to the built in defaults. One can set the terminal type for a specific tty using e.g.: echo 'ttyS0 "" xterm' > /etc/ttys [kzak@redhat.com: - improve configure.ac part - log error on failed strdup()] Signed-off-by: Karel Zak configure.ac | 1 + term-utils/agetty.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) commit 421a482ac2b7fbd916a3655ae3da2af4a018a91c Merge: 58e4ee082 c83a52f03 Author: Karel Zak Date: Mon Oct 25 10:23:16 2021 +0200 Merge branch 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux * 'uniformize-title-markups' of https://github.com/rffontenelle/util-linux: docs: Uniformize references to section titles commit 34a9b65587a7d704db0344e859511af4a6756c89 Author: Érico Nogueira Date: Fri Oct 22 14:28:50 2021 -0300 vipw: flush stdout before getting answer. Otherwise the question is displayed only after the user presses Return, and the program looks like it's hanging. This happens at least on musl libc. Reported by @loreb. Signed-off-by: Érico Nogueira login-utils/vipw.c | 1 + 1 file changed, 1 insertion(+) commit 58e4ee082bca100034791a4a74481f263bb30a25 Author: Karel Zak Date: Thu Oct 21 18:47:40 2021 +0200 logger: fix --size use for stdin The stdin version counts log header into the message size, but for example when it reads message from argv[] it counts only message itself. $ logger --stderr --size 3 "abcd" <13>Oct 21 18:48:29 kzak: abc $ echo "abcd" | logger --stderr --size 3 logger: cannot allocate 18446744073709551597 bytes: Cannot allocate memory Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602 Signed-off-by: Karel Zak misc-utils/logger.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) commit 2a82207f064734c6fab7cd322c05a94738963cbb Author: Karel Zak Date: Thu Oct 21 18:44:32 2021 +0200 Revert "logger: verify --size of large enough for message header" This reverts commit 2fdea5a26480d46ec9445b0ea17fc984f84eecc9. misc-utils/logger.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) commit 34389ad03b3ad362ce67ff60a3cc13b315af084c Author: Karel Zak Date: Thu Oct 21 18:27:46 2021 +0200 build-sys: use set +e before patch --try in ./autogen.sh Addresses: https://github.com/karelzak/util-linux/issues/1476 Signed-off-by: Karel Zak autogen.sh | 2 ++ 1 file changed, 2 insertions(+) commit b0a8b8cd9c34600dda7d0503aac2dc0af3012fdc Author: Karel Zak Date: Thu Oct 21 16:00:01 2021 +0200 logger: realloc buffer when header size changed This is probably paranoid optimization, but when we generate a new header we need to be sure that buffer is not smaller than calculated maximal size of user's data. Signed-off-by: Karel Zak misc-utils/logger.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit 2fdea5a26480d46ec9445b0ea17fc984f84eecc9 Author: Karel Zak Date: Thu Oct 21 15:40:41 2021 +0200 logger: verify --size of large enough for message header Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602 Signed-off-by: Karel Zak misc-utils/logger.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) commit aa0153a3d7f059a3bfceeaa50c1a4a707e42f953 Author: Karel Zak Date: Thu Oct 21 15:04:33 2021 +0200 wdctl: update man page Addresses: https://github.com/karelzak/util-linux/issues/1475 Signed-off-by: Karel Zak sys-utils/wdctl.8.adoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit d112a40cb47e69e451dd9fefc1fe7c9747076546 Author: Masatake YAMATO Date: Wed Oct 20 23:22:28 2021 +0900 lsfd: (adoc) add more exapmles Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) commit ddd511624a130184f6d3fbcf7a79dfc1db329051 Author: Masatake YAMATO Date: Wed Oct 20 22:29:45 2021 +0900 lsfd: remove --source option -Q '(SOURCE == ...)' works well for the same purpose. See https://github.com/karelzak/util-linux/pull/1418#issuecomment-945643880 Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) commit f26ddd080d44e7e261fcbb7d78dc770f8c85983f Author: Masatake YAMATO Date: Tue Oct 19 17:05:08 2021 +0900 lsfd: add KTHREAD column Signed-off-by: Masatake YAMATO include/procfs.h | 1 + lib/procfs.c | 22 ++++++++++++-------- misc-utils/lsfd-file.c | 3 +++ misc-utils/lsfd.1.adoc | 3 +++ misc-utils/lsfd.c | 36 ++++++++++++++++++++++++++++++++ misc-utils/lsfd.h | 2 ++ tests/expected/lsfd/column-kthread | 6 ++++++ tests/ts/lsfd/column-kthread | 42 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 106 insertions(+), 9 deletions(-) commit 21c70c294a8d665d28f2ff552694982a74040004 Author: Masatake YAMATO Date: Sat Oct 16 05:38:49 2021 +0900 lsfd: (test) add a case for displaying symlinks Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-symlink | 2 ++ tests/helpers/test_mkfds.c | 33 ++++++++++++++++++++++++++++ tests/ts/lsfd/mkfds-symlink | 45 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) commit 863a6544c32323157b900e81bf6b4a6da9e712dc Author: Masatake YAMATO Date: Sat Oct 16 04:24:28 2021 +0900 lsfd: (test) add a case for displaying COMMAND column Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-ro-regular-file | 4 ++-- tests/helpers/test_mkfds.c | 14 +++++++++++++- tests/ts/lsfd/mkfds-ro-regular-file | 6 +++--- 3 files changed, 18 insertions(+), 6 deletions(-) commit d827da235fefbd353e3b981537c657aeb8be19f8 Author: Masatake YAMATO Date: Sat Oct 16 03:48:43 2021 +0900 lsfd: (test) add a case for displaying socket pairs Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-socketpair | 3 ++ tests/helpers/test_mkfds.c | 57 ++++++++++++++++++++++++++++++++++++ tests/ts/lsfd/mkfds-socketpair | 46 +++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) commit dc01f8d29cbd5b528a7ceee83c7f53847f4ab8ca Author: Masatake YAMATO Date: Sat Oct 16 02:47:03 2021 +0900 lsfd: (test) add a case for displaying DEV column Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-ro-regular-file | 4 +++ tests/expected/lsfd/mkfds-rw-character-device | 4 +++ tests/ts/lsfd/lsfd-functions.bash | 39 +++++++++++++++++++++++++++ tests/ts/lsfd/mkfds-ro-regular-file | 5 ++++ tests/ts/lsfd/mkfds-rw-character-device | 6 +++++ 5 files changed, 58 insertions(+) commit adf7af0e709a0e9f4bda6f9af255baa64b153f14 Author: Masatake YAMATO Date: Sat Oct 16 02:34:38 2021 +0900 lsfd: (helper) improve the code converting file descriptor numbers Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 7c06963e32f8d7bde0057a348fef9ff5e73d0159 Author: Masatake YAMATO Date: Sat Oct 16 01:42:57 2021 +0900 lsfd: (test) add a case for displaying a character device Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-rw-character-device | 2 ++ tests/helpers/test_mkfds.c | 33 +++++++++++++++++++ tests/ts/lsfd/mkfds-rw-character-device | 46 +++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) commit cae0cf10ca0865c43287b8fc7c58fade518d286a Author: Masatake YAMATO Date: Fri Oct 15 11:24:23 2021 +0900 lsfd: add --debug-filter option Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 4 ++++ misc-utils/lsfd.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) commit f7af3d7ca32b5b8cc6af3ae327557d20718d1e9c Author: Masatake YAMATO Date: Fri Oct 15 11:04:27 2021 +0900 lsfd: (test) add a case for testing SIZE column Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-ro-regular-file | 2 ++ tests/ts/lsfd/mkfds-ro-regular-file | 6 ++++++ 2 files changed, 8 insertions(+) commit b7191edae63f716173141e5434f6a16bb137f639 Author: Masatake YAMATO Date: Fri Oct 15 10:59:05 2021 +0900 lsfd: (test) add a case for testing FLAGS (wronly,nonblock) column Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-pipe-no-fork | 6 +++--- tests/ts/lsfd/mkfds-pipe-no-fork | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) commit d85c66d89f7073ab345c83ca8bd258ffff813329 Author: Masatake YAMATO Date: Fri Oct 15 10:58:03 2021 +0900 lsfd: (helper) add "nonblock" parameter to pipe-no-fork factory Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 49 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) commit 0dfd6614b56046a5c16da0efd7c111597ef9665a Author: Masatake YAMATO Date: Fri Oct 15 10:28:09 2021 +0900 lsfd: (helper) update examples in the help message Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5c26570564823affce974bd1ebb51ca22beb38c8 Author: Masatake YAMATO Date: Fri Oct 15 00:17:43 2021 +0900 lsfd: (helper) add "dentries" parameter to directory factory Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) commit 8c670091dead898465ab4124f15bf73b6a06e46f Author: Masatake YAMATO Date: Fri Oct 15 00:01:49 2021 +0900 lsfd: (helper) add "dir" parameter to directory factory Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) commit fd207562340e3d323a67145239c8aba240a0e95f Author: Masatake YAMATO Date: Thu Oct 14 22:55:28 2021 +0900 lsfd: (test) test POS column Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-ro-regular-file | 4 ++-- tests/ts/lsfd/mkfds-ro-regular-file | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) commit 6d201bcb508b276bd1725609366e692d42d1aac3 Author: Masatake YAMATO Date: Thu Oct 14 22:51:49 2021 +0900 lsfd: (helper) add "offset" parameter to ro-regular-file factory Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit cb9c4cabedc5b01b656629bff91b66d0c293545b Author: Masatake YAMATO Date: Thu Oct 14 22:51:18 2021 +0900 lsfd: (helper) accept an integer argument for a parameter Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) commit ae9ff1cd2bbb8e8a6c859a14edb5bd31aeb751a6 Author: Masatake YAMATO Date: Thu Oct 14 18:49:34 2021 +0900 lsfd: (helper) add "file" parameter to ro-regular-file factory Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 66 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 6 deletions(-) commit 13b7739aef25a41173e6fd093ed7dba2149f9f3f Author: Masatake YAMATO Date: Thu Oct 14 18:47:39 2021 +0900 lsfd: (helper) allow to pass extra parameters Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 120 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 111 insertions(+), 9 deletions(-) commit 9557ed4461c82a3b3ceacfbdeabd2297af6f4688 Author: Masatake YAMATO Date: Thu Oct 14 18:34:48 2021 +0900 lsfd: (helper) use more "const" modifiers Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 031ff45c7ceb84d762a3df9ed3ff7b973b73dc39 Author: Masatake YAMATO Date: Thu Oct 14 22:46:30 2021 +0900 lsfd: (helper) set proper errno before calling err() Signed-off-by: Masatake YAMATO tests/helpers/test_mkfds.c | 7 +++++++ 1 file changed, 7 insertions(+) commit e095a2d6fb70e4712d0810a3e5399944f1e9d1ee Author: Masatake YAMATO Date: Sat Oct 16 06:08:38 2021 +0900 lsfd: (filter) accept % char as a part of column name Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cdc778cf2cc0d1e8ea193857de3fdac930ec8ea7 Author: Masatake YAMATO Date: Thu Oct 21 20:54:38 2021 +0900 lsfd: (filter) fix a memory leak Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 1 + 1 file changed, 1 insertion(+) commit 342bbb19925b6bc24fc813864662d3e10fcf2771 Author: Masatake YAMATO Date: Sun Oct 17 20:01:09 2021 +0900 lsfd: remove prototype decls for removed functions Signed-off-by: Masatake YAMATO misc-utils/lsfd.h | 6 ------ 1 file changed, 6 deletions(-) commit 024ca9ba7088122fec62a231c6b3134c1dc85e5c Author: Masatake YAMATO Date: Thu Oct 21 21:01:28 2021 +0900 lsfd: declare local variables at the beginning of block Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 34 +++++++++++++++++++++++++--------- misc-utils/lsfd.c | 12 +++++++++--- 2 files changed, 34 insertions(+), 12 deletions(-) commit c0762da1aebce45e1d4c56b977014bfb8818c2ea Author: Karel Zak Date: Thu Oct 21 13:09:58 2021 +0200 wdctl: add --setpregovernor Addresses: https://github.com/karelzak/util-linux/issues/1475 Signed-off-by: Karel Zak sys-utils/wdctl.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) commit 7d64a2b5d5eeaacd4d7e9b2d201374cc6890c6fb Author: Karel Zak Date: Thu Oct 21 12:38:16 2021 +0200 wdctl: set_watchdog() refactoring * keep wanted values in struct wd_control * make set_watchdog() more readable Signed-off-by: Karel Zak sys-utils/wdctl.c | 126 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 66 insertions(+), 60 deletions(-) commit 86ffb5a7dee6057ca5afef330de1c834d75ea068 Author: Karel Zak Date: Thu Oct 21 12:16:35 2021 +0200 wdctl: print the current and available governors # wdctl ... Pre-timeout: 0 seconds Pre-timeout governor: noop Available pre-timeout governors: userspace noop panic ... Addresses: https://github.com/karelzak/util-linux/issues/1475 Signed-off-by: Karel Zak sys-utils/wdctl.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) commit 71811eea53cbc41cc12555e3754c4b12216bcf21 Author: Karel Zak Date: Thu Oct 21 11:36:44 2021 +0200 docs: add links to adjtime_config manpage Fixes: https://github.com/karelzak/util-linux/issues/1478 Signed-off-by: Karel Zak sys-utils/hwclock.8.adoc | 3 ++- sys-utils/rtcwake.8.adoc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) commit b75bc0e78f1d2a9e76b900de8ca17f176483cafb Author: Vojtěch Eichler Date: Tue Oct 19 20:45:28 2021 +0200 tests: split additional tests into subtests tests/expected/misc/line | 25 ----- tests/expected/misc/line-empty-input | 2 + tests/expected/misc/line-empty-input-wait-for-eof | 2 + tests/expected/misc/line-large-line | 5 + tests/expected/misc/line-one-call | 2 + tests/expected/misc/line-text-without-eol | 2 + tests/expected/misc/line-two-calls | 3 + tests/expected/misc/line-wait-for-eof | 2 + tests/expected/ul/basic | 111 ---------------------- tests/expected/ul/basic-filter-input | 11 +++ tests/expected/ul/basic-indicated | 2 + tests/expected/ul/basic-printable-characters | 95 ++++++++++++++++++ tests/ts/misc/line | 21 ++-- tests/ts/ul/basic | 9 +- 14 files changed, 146 insertions(+), 146 deletions(-) commit 30ec5b83e4211165470c53451ff742456fc69e74 Author: Karel Zak Date: Tue Oct 19 18:54:31 2021 +0200 build-sys: remove bashism Addresses: https://github.com/karelzak/util-linux/issues/1476 Signed-off-by: Karel Zak autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a02721f35b30d4ee0133446f016442f63117ddf6 Author: Mark Hindley Date: Mon Oct 18 17:53:01 2021 +0000 tests: Fix test/misc/swaplabel failure due to change in mkswap behaviour. mkswap now warns if the image file has holes. If fallocate is used to create the file, use POSIX semantics to ensure the file has no holes. This fixes the test failure misc: swaplabel ... FAILED (misc/swaplabel) ========= script: /build/util-linux-2.37.2/tests/ts/misc/swaplabel ================= ================= OUTPUT ===================== 1 Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes) 2 LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab 3 LABEL: 1234567890abcde 4 UUID: 12345678-abcd-abcd-abcd-1234567890ab ================= EXPECTED =================== 1 Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes) 2 LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab 3 LABEL: 1234567890abcde 4 UUID: 12345678-abcd-abcd-abcd-1234567890ab ================= O/E diff =================== ============================================== The additional error appears in swaplabel.err: mkswap: contains holes or other unsupported extents. This swap file can be rejected by kernel on swap activation! Use --verbose for more details. [zeha@debian.org: this appears to be important/required when building inside cowbuilder, on an ext3 filesystem.] Signed-off-by: Mark Hindley tests/ts/misc/swaplabel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 403f9c7af6632d10bad8688306ec0f41af586d67 Author: Karel Zak Date: Tue Oct 19 10:52:10 2021 +0200 build-sys: make libtool patching more robust Fixes: https://github.com/karelzak/util-linux/issues/1476 Signed-off-by: Karel Zak autogen.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 453032914981858517898385f6cdc92933261217 Author: Karel Zak Date: Tue Oct 19 10:11:37 2021 +0200 wdctl: sysfs open refactoring Let's make the sysfs handler usable in more functions. Signed-off-by: Karel Zak sys-utils/wdctl.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) commit 152b47d27aa40b47bba25b69b68b2cee6a477a09 Author: Karel Zak Date: Tue Oct 19 09:47:44 2021 +0200 wdctl: add --setpretimeout Addresses: https://github.com/karelzak/util-linux/issues/1475 Signed-off-by: Karel Zak sys-utils/wdctl.8.adoc | 9 ++++++++- sys-utils/wdctl.c | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 8 deletions(-) commit c4a543ff6c9c81209047a78bac47f5aec2e541ef Author: Chris Hofstaedtler Date: Mon Oct 18 07:40:01 2021 +0000 blockdev: remove accidental non-breaking spaces commit 9147d2ad8abb73cea5799323fc73ccdaf675826f introduced these C2A0 spaces, but without saying anything. Likely this was an accident. Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996751 Signed-off-by: Chris Hofstaedtler disk-utils/blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 60e5bb73990260836b087735a9c69deab8af4c81 Author: Hiroaki Sengoku Date: Fri Oct 15 14:02:46 2021 +0900 mcookie: fix infinite-loop when use -f Signed-off-by: Karel Zak misc-utils/mcookie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a98262050b7acf599f255d970c348e6ed5b22224 Author: Masatake YAMATO Date: Sat Oct 16 05:40:17 2021 +0900 lsfd: remove duplicated an O_ flag entry Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 4 ---- 1 file changed, 4 deletions(-) commit d4daa330b0baca5e7e55fc3d0b1dd993c12c68b0 Author: Vojtěch Eichler Date: Thu Oct 14 12:33:45 2021 +0200 tests: split several tests into subtests tests/expected/col/newlines | 11 -- tests/expected/col/newlines-one-line-no-nl | 1 + tests/expected/col/newlines-one-line-with-nl | 1 + tests/expected/col/newlines-second-line-no-nl | 2 + tests/expected/col/newlines-second-line-with-nl | 2 + tests/expected/col/newlines-zero-length-file | 0 tests/expected/col/options | 9 - tests/expected/col/options-no-backspaces | 1 + tests/expected/col/options-pass | 2 + tests/expected/col/options-spaces | 1 + tests/expected/col/options-tabs | 1 + tests/expected/fdisk/gpt | 138 --------------- tests/expected/fdisk/gpt-change-type-by-number | 20 +++ tests/expected/fdisk/gpt-change-type-by-uuid | 20 +++ tests/expected/fdisk/gpt-corrupt-backup-table | 20 +++ tests/expected/fdisk/gpt-corrupt-primary-table | 20 +++ tests/expected/fdisk/gpt-create-again-partition | 20 +++ tests/expected/fdisk/gpt-create-partitions | 0 tests/expected/fdisk/gpt-delete-partition | 19 +++ tests/expected/fdisk/gpt-empty-pt | 12 ++ tests/expected/fdisk/id | 4 - tests/expected/fdisk/id-create-mbr-with-id-0x1 | 1 + .../expected/fdisk/id-create-mbr-with-id-0x1.sparc | 0 tests/expected/fdisk/id-create-mbr-with-id-0x2 | 1 + .../expected/fdisk/id-create-mbr-with-id-0x2.sparc | 0 tests/expected/fdisk/id.sparc | 2 - tests/expected/fdisk/mbr-dos-mode | 189 --------------------- .../fdisk/mbr-dos-mode-create-another-log-par | 20 +++ .../fdisk/mbr-dos-mode-create-extended-par | 16 ++ .../expected/fdisk/mbr-dos-mode-create-logical-par | 20 +++ .../fdisk/mbr-dos-mode-create-primary-partition | 15 ++ .../fdisk/mbr-dos-mode-delete-extended-par | 12 ++ .../expected/fdisk/mbr-dos-mode-delete-logical-par | 17 ++ .../expected/fdisk/mbr-dos-mode-delete-primary-par | 19 +++ tests/expected/fdisk/mbr-dos-mode-empty-pt | 13 ++ .../fdisk/mbr-dos-mode-re-create-primary-par | 15 ++ .../expected/fdisk/mbr-dos-mode-set-partition-type | 15 ++ .../fdisk/mbr-dos-mode-set-primary-par-active | 15 ++ tests/expected/fdisk/mbr-sort | 75 -------- .../fdisk/mbr-sort-create-logical-partitions | 22 +++ .../fdisk/mbr-sort-create-primary-partitions | 18 ++ tests/expected/fdisk/mbr-sort-empty-pt | 10 ++ tests/expected/fdisk/mbr-sort-fix-order | 20 +++ tests/expected/fdisk/sunlabel | 116 ------------- .../expected/fdisk/sunlabel-create-first-partition | 16 ++ .../fdisk/sunlabel-create-second-partition | 29 ++++ .../expected/fdisk/sunlabel-delete-all-partitions | 1 + tests/expected/fdisk/sunlabel-empty-sun-pt | 14 ++ .../fdisk/sunlabel-set-first-par-mountable | 16 ++ .../expected/fdisk/sunlabel-set-first-par-readonly | 16 ++ tests/expected/fdisk/sunlabel-set-partition-sysid | 16 ++ tests/ts/col/newlines | 15 +- tests/ts/col/options | 12 +- tests/ts/fdisk/gpt | 27 ++- tests/ts/fdisk/id | 8 +- tests/ts/fdisk/mbr-dos-mode | 37 ++-- tests/ts/fdisk/mbr-sort | 16 +- tests/ts/fdisk/sunlabel | 42 +++-- 58 files changed, 603 insertions(+), 597 deletions(-) commit 06953d22470bd5733fe1045d7f8f39ba715b5c6f Author: Karel Zak Date: Thu Oct 14 12:17:31 2021 +0200 build-sys: patch libtool.m4 for darwin Fixes: https://github.com/karelzak/util-linux/issues/1468 Signed-off-by: Karel Zak autogen.sh | 12 ++++++++++++ tools/libtool.m4.patch | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) commit 85baeec1c5362aa43764363c17b86e076dc9384f Author: Karel Zak Date: Thu Oct 14 10:46:45 2021 +0200 tests: (logger) check for socat Addresses: https://github.com/karelzak/util-linux/issues/1466 Signed-off-by: Karel Zak tests/ts/logger/errors | 2 ++ 1 file changed, 2 insertions(+) commit be3acd23a8ec4701356a7e1db123b73237069764 Author: Karel Zak Date: Thu Oct 14 10:28:59 2021 +0200 su: reset RLIMIT_AS too Fixes: https://github.com/karelzak/util-linux/issues/1465 Signed-off-by: Karel Zak login-utils/runuser.1.adoc | 2 +- login-utils/su-common.c | 1 + login-utils/su.1.adoc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) commit 9c2b43b19f3b375fae6daedf2a44b545207ab9e9 Author: Karel Zak Date: Thu Oct 14 10:22:14 2021 +0200 docs: add note about GitHub PR Signed-off-by: Karel Zak Documentation/howto-pull-request.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 90e0342bbf04667c7e9377d0ec4d019ea15e41cd Author: Mister Me Date: Thu Oct 7 08:34:00 2021 -0600 findmnt: (adoc) Added section stating exit code semantics per issue #1464: https://github.com/karelzak/util-linux/issues/1464 [kzak@redhat.com: - move the text from DESCRIPTION to EXIT STATUS section] Signed-off-by: Glenn Golden Signed-off-by: Karel Zak misc-utils/findmnt.8.adoc | 6 ++++++ 1 file changed, 6 insertions(+) commit 950613a83db15d47b34a454ffe50146a2a438aaf Author: Masatake YAMATO Date: Sun Oct 10 17:01:40 2021 +0900 build-sys: link lib_common to test_procfs Suggested by Thomas Weißschuh at https://github.com/karelzak/util-linux/pull/1418#pullrequestreview-775639562 meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7feaa5c9a68f06d4221fe9bc1a17f55085097e23 Author: Masatake YAMATO Date: Tue Oct 5 23:55:30 2021 +0900 lsfd: (adoc) write about filter expression Charelle Collett helped me improve the setences. Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 196 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 165 insertions(+), 31 deletions(-) commit 77c70070ff2c2dc7f3313c3821a00606ee408ec7 Author: Masatake YAMATO Date: Tue Oct 12 07:24:42 2021 +0900 lsfd: (test) add a case for displaying a directory Signed-off-by: Masatake YAMATO tests/expected/lsfd/mkfds-directory | 12 +++++++ tests/helpers/test_mkfds.c | 28 +++++++++++++++ tests/ts/lsfd/mkfds-directory | 72 +++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) commit fd81d3a5582e966e89b613d1636959a0d355c06a Author: Masatake YAMATO Date: Sun Oct 10 09:58:55 2021 +0900 lsfd: (test) add cases for displaying a regular file and pipe Signed-off-by: Masatake YAMATO tests/commands.sh | 2 + tests/expected/lsfd/mkfds-pipe-no-fork | 9 ++ tests/expected/lsfd/mkfds-ro-regular-file | 10 ++ tests/helpers/Makemodule.am | 2 + tests/helpers/test_mkfds.c | 248 ++++++++++++++++++++++++++++++ tests/ts/lsfd/mkfds-pipe-no-fork | 73 +++++++++ tests/ts/lsfd/mkfds-ro-regular-file | 67 ++++++++ 7 files changed, 411 insertions(+) commit d40b7b4f9282df45e0f7e255c11c087c553399f0 Author: Masatake YAMATO Date: Tue Oct 12 06:42:37 2021 +0900 lsfd: add FUID and OWNER columns UID and USER is for processes. FUID and OWNER is for owners of files. Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 10 ++++++++++ misc-utils/lsfd.1.adoc | 6 ++++++ misc-utils/lsfd.c | 4 ++++ misc-utils/lsfd.h | 6 ++++-- 4 files changed, 24 insertions(+), 2 deletions(-) commit 35186bf0b1eec951814e6535897eb03860d04740 Author: Masatake YAMATO Date: Tue Oct 12 06:27:58 2021 +0900 lsfd: fill UID column with the process's uid The original code fills the column with the owner id of the executable file. Because lsfd fills USER column field by decoding UID column, the USER in lsfd meant the owner name of the executable. On the other hand, lsof fills the USER column with the process's user name. To avoid users confusing, this change makes lsfd do the same lsof; filling UID column with the process's uid. Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit f439236f2c93de58d327593176d4efb44209f537 Author: Masatake YAMATO Date: Mon Oct 11 03:59:35 2021 +0900 lsfd: (filter) implement !~, an operator for regex unmatching Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit abaf378c0fc31429c045487aea25a3a462b18432 Author: Masatake YAMATO Date: Fri Oct 8 15:51:55 2021 +0900 lsfd: (filter) implement =~, an operator for regex matching Signed-off-by: Masatake YAMATO misc-utils/hardlink.c | 2 +- misc-utils/lsfd-filter.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 91 insertions(+), 4 deletions(-) commit 23a4b2b22d3e138a7c7fe2f1c2a8bf43bea4150a Author: Masatake YAMATO Date: Fri Oct 8 15:27:23 2021 +0900 lsfd: (filter) make error messages in check_type methods Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 109 ++++++++++++++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 38 deletions(-) commit 87ffe87ffcc5e8e1bd69457dc7cc1fabcc015cdf Author: Masatake YAMATO Date: Fri Oct 8 12:18:16 2021 +0900 lsfd: (filter) give a name to a constant Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 2 +- misc-utils/lsfd-filter.h | 8 ++++++++ misc-utils/lsfd.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) commit d0238cb7355626d7238314a6398b702c5865268d Author: Masatake YAMATO Date: Fri Oct 8 15:52:43 2021 +0900 lsfd: (filter) whitespace cleanup Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2ecdfe451f4ead2989fd9245e9dc0e226687384f Author: Masatake YAMATO Date: Thu Oct 7 18:08:06 2021 +0900 lsfd: (adoc) remove a redundant word Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ee4c324982cbc73b9f50f5c689f8238a97014cb9 Author: Karel Zak Date: Thu Oct 7 13:11:18 2021 +0200 hardlink: improve verbose messages Signed-off-by: Karel Zak misc-utils/hardlink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 3505beaecc7289bdf7509e4c10fa33468b152de3 Author: Karel Zak Date: Thu Oct 7 10:43:32 2021 +0200 build-sys: fix test_procfs SOURCES Signed-off-by: Karel Zak lib/Makemodule.am | 3 +++ 1 file changed, 3 insertions(+) commit a7f70ce17a925f1085bfa4b292427f8741d7e2a2 Author: Karel Zak Date: Wed Oct 6 13:36:42 2021 +0200 lsns: optimize mountinfo use Let's parse mountinfo only for unknown namespaces or when namespace Id is not accessible (unprivileged users). Signed-off-by: Karel Zak misc-utils/lsfd.c | 49 ++++++++++++++++++++++++++++++++++++++++--------- misc-utils/lsfd.h | 1 + 2 files changed, 41 insertions(+), 9 deletions(-) commit 0c799b0da944f03af1a69417813ecbf08df77abc Author: Karel Zak Date: Wed Oct 6 11:22:07 2021 +0200 lsfd: remove unused code Signed-off-by: Karel Zak misc-utils/lsfd.c | 28 ---------------------------- 1 file changed, 28 deletions(-) commit d18b7b751049e03042900ac372bf9da68a68092e Author: Karel Zak Date: Wed Oct 6 11:20:51 2021 +0200 lsfd: function rename Signed-off-by: Karel Zak misc-utils/lsfd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit ee194909e301fba93b45fdd99f04a4ff1f74094c Author: Karel Zak Date: Wed Oct 6 11:11:16 2021 +0200 build-sys: cleanup lsfd related stuff - add lsfd to meson.build - add Masatake to AUTHORS - add me to lsfd.c header and man page Signed-off-by: Karel Zak AUTHORS | 1 + meson.build | 13 +++++++++++++ misc-utils/Makemodule.am | 1 + misc-utils/lsfd.1.adoc | 3 ++- misc-utils/lsfd.c | 1 + misc-utils/meson.build | 13 +++++++++++++ 6 files changed, 31 insertions(+), 1 deletion(-) commit 90833fa64f098bcfccdec6ff93c0730bc9727260 Author: Masatake YAMATO Date: Mon Oct 4 04:47:56 2021 +0900 lsfd: add new man page to Makemodule.am Signed-off-by: Masatake YAMATO misc-utils/Makemodule.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ad5ac41daca0fd5bc736c60a82d13d1439b28fe3 Author: Masatake YAMATO Date: Mon Oct 4 04:44:21 2021 +0900 lsfd: (adoc) write more about the -o option Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 7ec3b497f43bb2d208098c4aeae9663172edbca7 Author: Masatake YAMATO Date: Mon Oct 4 03:57:06 2021 +0900 lsfd: (adoc) add proc(5) to SEE ALSO section Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 1 + 1 file changed, 1 insertion(+) commit 2102fcdfadc3e9c80e3c1ef83b8acd5c442e677b Author: Masatake YAMATO Date: Sun Oct 3 17:56:47 2021 +0900 lsfd: (adoc) reorder the options Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 46c62e47feab0264d13d24c073fd8685381fda6a Author: Masatake YAMATO Date: Sun Oct 3 15:58:38 2021 +0900 lsfd: (adoc) update DESCRIPTION Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 8e7098c85bf925b063528b551cc4512dcaa1d3b6 Author: Masatake YAMATO Date: Sun Oct 3 16:06:20 2021 +0900 lsfd: (adoc) reorder the sections Signed-off-by: Masatake YAMATO misc-utils/lsfd.1.adoc | 61 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 30 deletions(-) commit 9fc6dfa02cd0c304f4a88c5781633043116ace34 Author: Masatake YAMATO Date: Mon Oct 4 04:22:09 2021 +0900 lsfd: (adoc) put missing :: at the end of options misc-utils/lsfd.1.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit fc1e7a2bf9247e64de39c8f7cc52f3770f4ff869 Author: Masatake YAMATO Date: Mon Oct 4 04:37:19 2021 +0900 lsfd: fix a typo in DEVTYPE description Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ae6ccf51e8f91c15bc567bb4907265a5bbadb3ec Author: Masatake YAMATO Date: Sat Oct 2 02:24:31 2021 +0900 lsfd: wrap code for debugging with #ifdef DEBUG/#endif Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 4 ++++ 1 file changed, 4 insertions(+) commit eb83898ac11c501d4fb865670ab37e405e103391 Author: Masatake YAMATO Date: Sat Oct 2 02:15:00 2021 +0900 lsfd: convert lines introducing local variable to a block with {...} The following code causing an error on test run on GitHub Action: case FOO: type localvar; This change converts above code to: case FOO: { type localvar; } Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) commit ef70cdd96d79d3986268eaf6d96f948da5f49e1a Author: Masatake YAMATO Date: Sat Oct 2 01:53:14 2021 +0900 lsfd: change the license of the filtering engine to LGPL This change is for moving the filtering engine to libsmartcols in the future. In addition to the change, I made myself a copyright holder of the code. Signed-off-by: Masatake YAMATO misc-utils/lsfd-filter.c | 19 ++++--------------- misc-utils/lsfd-filter.h | 19 ++++--------------- 2 files changed, 8 insertions(+), 30 deletions(-) commit 1037355f1d4b63ac28bcafc815607b6d66d28239 Author: Mario Blättermann Date: Fri Oct 1 21:35:42 2021 +0200 lsfd: Add new man page to po4a.cfg po-man/po4a.cfg | 1 + 1 file changed, 1 insertion(+) commit 3f9df3ee1d540c6ae198e2941a60de912ee382bb Author: Mario Blättermann Date: Fri Oct 1 20:40:12 2021 +0200 lsfd: Add initial man page misc-utils/lsfd.1.adoc | 156 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) commit 0c6c3c859699e48a1e5fa827f082eac0a5a7fa58 Author: Mario Blättermann Date: Fri Oct 1 20:39:48 2021 +0200 lsfd: Fix typos in lsfd.c misc-utils/lsfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f8fa2c2a7653994c3c646aad9f2e11e3eb679a57 Author: Karel Zak Date: Fri Oct 1 13:10:46 2021 +0200 lsfd: use new scols_line_get_column_data() Signed-off-by: Karel Zak misc-utils/lsfd-filter.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) commit 9c06edb07447f0e3e880b3bf7f9f79dda5d321fc Author: Karel Zak Date: Fri Oct 1 13:10:06 2021 +0200 libsmartcols: add scols_line_get_column_data() Signed-off-by: Karel Zak libsmartcols/docs/libsmartcols-sections.txt | 1 + libsmartcols/src/libsmartcols.h.in | 1 + libsmartcols/src/libsmartcols.sym | 4 ++++ libsmartcols/src/line.c | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+) commit 7b36646951dc927204065f533ea352fe6dedc546 Author: Masatake YAMATO Date: Tue Sep 28 21:57:31 2021 +0900 lsfd: collect threads level information if TID is specified in a filter Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit aed101f0113f024b3c8634d543596d7307097835 Author: Masatake YAMATO Date: Sat Sep 25 04:32:27 2021 +0900 lsfd: introduce --source filter option Reflecting the review comment: add filter by SOURCE (lsfd --source sda1) Example output: # ./lsfd --source proc | head COMMAND PID USER ASSOC MODE TYPE SOURCE MNTID INODE NAME systemd 1 root 10 r-- REG proc 23 18542 /proc/1/mountinfo systemd 1 root 14 r-- REG proc 23 4026532082 /proc/swaps systemd-resolve 856 root 7 r-- REG proc 254 24841 /proc/sys/kernel/hostname low-memory-moni 898 root 7 rw- REG proc 425 4026532073 /proc/pressure/memory low-memory-moni 898 root 8 rw- REG proc 425 4026532073 /proc/pressure/memory low-memory-moni 898 root 9 rw- REG proc 425 4026532073 /proc/pressure/memory packagekitd 25205 root 12 r-- REG proc 23 69645 /proc/25205/mountinfo systemd 26466 root 10 r-- REG proc 23 71813 /proc/26466/mountinfo systemd 26466 root 14 r-- REG proc 23 4026532082 /proc/swaps # ./lsfd --source proc -Q '(PID == 898)' COMMAND PID USER ASSOC MODE TYPE SOURCE MNTID INODE NAME low-memory-moni 898 root 7 rw- REG proc 425 4026532073 /proc/pressure/memory low-memory-moni 898 root 8 rw- REG proc 425 4026532073 /proc/pressure/memory low-memory-moni 898 root 9 rw- REG proc 425 4026532073 /proc/pressure/memory Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) commit 52ab46daa2243276f12a55ad744680f8d2434863 Author: Masatake YAMATO Date: Tue Sep 21 02:58:48 2021 +0900 lsfd: introduce -Q option for generic filtering Examples: # ./lsfd -Q "(FD <= 9) and (TYPE == 'SOCK')" -Q "COMMAND == 'ssh'" | head COMMAND PID USER ASSOC MODE TYPE SOURCE MNTID INODE NAME ssh 153907 root 4 rw- SOCK sockfs 9 2450021 TCP:[2450021] ssh 1657696 root 4 rw- SOCK sockfs 9 64357645 TCP:[64357645] ssh 1657696 root 5 rw- SOCK sockfs 9 64363596 UNIX:[64363596] ssh 2345473 root 4 rw- SOCK sockfs 9 81978848 TCP:[81978848] ssh 2345473 root 5 rw- SOCK sockfs 9 81980736 UNIX:[81980736] ssh 2345473 root 9 rw- SOCK sockfs 9 81980737 UNIX:[81980737] ssh 2345475 root 4 rw- SOCK sockfs 9 81975091 UNIX:[81975091] ssh 3958804 root 0 rw- SOCK sockfs 9 87840900 UNIX:[87840900] ssh 3958804 root 4 rw- SOCK sockfs 9 87836642 TCP:[87836642] # ./lsfd -Q "((ASSOC == 'exe') || (ASSOC == 'pid')) and (USER == 'yamato')" COMMAND PID USER ASSOC MODE TYPE SOURCE MNTID INODE NAME lsfd 690292 yamato exe --- REG dm-2 0 34474245 /home/yamato/var/util-linux/util-linux/.libs/lsfd lsfd 690292 yamato pid --- REG nsfs 0 4026531836 pid:[4026531836] pidns 1458677 yamato exe --- REG dm-2 0 34212178 /home/yamato/var/kernel-essential-training/container/pidns pidns 1458677 yamato pid --- REG nsfs 0 4026533715 pid:[4026533715] fd-catalog 1677961 yamato exe --- REG dm-2 0 128715536 /home/yamato/var/fd-catalog/fd-catalog (deleted) fd-catalog 1677961 yamato pid --- REG nsfs 0 4026531836 pid:[4026531836] Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++----- misc-utils/lsfd.h | 1 + 2 files changed, 96 insertions(+), 9 deletions(-) commit 846b4cbee2d0faf30f92673fece3a0d240fabab9 Author: Masatake YAMATO Date: Tue Sep 21 02:57:37 2021 +0900 lsfd: add filter engine Signed-off-by: Masatake YAMATO misc-utils/Makemodule.am | 2 + misc-utils/lsfd-filter.c | 1256 ++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd-filter.h | 46 ++ 3 files changed, 1304 insertions(+) commit c8f435456525ec253f72f77c00ddcf25be71b68d Author: Masatake YAMATO Date: Sat Sep 25 02:14:05 2021 +0900 lsfd: fix a typo in comment Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b813e8ce8f0375ce7f8b3f0deb8f51f8af5d333f Author: Karel Zak Date: Thu Sep 30 11:11:30 2021 +0200 lsfd: optimize symlinks use Like the previous commit, this patch tries to reuse /proc/#/{fd,ns,cwd,root} symlinks if possible. On my machine it saves ~2000 stat() calls. Signed-off-by: Karel Zak misc-utils/lsfd.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) commit 5593f1d147d4d72f2f0da47af4222b38168a157b Author: Karel Zak Date: Thu Sep 30 10:42:02 2021 +0200 lsfd: optimize maps use The /proc/#/maps file usually contains the same file more than once. This patch tries to reuse previous file to reduce number of stat() calls, see "strace --summary-only" output below, the syscall is reduce in 50%. old version: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 55.57 0.118708 2 50756 5414 newfstatat new version: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 39.17 0.058501 2 24436 5382 newfstatat Signed-off-by: Karel Zak misc-utils/lsfd.c | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) commit 6230d4118d7ac304fc76ec5b122a70e61ad26aa0 Author: Karel Zak Date: Mon Sep 20 15:23:58 2021 +0200 lsfd: use only "/proc/#/maps" file * do not read /proc/#/map_files symlinks * use paths from /proc/#/maps * do not maintain map entries Signed-off-by: Karel Zak misc-utils/lsfd.c | 198 ++++++++++++++---------------------------------------- 1 file changed, 50 insertions(+), 148 deletions(-) commit 174ab64af2e8f9bb89f2d5983118953a7182b564 Author: Karel Zak Date: Mon Sep 20 13:30:28 2021 +0200 lsfd: don't use 'long int' for file data Let's always assume positions, offsets, etc.. as 64-bit numbers. Signed-off-by: Karel Zak misc-utils/lsfd-file.c | 4 ++-- misc-utils/lsfd-sock.c | 2 +- misc-utils/lsfd.c | 4 ++-- misc-utils/lsfd.h | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) commit 5adbe6cff3e5c00d35bbd0ae4e610b8b1f71025d Author: Karel Zak Date: Mon Sep 20 13:16:06 2021 +0200 lsfd: cleanup fdinfo handling Signed-off-by: Karel Zak misc-utils/lsfd-file.c | 10 ++++++---- misc-utils/lsfd.c | 13 +++++++------ misc-utils/lsfd.h | 6 +++--- 3 files changed, 16 insertions(+), 13 deletions(-) commit a96342124d918f44873825bb598f895d8162dbbe Author: Karel Zak Date: Mon Sep 20 12:46:31 2021 +0200 lsfd:remove struct fdinfo_data Signed-off-by: Karel Zak misc-utils/lsfd-file.c | 10 +++++----- misc-utils/lsfd.h | 12 +++--------- 2 files changed, 8 insertions(+), 14 deletions(-) commit 99ce42501ce4077359b014c3e20da33b83c02d85 Author: Karel Zak Date: Mon Sep 20 12:28:50 2021 +0200 lsfd: split new_file(), remove map_file_data Don't initialize entire 'struct file' in one step. It seems better to use different ways according to file source (map, symlink, etc.). Signed-off-by: Karel Zak misc-utils/lsfd-file.c | 18 +++++++++++- misc-utils/lsfd-sock.c | 12 ++++---- misc-utils/lsfd.c | 75 +++++++++++++++++++++++++------------------------- misc-utils/lsfd.h | 12 ++++---- 4 files changed, 64 insertions(+), 53 deletions(-) commit 618db964984490af613c90c4d6e584090e1298c4 Author: Masatake YAMATO Date: Fri Sep 17 01:04:48 2021 +0900 lsfd: rename DEVNAME column to SOURCE Reflecting the review comment: maybe rename DEVNAME to SOURCE as we have here things like 'devtmpfs' etc. Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 2 +- misc-utils/lsfd-cdev.c | 2 +- misc-utils/lsfd-fifo.c | 2 +- misc-utils/lsfd-file.c | 2 +- misc-utils/lsfd-sock.c | 2 +- misc-utils/lsfd-unkn.c | 2 +- misc-utils/lsfd.c | 8 ++++---- misc-utils/lsfd.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) commit eb5fc0a0f3dd7481cc463b10a48eac4681b8e611 Author: Masatake YAMATO Date: Fri Sep 17 00:46:39 2021 +0900 lsfd: remove redundant "nodev:" prefix from DEVNAME column Reflecting the review comment: remove "nodev:" from DEVNAME Signed-off-by: Masatake YAMATO misc-utils/lsfd-fifo.c | 2 +- misc-utils/lsfd-file.c | 2 +- misc-utils/lsfd-sock.c | 2 +- misc-utils/lsfd-unkn.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) commit 7591516d0ea433a95e46e60a10d9e0625f3b6f99 Author: Masatake YAMATO Date: Fri Sep 17 00:22:14 2021 +0900 lsfd: add DEVTYPE column Reflecting the review comment: add DEVTYPE for blk, char, and nodev Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 5 +++++ misc-utils/lsfd-cdev.c | 5 +++++ misc-utils/lsfd-file.c | 5 +++++ misc-utils/lsfd.c | 2 ++ misc-utils/lsfd.h | 1 + 5 files changed, 18 insertions(+) commit a9822364d20ff3534efbd5943af9a9f26c63dd7a Author: Masatake YAMATO Date: Fri Sep 17 00:07:45 2021 +0900 lsfd: sort the enumerators about columns Signed-off-by: Masatake YAMATO misc-utils/lsfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6cdc99060a87428f0b74026ff89600fb4c1a12be Author: Masatake YAMATO Date: Fri Sep 17 00:01:30 2021 +0900 lsfd: rename the column DEVICE to MAJ:MIN Reflecting the review comment: add MAJ:MIN for major and minor numbers, remove DEVICE (we use MAJ:MIN in other tools) Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 2 +- misc-utils/lsfd-cdev.c | 2 +- misc-utils/lsfd-file.c | 2 +- misc-utils/lsfd.c | 4 ++-- misc-utils/lsfd.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) commit 007f02ec543ddbd63cddebc9be13aead3dae2f0b Author: Karel Zak Date: Wed Sep 8 14:42:05 2021 +0200 lsfd: don't duplicate ASSOC_EXE processing Signed-off-by: Karel Zak misc-utils/lsfd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 174baf3b9b41301e970b002955eb869ed9f0e25a Author: Karel Zak Date: Wed Sep 8 14:32:31 2021 +0200 lsfd: use one function to all symlinks This commit introduces collect_file_symlink() to gather info from arbitrary symlink (e.g. /proc/#/exe, /proc/#/fd/1). Signed-off-by: Karel Zak misc-utils/lsfd.c | 100 ++++++++++++++++++++---------------------------------- 1 file changed, 37 insertions(+), 63 deletions(-) commit ae838009d24b411203ee5e43c0a81d658dda2722 Author: Karel Zak Date: Wed Sep 8 13:44:20 2021 +0200 lib/path: add ul_path_next_dirent() Signed-off-by: Karel Zak include/path.h | 2 ++ lib/path.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) commit db9ad223d6f136d95254d73808c39786d80abf2e Author: Karel Zak Date: Wed Sep 8 13:16:29 2021 +0200 lib/path: use flags for fstatat() Signed-off-by: Karel Zak include/path.h | 2 +- lib/path.c | 5 +++-- lib/procfs.c | 2 +- libmount/src/context_veritydev.c | 2 +- misc-utils/lsblk-properties.c | 2 +- misc-utils/lsfd.c | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) commit 0e04a66789b8e9cb93d4c49bf88fba8a66e6b81a Author: Karel Zak Date: Wed Sep 8 12:52:43 2021 +0200 lsfd: fix ASSOC_EXE use, make file->association use more robust Let's use is_association() macro in the code rather than directly check file->association as this struct member has special semantic. Signed-off-by: Karel Zak misc-utils/lsfd.c | 15 ++++++++++----- misc-utils/lsfd.h | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) commit c77e52b6663afee08044adf9c4cbadfb3eeab308 Author: Karel Zak Date: Wed Sep 8 11:22:15 2021 +0200 lsfd: cleanup collect_outofbox_files stuff * use path_cxt * call fstat() only once (no extra call to get uid) * reduce names to variables to get function calls to one line ;-) * fix use of procfs_process_get_cmdname() Signed-off-by: Karel Zak misc-utils/lsfd.c | 116 ++++++++++++++++++++---------------------------------- 1 file changed, 42 insertions(+), 74 deletions(-) commit 95b4a78918ccc6f990026f54b3e239c3223629d6 Author: Karel Zak Date: Wed Sep 8 10:49:43 2021 +0200 lsfd: small cleanup to mountinfo/nodev code * use path_cxt to open mountinfo (so remove open_mountinfo()) * move all nodev code to one place * merge add_nodev() to add_nodevs() Signed-off-by: Karel Zak misc-utils/lsfd.c | 132 +++++++++++++++++++++++++----------------------------- 1 file changed, 62 insertions(+), 70 deletions(-) commit cb6f0c4a1516ff0f5043fdd58164a3df9b707c7c Author: Karel Zak Date: Wed Sep 8 10:28:14 2021 +0200 lsfd: use path_cxt to read process * path_cxt is based on openat-like functions and lib/path.c provides large number of utils to use it * one handler is re-used for all processes to reduce memory allocation * list of process is moved to lsfd_control to make it available everywhere * read tasks when we read process, no later * lists initialization is done when object (process) is allocated Signed-off-by: Karel Zak misc-utils/lsfd.c | 226 ++++++++++++++++++++++++------------------------------ 1 file changed, 99 insertions(+), 127 deletions(-) commit 50082db43ab1337e98c5b4ba04a15e4d44e2b418 Author: Karel Zak Date: Tue Sep 7 17:53:06 2021 +0200 lsfd: fix typo, rename function Signed-off-by: Karel Zak misc-utils/lsfd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 6f5bd208703eb8d8138948c0eb6661a20c93fe03 Author: Karel Zak Date: Tue Sep 7 17:42:37 2021 +0200 build-sys: remove lib/procutils.c Signed-off-by: Karel Zak include/Makemodule.am | 1 - include/procutils.h | 37 ------ lib/Makemodule.am | 1 - lib/procutils.c | 345 -------------------------------------------------- meson.build | 6 +- 5 files changed, 3 insertions(+), 387 deletions(-) commit b8ae00a71037b54079e4cd63943823b3cc8141de Author: Karel Zak Date: Tue Sep 7 17:40:55 2021 +0200 lsfd: use lib/procfs.c misc-utils/lsfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f7f6cc635101aa3c79dba7a9b18dee966937d5cf Author: Karel Zak Date: Tue Sep 7 17:40:04 2021 +0200 lsns: use lib/procfs.c sys-utils/lsns.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) commit 0166c281c109734d697c61dbb406a8c92b629abd Author: Karel Zak Date: Tue Sep 7 17:39:54 2021 +0200 lsipc: use lib/procfs.c sys-utils/lsipc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 602f734ad3b851cd3bf453b075b03cc85d40f7e6 Author: Karel Zak Date: Tue Sep 7 17:39:33 2021 +0200 uclampset: use lib/procfs.c schedutils/uclampset.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) commit c704e680edc85757df3ef9d48e9847be95b1db37 Author: Karel Zak Date: Tue Sep 7 17:39:16 2021 +0200 taskset: use lib/procfs.c schedutils/taskset.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 4d791071bafc9d9e8677c99ff28c917649fe9ea0 Author: Karel Zak Date: Tue Sep 7 17:39:00 2021 +0200 chrt: use lib/procfs.c schedutils/chrt.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) commit 0692c3ae1ab565e6e4452bc8624511b7b7e3ec9d Author: Karel Zak Date: Tue Sep 7 17:38:47 2021 +0200 lslocks: use lib/procfs.c misc-utils/lslocks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0bac02dafb7037376bb277f8c8c65ece69e2a6a1 Author: Karel Zak Date: Tue Sep 7 17:38:31 2021 +0200 kill: use lib/procfs.c misc-utils/kill.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) commit c0f40fe5ad91261f0b84d530faee150a14b0ce90 Author: Karel Zak Date: Tue Sep 7 17:38:04 2021 +0200 lib/caputils: use lib/procfs.c lib/caputils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f51c0e87bde45351b7439a17e6ecbc3f698c46f9 Author: Karel Zak Date: Tue Sep 7 17:37:46 2021 +0200 lslogins: use lib/procfs.c login-utils/lslogins.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit 32c21c768140a31c6ce1f522be6a60f5ceb6f1fa Author: Karel Zak Date: Tue Sep 7 17:32:01 2021 +0200 lib/procfs: add functions to read /proc/#/ stuff This is extension to lib/path.c (the same as lib/sysfs.c for block devices) to read info about processes. * replaces code from lib/procutils.c * remove proc_{open,close}_processes(), opendir and readdir is good enough * add procfs_dirent_*() functions to work with readdir() from /proc * add new path_cxt based API (will be extended in next commits) for complex tasks Signed-off-by: Karel Zak include/Makemodule.am | 1 + include/pathnames.h | 1 + include/procfs.h | 62 ++++++ lib/Makemodule.am | 10 +- lib/meson.build | 4 +- lib/procfs.c | 560 ++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 632 insertions(+), 6 deletions(-) commit 2f26f8aae1ece618ff7ade997609509f0b60d400 Author: Karel Zak Date: Mon Sep 6 11:52:09 2021 +0200 lib/path: fstat dir itself Signed-off-by: Karel Zak lib/path.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 3afcaab2f9000eafa557eebd45b3bec3846366da Author: Karel Zak Date: Thu Sep 2 16:32:33 2021 +0200 lsfd: revert include/path.h use We need something better to handle work with processes. Signed-off-by: Karel Zak misc-utils/lsfd.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) commit 34f3fd1ad8ac9118fb1de5cf01789545f1cdc2a9 Author: Karel Zak Date: Thu Sep 2 14:30:58 2021 +0200 lsfd: add reference to proc from file * add to file struct reference to process * add file to the list of the process' files in new_file() This makes things more straightforward. Signed-off-by: Karel Zak misc-utils/lsfd-sock.c | 14 +++++++------- misc-utils/lsfd.c | 33 +++++++++++---------------------- misc-utils/lsfd.h | 2 +- 3 files changed, 19 insertions(+), 30 deletions(-) commit 7444424d088ba623874559cb29e77ffd6733ffcd Author: Karel Zak Date: Thu Sep 2 14:13:49 2021 +0200 lsfd: move list_free() to list.h include/list.h | 19 +++++++++++++++++++ misc-utils/lsfd.h | 11 ----------- 2 files changed, 19 insertions(+), 11 deletions(-) commit 6f5e8c7ccf658c745e62200d5e9f33fff4fc8311 Author: Karel Zak Date: Thu Sep 2 14:00:44 2021 +0200 lsfd: reorder function Keep free_() after new_(). Signed-off-by: Karel Zak misc-utils/lsfd.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) commit faf8c94f063670e94aeb23f68d4cf76239e6fd89 Author: Karel Zak Date: Thu Sep 2 13:58:49 2021 +0200 lsfd: remove collect_file() Signed-off-by: Karel Zak misc-utils/lsfd.c | 64 ++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 36 deletions(-) commit f9fa97d3952e026e1b226c818eef04a7dcc6fc85 Author: Karel Zak Date: Wed Sep 1 19:10:20 2021 +0200 lsfd: cleanup new file initialization Don't use new_() functions if we have already have file_class callbacks. Signed-off-by: Karel Zak misc-utils/lsfd-bdev.c | 9 ------- misc-utils/lsfd-cdev.c | 9 ------- misc-utils/lsfd-fifo.c | 9 ------- misc-utils/lsfd-file.c | 25 -------------------- misc-utils/lsfd-sock.c | 26 +++++++++++--------- misc-utils/lsfd-unkn.c | 10 -------- misc-utils/lsfd.c | 64 ++++++++++++++++++++++++++++++++++++++++++-------- misc-utils/lsfd.h | 29 +++-------------------- 8 files changed, 72 insertions(+), 109 deletions(-) commit a910943426b985b4bd64ab6b6dbe73d650ad80b4 Author: Karel Zak Date: Wed Sep 1 18:12:09 2021 +0200 lsfd: keep main() at the end of the code and usage() before main(). Signed-off-by: Karel Zak misc-utils/lsfd.c | 282 +++++++++++++++++++++++++++--------------------------- 1 file changed, 143 insertions(+), 139 deletions(-) commit 2d95dc093b17eab5a8e80c0db48301a25dd55a2e Author: Karel Zak Date: Wed Sep 1 17:50:51 2021 +0200 lsfd: use 'new_' prefix when we allocate something It's more readable than rather than 'make_'. Signed-off-by: Karel Zak misc-utils/lsfd-bdev.c | 8 ++++---- misc-utils/lsfd-cdev.c | 12 ++++++------ misc-utils/lsfd-fifo.c | 4 ++-- misc-utils/lsfd-file.c | 2 +- misc-utils/lsfd-sock.c | 4 ++-- misc-utils/lsfd-unkn.c | 4 ++-- misc-utils/lsfd.c | 33 +++++++++++++++++++-------------- misc-utils/lsfd.h | 12 ++++++------ 8 files changed, 42 insertions(+), 37 deletions(-) commit 6fb6f5495fc8667ef845bd0ee83736f11f51b2e4 Author: Karel Zak Date: Wed Sep 1 17:36:29 2021 +0200 lsfd: add --sysroot, use lib/path.c * use struct path_cxt to read from /procfs * add --sysroot to redirect lsfd to alternative location (necessary for regression tests) * merge collect_procs() into collect() Signed-off-by: Karel Zak misc-utils/lsfd.c | 64 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 18 deletions(-) commit 73ee7d4c219700c0a64b4e812e7a04504ad15729 Author: Karel Zak Date: Wed Sep 1 16:50:04 2021 +0200 lsfd: add --notruncate * make COMMAND and NAME truncated by default (to keep output on terminal readable) * add --notruncate to disable the default behaviour Signed-off-by: Karel Zak misc-utils/lsfd.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) commit 78f201593fa39f959deb12cd36b2438aac759f0a Author: Karel Zak Date: Wed Sep 1 16:35:42 2021 +0200 lsfd: tiny change to default colummns initialization Signed-off-by: Karel Zak misc-utils/lsfd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit bc9fd537d8dc6f92accaf3c850883bb680f54e61 Author: Masatake YAMATO Date: Fri May 14 05:24:21 2021 +0900 lsfd: unify nodev lists into global one misc-utils/lsfd-file.c | 3 +-- misc-utils/lsfd.c | 63 +++++++++++++++++++++++++++++++++----------------- misc-utils/lsfd.h | 3 +-- 3 files changed, 44 insertions(+), 25 deletions(-) commit 8fe66674b14539f72310761fb4d88e16c0c48541 Author: Masatake YAMATO Date: Fri May 14 04:23:19 2021 +0900 lsfd: don't use threads misc-utils/Makemodule.am | 3 +- misc-utils/lsfd.c | 119 +++++------------------------------------------ 2 files changed, 13 insertions(+), 109 deletions(-) commit 1e9880a85b5996c487895af24b16b3a1210bbe69 Author: Masatake YAMATO Date: Mon May 10 12:56:56 2021 +0900 lsfd: fill PROTONAME field of file for mmap'ed socket Signed-off-by: Masatake YAMATO misc-utils/lsfd-sock.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 63f3938581d4b54d4951cd471f61d3245130930a Author: Masatake YAMATO Date: Mon May 10 12:54:55 2021 +0900 lsfd: add MAPLEN column Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 6 ++++-- misc-utils/lsfd-cdev.c | 6 ++++-- misc-utils/lsfd-fifo.c | 6 ++++-- misc-utils/lsfd-file.c | 20 +++++++++++++++++++- misc-utils/lsfd-sock.c | 6 ++++-- misc-utils/lsfd-unkn.c | 6 ++++-- misc-utils/lsfd.c | 30 +++++++++++++++++------------- misc-utils/lsfd.h | 30 ++++++++++++++++++++++++------ 8 files changed, 80 insertions(+), 30 deletions(-) commit 056ae40f8cb8af8f926cac16c325543f1c890955 Author: Masatake YAMATO Date: Mon May 10 11:07:23 2021 +0900 lsfd: introduce a data structure for storing common fdinfo data Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 10 +++++----- misc-utils/lsfd.h | 10 ++++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) commit 45e225aa3e61210eb44f53fb0d79d8a868ea3258 Author: Masatake YAMATO Date: Wed May 5 02:50:14 2021 +0900 lsfd: increase the threads to collect information $ sudo ./lsfd -l | wc -l 75837 [NUM_COLLECTORS 1] sudo ./lsfd -l > /dev/null 1.16s user 0.62s system 98% cpu 1.805 total sudo ./lsfd -l > /dev/null 1.12s user 0.50s system 99% cpu 1.630 total sudo ./lsfd -l > /dev/null 1.14s user 0.49s system 99% cpu 1.642 total [NUM_COLLECTORS 2] sudo ./lsfd -l > /dev/null 1.18s user 0.53s system 127% cpu 1.343 total sudo ./lsfd -l > /dev/null 1.21s user 0.50s system 126% cpu 1.350 total sudo ./lsfd -l > /dev/null 1.14s user 0.51s system 128% cpu 1.291 total [NUM_COLLECTORS 3] sudo ./lsfd -l > /dev/null 1.21s user 0.55s system 138% cpu 1.278 total sudo ./lsfd -l > /dev/null 1.15s user 0.51s system 139% cpu 1.187 total sudo ./lsfd -l > /dev/null 1.15s user 0.51s system 140% cpu 1.180 total [NUM_COLLECTORS 4] sudo ./lsfd -l > /dev/null 1.23s user 0.66s system 154% cpu 1.218 total sudo ./lsfd -l > /dev/null 1.22s user 0.54s system 154% cpu 1.137 total sudo ./lsfd -l > /dev/null 1.14s user 0.64s system 158% cpu 1.123 total [NUM_COLLECTORS 5] sudo ./lsfd -l > /dev/null 1.19s user 0.72s system 171% cpu 1.118 total sudo ./lsfd -l > /dev/null 1.14s user 0.62s system 165% cpu 1.063 total sudo ./lsfd -l > /dev/null 1.15s user 0.73s system 176% cpu 1.063 total [NUM_COLLECTORS 6] sudo ./lsfd -l > /dev/null 1.23s user 0.70s system 173% cpu 1.115 total sudo ./lsfd -l > /dev/null 1.29s user 0.67s system 169% cpu 1.157 total sudo ./lsfd -l > /dev/null 1.24s user 0.75s system 185% cpu 1.070 total [NUM_COLLECTORS 7] sudo ./lsfd -l > /dev/null 1.32s user 0.74s system 182% cpu 1.130 total sudo ./lsfd -l > /dev/null 1.25s user 0.82s system 195% cpu 1.058 total sudo ./lsfd -l > /dev/null 1.22s user 0.74s system 188% cpu 1.041 total [NUM_COLLECTORS 8] sudo ./lsfd -l > /dev/null 1.30s user 0.92s system 194% cpu 1.141 total sudo ./lsfd -l > /dev/null 1.21s user 0.81s system 197% cpu 1.027 total sudo ./lsfd -l > /dev/null 1.22s user 0.79s system 199% cpu 1.005 total Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a500de34006e2af9c135b558f4ea0f4a9e0e84b5 Author: Masatake YAMATO Date: Sun May 9 12:16:43 2021 +0900 lsfd: introduce DEVNAME column and use it as default Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 1 + misc-utils/lsfd-cdev.c | 15 +++++++++++++++ misc-utils/lsfd-fifo.c | 7 +++++++ misc-utils/lsfd-file.c | 10 ++++++++++ misc-utils/lsfd-sock.c | 7 +++++++ misc-utils/lsfd-unkn.c | 15 +++++++++++++++ misc-utils/lsfd.c | 6 ++++-- misc-utils/lsfd.h | 1 + 8 files changed, 60 insertions(+), 2 deletions(-) commit 269c425f5b4b4ccb13c8773bbe7d3853d9d5a46b Author: Masatake YAMATO Date: Sun May 9 10:41:34 2021 +0900 lsfd: add a function to get the name of filesystem from a given minor number Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd.h | 2 ++ 2 files changed, 86 insertions(+) commit 5bced64c6645c5e427ffa152704ea7d97203cd85 Author: Masatake YAMATO Date: Sun May 9 11:36:07 2021 +0900 lsfd: add a stub for fifo type misc-utils/Makemodule.am | 3 ++- misc-utils/lsfd-fifo.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd.c | 3 ++- misc-utils/lsfd.h | 4 ++- 4 files changed, 71 insertions(+), 3 deletions(-) commit 903b4bec1afd4f0818f8abb56cb6a54d54e5f031 Author: Masatake YAMATO Date: Sat May 8 04:47:23 2021 +0900 lsfd: add MISCDEV column Signed-off-by: Masatake YAMATO misc-utils/lsfd-cdev.c | 13 +++++++++++++ misc-utils/lsfd.c | 2 ++ misc-utils/lsfd.h | 1 + 3 files changed, 16 insertions(+) commit e298d0ec932b1aa08933c85dbf1623e7ed07c566 Author: Masatake YAMATO Date: Sat May 8 04:46:11 2021 +0900 lsfd: read misc character device names from /proc/misc Signed-off-by: Masatake YAMATO misc-utils/lsfd-cdev.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++- misc-utils/lsfd.h | 1 + 2 files changed, 66 insertions(+), 1 deletion(-) commit 4e899f52611cdf9f04193cbfe454f56ffb423ed2 Author: Masatake YAMATO Date: Sat May 8 03:51:25 2021 +0900 lsfd: add CHRDRV column Signed-off-by: Masatake YAMATO misc-utils/lsfd-cdev.c | 10 ++++++++++ misc-utils/lsfd.c | 2 ++ misc-utils/lsfd.h | 1 + 3 files changed, 13 insertions(+) commit 12951df22ea1a6ed720372c599deb170dd33624b Author: Masatake YAMATO Date: Sat May 8 03:50:16 2021 +0900 lsfd: read character driver names from /proc/devices Signed-off-by: Masatake YAMATO misc-utils/lsfd-cdev.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd.h | 1 + 2 files changed, 77 insertions(+) commit b3a23f4d3a536101175390bd5d5899ae1468f5d1 Author: Masatake YAMATO Date: Sat May 8 03:28:46 2021 +0900 lsfd: add PARTITION column Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 9 +++++++++ misc-utils/lsfd-file.c | 8 ++++++++ misc-utils/lsfd.c | 2 ++ misc-utils/lsfd.h | 1 + 4 files changed, 20 insertions(+) commit 353151b005cb481276999bc9661474e2d8b9097f Author: Masatake YAMATO Date: Sat May 8 03:25:30 2021 +0900 lsfd: read /proc/partitions Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd.h | 2 ++ 2 files changed, 73 insertions(+) commit 5179d5282499319ca4e2888ffe425b2b17869491 Author: Masatake YAMATO Date: Sat May 8 01:50:20 2021 +0900 lsfd: introduce name_manager Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd.h | 10 ++++++++ 2 files changed, 80 insertions(+) commit cb6a617d9b9c93146d97e5c2251881dc26f3617d Author: Masatake YAMATO Date: Sun May 9 10:49:25 2021 +0900 lsfd: replace "socket:" in NAME of SOCKET with its protoname Signed-off-by: Masatake YAMATO misc-utils/lsfd-sock.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 2dfe2e4d1bb32f990fec987ddfc57e5f89d36971 Author: Masatake YAMATO Date: Fri May 7 03:57:45 2021 +0900 lsfd: add PROTONAME column Signed-off-by: Masatake YAMATO misc-utils/lsfd-sock.c | 53 ++++++++++++++++++++++++++++++++++++++++++++------ misc-utils/lsfd.c | 6 ++++-- misc-utils/lsfd.h | 4 +++- 3 files changed, 54 insertions(+), 9 deletions(-) commit 3638de3f427bfcef506e5bd657905a16b207c1fb Author: Masatake YAMATO Date: Fri May 7 03:57:03 2021 +0900 lsfd: allow passing a proc object to the constructors of the file classes Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit 602dbcd9a801a63ad15d00d62b4a53fe5e479b69 Author: Masatake YAMATO Date: Fri May 7 00:00:05 2021 +0900 lsfd: make username_cache lsfd-file privaite Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 17 +++++++++++++++++ misc-utils/lsfd.c | 11 ----------- misc-utils/lsfd.h | 3 --- 3 files changed, 17 insertions(+), 14 deletions(-) commit 4230e09ffc207ef3369c98994400800410767165 Author: Masatake YAMATO Date: Thu May 6 23:51:00 2021 +0900 lsfd: add the way to initialize and finalize classes Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 34 ++++++++++++++++++++++++++++++++++ misc-utils/lsfd.h | 2 ++ 2 files changed, 36 insertions(+) commit 14e16696ff352106e06679190ab4302017ed783d Author: Masatake YAMATO Date: Thu May 6 23:34:51 2021 +0900 lsfd: move file_class variants after their constructors Signed-off-by: Masatake YAMATO misc-utils/lsfd-bdev.c | 14 +++++++------- misc-utils/lsfd-cdev.c | 14 +++++++------- misc-utils/lsfd-sock.c | 14 +++++++------- misc-utils/lsfd-unkn.c | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) commit 5701c643386055c9aecb8442f2e5f2ea6ca30951 Author: Masatake YAMATO Date: Thu May 6 22:26:48 2021 +0900 lsfd: fill POS and MODE columns for SHM and MEM associated files /proc/$pid/maps files are used as the data sourecs. Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 20 ++++++++++++++------ misc-utils/lsfd.c | 6 ++++++ misc-utils/lsfd.h | 4 ++-- 3 files changed, 22 insertions(+), 8 deletions(-) commit 202a50e6cbc850ffbbaf29a64d7f658103cfe7ea Author: Masatake YAMATO Date: Thu May 6 22:19:11 2021 +0900 lsfd: introduce new association SHM representing shared file mapping MEM is kept for representing private file mapping. Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 1 + misc-utils/lsfd.c | 30 ++++++++++++++++++++++++++++-- misc-utils/lsfd.h | 3 ++- 3 files changed, 31 insertions(+), 3 deletions(-) commit ecfd869e7c5c88ba36ebcf7b96f6ed188fd4fc2d Author: Masatake YAMATO Date: Thu May 6 22:15:24 2021 +0900 lsfd: add code for reading /proc/$pid/maps Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) commit 18878c1ff930de464c9c2a737037b55626948d51 Author: Masatake YAMATO Date: Mon May 10 02:29:31 2021 +0900 lsfd: introduce fopenf helper function Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 14 ++++++++++++++ misc-utils/lsfd.h | 1 + 2 files changed, 15 insertions(+) commit 2da06d3cd0947ac504f6f5f2ab0f48bda54a7a18 Author: Masatake YAMATO Date: Thu May 6 15:10:49 2021 +0900 lsfd: add stubs for sockets and files of unknown type Signed-off-by: Masatake YAMATO misc-utils/Makemodule.am | 4 +++- misc-utils/lsfd-sock.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd-unkn.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd.c | 11 ++++++++-- misc-utils/lsfd.h | 6 +++++- 5 files changed, 129 insertions(+), 4 deletions(-) commit 26508d6325366a45494ffc1e20b74b0482cade84 Author: Masatake YAMATO Date: Thu May 6 14:54:27 2021 +0900 lsfd: simplify class hierarchy Signed-off-by: Masatake YAMATO misc-utils/Makemodule.am | 5 +-- misc-utils/{lsfd-bdev-file.c => lsfd-bdev.c} | 20 +++++----- misc-utils/{lsfd-cdev-file.c => lsfd-cdev.c} | 20 +++++----- misc-utils/lsfd-regular-file.c | 59 ---------------------------- misc-utils/lsfd.c | 6 +-- misc-utils/lsfd.h | 15 +++---- 6 files changed, 29 insertions(+), 96 deletions(-) commit 2f947be1eb5ce2ce8a366f2fc9ee2dcac693db9c Author: Masatake YAMATO Date: Thu May 6 14:45:11 2021 +0900 lsfd: replace POS with MNT_ID in default column set Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 17adf20f126914e2c3f83523d2761ec53e3a9360 Author: Masatake YAMATO Date: Thu May 6 14:29:43 2021 +0900 lsfd: add MODE column Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 8 ++++++++ misc-utils/lsfd.c | 9 ++++++++- misc-utils/lsfd.h | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) commit 22b7cf51cc36cf72988bedbe3d4275adfe0033bd Author: Masatake YAMATO Date: Thu May 6 14:28:58 2021 +0900 lsfd: add FLAGS, MNTID, and POS columns Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd.c | 12 +++-- misc-utils/lsfd.h | 6 +++ 3 files changed, 145 insertions(+), 4 deletions(-) commit 19299584e98cab5bc5b5caec36fd30a4f1d13c1c Author: Masatake YAMATO Date: Thu May 6 14:25:56 2021 +0900 lsfd: add infrstructure code for reading fdinfo files Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++------ misc-utils/lsfd.h | 1 + 2 files changed, 60 insertions(+), 7 deletions(-) commit 3d4b926a40b4ef7a08164d661c9fea8a055600e7 Author: Masatake YAMATO Date: Wed May 5 03:37:57 2021 +0900 lsfd: don't collect and print redundant information about threads Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ misc-utils/lsfd.h | 4 ++-- 2 files changed, 48 insertions(+), 8 deletions(-) commit 6008b460cb18756eed1aad093a4fd4a9ad085b83 Author: Masatake YAMATO Date: Wed May 5 01:47:49 2021 +0900 lsfd: support threads with -l option -t and -T are reserved for ffiltering feature. Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 3 ++ misc-utils/lsfd.c | 88 ++++++++++++++++++++++++++++++++++++++++++-------- misc-utils/lsfd.h | 2 ++ 3 files changed, 80 insertions(+), 13 deletions(-) commit d754885aa6ba51df58e7dd3dfe1223b6f698f035 Author: Masatake YAMATO Date: Wed May 5 03:36:09 2021 +0900 lsfd: print the owner of process as USER Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 6 +++--- misc-utils/lsfd.c | 10 ++++++++++ misc-utils/lsfd.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) commit bc7f865abb76491ea9c612dee3981eb48dca5335 Author: Masatake YAMATO Date: Wed May 5 02:50:51 2021 +0900 lsfd: adjust column width for COMMAND Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6fab1215879143f1d9f1be7615cfff23a0bf1d9a Author: Masatake YAMATO Date: Mon May 3 16:22:29 2021 +0900 lsfd: add NLINK and DELETED columns Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 6 ++++++ misc-utils/lsfd.c | 4 ++++ misc-utils/lsfd.h | 2 ++ 3 files changed, 12 insertions(+) commit bec8c27141dd9de9bd44f19ec390750396b9cccc Author: Masatake YAMATO Date: Mon May 3 15:59:26 2021 +0900 lsfd: add columns for SIZE Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 3 +++ misc-utils/lsfd.c | 3 +++ misc-utils/lsfd.h | 1 + 3 files changed, 7 insertions(+) commit 61fe7350657b4d98dfed58d3990bbd6f9d22b549 Author: Masatake YAMATO Date: Mon May 3 15:47:02 2021 +0900 lsfd: give column widths Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit b7b6e261a3db17736e9e2173c654cc2ed5ae29c7 Author: Masatake YAMATO Date: Mon May 3 15:45:47 2021 +0900 lsfd: specify column more declarative way Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) commit fd4fe429ebe3ac9d357415e8bee8e5d7050c8513 Author: Masatake YAMATO Date: Mon May 3 15:33:56 2021 +0900 lsfd: declare JSON type in colinfo entries Signed-off-by: Masatake YAMATO misc-utils/lsfd.c | 60 +++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 33 deletions(-) commit 15b4715726708b6ad212d9cb2a475e74935a3933 Author: Masatake YAMATO Date: Sat May 1 20:59:51 2021 +0900 lsfd: add columns for DEV and RDEV Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 6 ++++++ misc-utils/lsfd.c | 5 +++-- misc-utils/lsfd.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) commit 1478549077eedbb20f584c88cfbfabb988c2630d Author: Masatake YAMATO Date: Sat Apr 17 07:38:48 2021 +0900 lsfd: refactor code calling collect_outofbox_files misc-utils/lsfd.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) commit 7388e0b3594febd73c2495a5c020bec954fa6df4 Author: Masatake YAMATO Date: Sat Apr 17 07:33:07 2021 +0900 lsfd: add mem associations misc-utils/lsfd-file.c | 2 +- misc-utils/lsfd.c | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) commit f1d0b0bbc2a01a4781c24a069b967f26110eb941 Author: Masatake YAMATO Date: Sat Apr 17 07:15:50 2021 +0900 lsfd: add namespace related associations Signed-off-by: Masatake YAMATO misc-utils/lsfd-file.c | 11 +++++++++ misc-utils/lsfd.c | 60 +++++++++++++++++++++++++++++++++++++++++--------- misc-utils/lsfd.h | 11 +++++++++ 3 files changed, 71 insertions(+), 11 deletions(-) commit a4778cb5f35150f7c983945cefffc09020139bdf Author: Masatake YAMATO Date: Sat Apr 17 06:50:00 2021 +0900 lsfd: add cwd, exe, and root associations Signed-off-by: Masatake YAMATO misc-utils/lsfd-cdev-file.c | 2 +- misc-utils/lsfd-file.c | 19 +++++++++-- misc-utils/lsfd.c | 82 +++++++++++++++++++++++++++++++++++++-------- misc-utils/lsfd.h | 7 ++++ 4 files changed, 93 insertions(+), 17 deletions(-) commit 2ac344fba8aaccbbf28a392a1e4fa8e1d0ec4e80 Author: Masatake YAMATO Date: Sat Apr 17 05:49:58 2021 +0900 lsfd: purge fd layer misc-utils/Makemodule.am | 7 +-- .../{lsfd-bdev-fd-file.c => lsfd-bdev-file.c} | 24 ++++---- .../{lsfd-cdev-fd-file.c => lsfd-cdev-file.c} | 26 ++++---- misc-utils/lsfd-fd-file.c | 70 ---------------------- misc-utils/lsfd-file.c | 17 +++++- ...{lsfd-regular-fd-file.c => lsfd-regular-file.c} | 26 ++++---- misc-utils/lsfd.c | 10 ++-- misc-utils/lsfd.h | 22 +++---- 8 files changed, 68 insertions(+), 134 deletions(-) commit 4c812bc911ed4b2c159ab41544c25c3145d63d4b Author: Masatake YAMATO Date: Sun Mar 28 06:23:24 2021 +0900 lsfd: fill ASSOC field misc-utils/lsfd-fd-file.c | 16 ++++++++++------ misc-utils/lsfd.c | 4 +++- misc-utils/lsfd.h | 1 + 3 files changed, 14 insertions(+), 7 deletions(-) commit 6ada35230d9574098e38b3b0bb4587d9fb705ff6 Author: Masatake YAMATO Date: Sun Mar 28 06:22:50 2021 +0900 lsfd: fill DEVICE field misc-utils/Makemodule.am | 4 ++- misc-utils/lsfd-bdev-fd-file.c | 68 ++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd-cdev-fd-file.c | 68 ++++++++++++++++++++++++++++++++++++++++++ misc-utils/lsfd-fd-file.c | 5 +--- misc-utils/lsfd-file.c | 5 ++++ misc-utils/lsfd.c | 11 +++++-- misc-utils/lsfd.h | 8 ++++- 7 files changed, 161 insertions(+), 8 deletions(-) commit fb0cd93cead9d256f685e41e3b248b23a2825de3 Author: Masatake YAMATO Date: Fri Mar 26 17:26:18 2021 +0900 lsfd: fill INODE field misc-utils/lsfd-file.c | 3 +++ misc-utils/lsfd.c | 9 +++++---- misc-utils/lsfd.h | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) commit 1deac7dbb4cec9c49654364b72cf15ffa675a567 Author: Masatake YAMATO Date: Fri Mar 26 16:55:57 2021 +0900 lsfd: fill USER field misc-utils/lsfd-file.c | 7 +++++++ misc-utils/lsfd.c | 16 +++++++++++++++- misc-utils/lsfd.h | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) commit 64fddd621495638b4cc4c16ac8c5b4c9e8422c60 Author: Masatake YAMATO Date: Fri Mar 26 16:31:31 2021 +0900 lsfd: refactor misc-utils/lsfd-file.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) commit 0472946175f845060d2170b3288dde29dbe61c66 Author: Masatake YAMATO Date: Fri Mar 26 02:56:28 2021 +0900 lsfd: fill UID field misc-utils/lsfd-file.c | 7 +++++++ misc-utils/lsfd.c | 17 ++++++++++++----- misc-utils/lsfd.h | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) commit 600e6e5257ffa59c809aae66c024fbd5a026aa0e Author: Masatake YAMATO Date: Thu Mar 25 07:42:15 2021 +0900 lsfd: fill TYPE field misc-utils/Makemodule.am | 6 +- misc-utils/lsfd-fd-file.c | 69 ++++++++++++++++ misc-utils/lsfd-file.c | 110 +++++++++++++++++++++++++ misc-utils/lsfd-regular-fd-file.c | 59 ++++++++++++++ misc-utils/lsfd.c | 165 +++----------------------------------- misc-utils/lsfd.h | 107 ++++++++++++++++++++++++ 6 files changed, 360 insertions(+), 156 deletions(-) commit 128beb71ce85f212e86d31db505c042ee7873df4 Author: Masatake YAMATO Date: Wed Mar 24 03:43:51 2021 +0900 lsfd: initial commit .gitignore | 1 + configure.ac | 4 + misc-utils/Makemodule.am | 10 + misc-utils/lsfd.c | 676 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 691 insertions(+) commit 2ae8b75754c990bd9bb81ef644770b561c8792bb Author: Karel Zak Date: Tue Oct 5 10:53:13 2021 +0200 more: fix -e in non-interactive mode Signed-off-by: Karel Zak text-utils/more.1.adoc | 2 +- text-utils/more.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) commit 298a9eaf659bdddff7145e9f800b3a0b712fc0a2 Author: Vojtěch Eichler Date: Mon Oct 4 16:46:22 2021 +0200 tests: split test into subtest tests/expected/col/io | 238 ---------------------------------- tests/expected/col/io-allocate-here | 2 + tests/expected/col/io-cr | 1 + tests/expected/col/io-cs-alternate | 1 + tests/expected/col/io-cs-normal | 2 + tests/expected/col/io-esc-backspace | 1 + tests/expected/col/io-esc-tab | 2 + tests/expected/col/io-flushing | 199 ++++++++++++++++++++++++++++ tests/expected/col/io-half-line | 2 + tests/expected/col/io-reverse-lf | 2 + tests/expected/col/io-so-si | 0 tests/expected/col/io-tab-backspace | 1 + tests/expected/col/io-trailing-spaces | 2 + tests/expected/col/io-various-spaces | 1 + tests/expected/col/io-vt1 | 3 + tests/expected/col/io-vt2 | 5 + tests/ts/col/io | 45 ++++--- 17 files changed, 254 insertions(+), 253 deletions(-) commit 08273c672b105602e1a9031160ccefec171b02ed Author: Karel Zak Date: Mon Oct 4 15:39:40 2021 +0200 su: reset also RLIMIT_FSIZE and RLIMIT_NOFILE Addresses: https://github.com/linux-pam/linux-pam/issues/85 Signed-off-by: Karel Zak login-utils/su-common.c | 14 ++++++++++++++ login-utils/su.1.adoc | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) commit c3ea860b9ff8d3ebea93acdde80e8627b16b6865 Author: Jeff Layton Date: Fri Oct 1 08:25:53 2021 -0400 mount.8.adoc: note that mandatory locking is fully deprecated in Linux 5.15 Cc: Jan Kara Signed-off-by: Jeff Layton sys-utils/mount.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1e01704bbcdf74d39bd770c6bf1f437674085c8c Author: Karel Zak Date: Mon Oct 4 11:14:01 2021 +0200 fstrim: fix typo Addresses: https://github.com/karelzak/util-linux/issues/1463 Signed-off-by: Karel Zak sys-utils/fstrim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 67f974d41d62c8b521fe81e1aac92562366f6a0a Author: Karel Zak Date: Mon Oct 4 11:14:01 2021 +0200 fstrim: don't trigger autofs - ignore read-only entries - ignore autofs entries (for example from /proc/self/mountinfo) - ignore autofs mountpoints where automounter has not been triggered yet Fixes: https://github.com/karelzak/util-linux/issues/1463 Signed-off-by: Karel Zak sys-utils/fstrim.8.adoc | 2 +- sys-utils/fstrim.c | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) commit b47dbe6156696ee6e6da10f48841a7d88c444e7f Author: Vojtěch Eichler Date: Fri Oct 1 16:54:11 2021 +0200 tests: split cal/colorw test into subtests tests/expected/cal/colorw | 55 ---------------------- tests/expected/cal/colorw-first-day-week-numbers | 8 ++++ tests/expected/cal/colorw-last-day-week-numbers | 8 ++++ .../colorw-reformation-corner-cases-1-week-numbers | 8 ++++ .../colorw-reformation-corner-cases-2-week-numbers | 8 ++++ .../colorw-reformation-corner-cases-3-week-numbers | 8 ++++ .../colorw-reformation-corner-cases-4-week-numbers | 8 ++++ tests/ts/cal/colorw | 21 +++++---- 8 files changed, 60 insertions(+), 64 deletions(-) commit 1f2a2925be220d1ab090a82f3fe5e9c227418a5f Author: Vojtěch Eichler Date: Fri Oct 1 15:56:35 2021 +0200 tests: split cal/color test into subtests tests/expected/cal/color | 55 ---------------------- tests/expected/cal/color-first-day | 8 ++++ tests/expected/cal/color-last-day | 8 ++++ .../expected/cal/color-reformation-corner-cases-1 | 8 ++++ .../expected/cal/color-reformation-corner-cases-2 | 8 ++++ .../expected/cal/color-reformation-corner-cases-3 | 8 ++++ .../expected/cal/color-reformation-corner-cases-4 | 8 ++++ tests/ts/cal/color | 20 ++++---- 8 files changed, 60 insertions(+), 63 deletions(-) commit e549619122b62b587b5aeb1b2ba3ca565010dc6d Author: Karel Zak Date: Fri Oct 1 14:59:50 2021 +0200 su: reset RLIMIT_{NICE,RTPRIO} to zero Addresses: https://github.com/linux-pam/linux-pam/issues/85 Reported-by: Lennart Poettering Signed-off-by: Karel Zak login-utils/runuser.1.adoc | 2 ++ login-utils/su-common.c | 17 +++++++++++++++++ login-utils/su.1.adoc | 2 ++ 3 files changed, 21 insertions(+) commit 3d6a3d6d2aa91a441a4c97133db78bce3989a6e3 Author: Karel Zak Date: Fri Oct 1 14:47:04 2021 +0200 prlimit: improve --help output Signed-off-by: Karel Zak sys-utils/prlimit.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit df6b29d3b8e9a55d2bfa69c593e17da4d11a3fac Author: Ian Jones Date: Wed Sep 29 14:50:14 2021 +0200 more: POSIX compliance patch preventing exit on EOF without -e [kzak@redhat.com: - merge all patches to one commit, - improve prompt for non-tty stdin] Signed-off-by: Karel Zak text-utils/more.1.adoc | 3 +++ text-utils/more.c | 31 +++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) commit 0f246b73e268719446cf961d427eb123a2a34e97 Author: Karel Zak Date: Mon Sep 27 15:40:11 2021 +0200 fallocate: add verbose messages Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2003927 Signed-off-by: Karel Zak sys-utils/fallocate.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) commit 145d42e91d2b8dc5d1c01fda4a5b71d8e051925c Author: Eduard Bloch Date: Mon Sep 27 09:08:12 2021 +0200 hardlink: use more passive wording in hardlink.1 And fix "same (basename)". Signed-off-by: Eduard Bloch misc-utils/hardlink.1.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 722762b6172f4d115497b866c4e06f762f12d12f Author: Eduard Bloch Date: Mon Sep 27 09:07:23 2021 +0200 Let user choose larger buffers for IO reading Simultaneous reading of multiple files through a small one-page buffer is slow with classic HDDs. Let the user improve it by chosing buffers of several mebibytes if needed. [kzak@redhat.com: - tiny changes to coding style - mark buffers static - use xalloc.h] Signed-off-by: Eduard Bloch Signed-off-by: Karel Zak misc-utils/hardlink.1.adoc | 6 ++++++ misc-utils/hardlink.c | 45 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 6 deletions(-) commit 0647bbe519d2b526774f38bfd3e8023254a42e55 Author: Karel Zak Date: Mon Sep 27 12:49:01 2021 +0200 setterm: (man) improve dosc about optional arguments Fixes: https://github.com/karelzak/util-linux/issues/1457 Signed-off-by: Karel Zak term-utils/setterm.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 433e4b77bac97b7d23678065a980fe9b3b458b41 Author: Karel Zak Date: Fri Sep 24 15:52:07 2021 +0200 meson: fix typo Addresses: https://github.com/karelzak/util-linux/issues/1442 Signed-off-by: Karel Zak meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dff176e2f04c67bf8f4fc1800bd750dca17abeae Author: Karel Zak Date: Thu Sep 23 14:09:35 2021 +0200 meson: make raw(7) optional Fixes: https://github.com/karelzak/util-linux/issues/1442 Signed-off-by: Karel Zak meson.build | 4 +++- meson_options.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) commit 0c19e4ca613a66c7085f9470df44509a0c2c4ddb Author: Karel Zak Date: Thu Sep 23 13:11:16 2021 +0200 test_mount_optstr: use xstrdup() Fixes: https://github.com/karelzak/util-linux/issues/1434 Signed-off-by: Karel Zak libmount/src/optstr.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) commit 8b3d8aad5dcacd7158a91c39a2bffb5b2f26129a Author: Karel Zak Date: Thu Sep 23 13:08:32 2021 +0200 lib/env: don't ignore failed malloc Fixes: https://github.com/karelzak/util-linux/issues/1434 Signed-off-by: Karel Zak lib/env.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 54ef08ed37acce099035cc6da7a3bdce63b00e3a Author: Karel Zak Date: Thu Sep 23 11:53:26 2021 +0200 mkswap: support -U {clear,random,time,uuid} Let's follow -U from mkfs.ext4 and make it easy to fully control UUIDs for the swap area. Fixes: https://github.com/karelzak/util-linux/issues/1453 Signed-off-by: Karel Zak disk-utils/mkswap.8.adoc | 11 ++++++++++- disk-utils/mkswap.c | 9 ++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) commit 10fd91d389497d8be435cc66abbdeb2eb6ea2f07 Merge: 5be4d4670 6dc362903 Author: Karel Zak Date: Thu Sep 23 11:15:31 2021 +0200 Merge branch 'int/alex/hifive_uuid' of https://github.com/AlexGhiti/util-linux * 'int/alex/hifive_uuid' of https://github.com/AlexGhiti/util-linux: include: Rename HiFive partition UUIDs commit 5be4d46706b3544272d1a6d97328db8b402989b2 Merge: 79534c0d7 e67432390 Author: Karel Zak Date: Thu Sep 23 11:12:10 2021 +0200 Merge branch 'master' of https://github.com/mariobl/util-linux * 'master' of https://github.com/mariobl/util-linux: Man pages: Fix end extend formatting commit 79534c0d7e0fdb52b090479f87ccc0870c993efe Author: Karel Zak Date: Thu Sep 23 11:07:55 2021 +0200 mount: add hint about dmesg(8) to error messages Fixes: https://github.com/karelzak/util-linux/pull/1444 Signed-off-by: Karel Zak sys-utils/mount.c | 4 ++++ 1 file changed, 4 insertions(+) commit 6dc36290326c3ec487e2bcd94b4b0b32b71053ca Author: Alexandre Ghiti Date: Wed Sep 22 06:38:14 2021 +0200 include: Rename HiFive partition UUIDs Both HiFive Unleashed and HiFive Unmatched bootloaders seek for the same UUIDs to load the next stage bootloader: the current name makes partitions on Unmatched board appear as 'Unleashed'. Fix that by removing the 'Unleashed' part of the current naming so it fits both. Signed-off-by: Alexandre Ghiti include/pt-gpt-partnames.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit e6743239042cc051afdf972a68b87eff71a302f8 Author: Mario Blättermann Date: Tue Sep 21 20:48:11 2021 +0200 Man pages: Fix end extend formatting disk-utils/cfdisk.8.adoc | 2 +- disk-utils/fdisk.8.adoc | 8 ++++---- disk-utils/mkswap.8.adoc | 4 ++-- disk-utils/partx.8.adoc | 2 +- disk-utils/raw.8.adoc | 2 +- disk-utils/sfdisk.8.adoc | 14 +++++++------- lib/terminal-colors.d.5.adoc | 6 +++--- libuuid/man/uuid_generate.3.adoc | 2 +- login-utils/last.1.adoc | 2 +- login-utils/runuser.1.adoc | 2 +- login-utils/su.1.adoc | 8 +++++--- misc-utils/blkid.8.adoc | 2 +- misc-utils/findmnt.8.adoc | 16 ++++++++-------- misc-utils/hardlink.1.adoc | 2 +- misc-utils/kill.1.adoc | 4 ++-- misc-utils/lsblk.8.adoc | 12 ++++++------ misc-utils/uuidd.8.adoc | 2 +- misc-utils/whereis.1.adoc | 2 +- misc-utils/wipefs.8.adoc | 2 +- sys-utils/blkdiscard.8.adoc | 2 +- sys-utils/eject.1.adoc | 2 +- sys-utils/fallocate.1.adoc | 4 ++-- sys-utils/flock.1.adoc | 4 ++-- sys-utils/fsfreeze.8.adoc | 2 +- sys-utils/fstrim.8.adoc | 2 +- sys-utils/hwclock.8.adoc | 2 +- sys-utils/losetup.8.adoc | 6 +++--- sys-utils/mount.8.adoc | 12 ++++++------ sys-utils/mountpoint.1.adoc | 2 +- sys-utils/prlimit.1.adoc | 4 ++-- sys-utils/swapon.8.adoc | 10 +++++----- sys-utils/umount.8.adoc | 18 +++++++++--------- term-utils/scriptlive.1.adoc | 2 +- text-utils/column.1.adoc | 2 +- text-utils/hexdump.1.adoc | 2 +- 35 files changed, 86 insertions(+), 84 deletions(-) commit 256e524f5779629aaeba1e071b50ab1fc66d7c07 Author: Mario Blättermann Date: Tue Sep 21 10:48:37 2021 +0200 mount.8.adoc: fix misformatting Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit dd14f95b9b037213ad797e68aa1f56517239cce2 Author: Michael Kerrisk Date: Thu Sep 9 02:08:28 2021 +0200 unshare.1.adoc: Improve wording re creation of bind mounts Use consistent wording for the options that create bind mounts, and improve the wording. Signed-off-by: Michael Kerrisk sys-utils/unshare.1.adoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 841fc3a26cafcaf667adbc56d944f52676a1a46f Author: Michael Kerrisk Date: Thu Sep 9 02:08:27 2021 +0200 unshare.1.adoc: Improve wording re namespace creation The terminonoly "unshare the namespace" is not very helpful. Instead, use wording that explains what these options actually fo: "create a new namespace". Signed-off-by: Michael Kerrisk sys-utils/unshare.1.adoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 80ed8688d1536d98505510954227752f6ccc8a37 Author: Karel Zak Date: Thu Sep 16 13:25:07 2021 +0200 github: add meson build target Signed-off-by: Karel Zak .github/workflows/cibuild-setup-ubuntu.sh | 1 + .github/workflows/cibuild.sh | 6 ++++++ .github/workflows/cibuild.yml | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) commit aa57994f739c5fee2472c86314ee38504d36919f Merge: f45c81800 00b8a51f8 Author: Karel Zak Date: Thu Sep 16 13:07:05 2021 +0200 Merge branch 'meson-fixes' of https://github.com/Hello71/util-linux * 'meson-fixes' of https://github.com/Hello71/util-linux: meson: make asciidoc optional meson: fix building libsmartcols meson: fix building logger commit f45c8180046fee206d727f0e68cb6eee464ba596 Author: Karel Zak Date: Thu Sep 16 12:50:01 2021 +0200 dmesg: translate ctime strings Let's make the date-time strings accessible for translators. Fixes: https://github.com/karelzak/util-linux/issues/1451 Signed-off-by: Karel Zak sys-utils/dmesg.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 02f859392754038f383dabeb32effec4ae1f02ba Author: Karel Zak Date: Thu Sep 16 12:20:25 2021 +0200 logger: fix --prio-prefix doesn't use --priority default The commit b9ef27f have added priority check, but it introduced regression as the default priority (as specified by --priority) is ignored. This patch fixes this problem, but it also removes extra check for "kern facility", it's unnecessary and inconsistent with the rest of logger. Fixes: https://github.com/karelzak/util-linux/issues/1450 Signed-off-by: Karel Zak misc-utils/logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4ba84b0aed7869005f2add18e04632271a171eb3 Author: Karel Zak Date: Thu Sep 16 12:15:56 2021 +0200 logger: dealloc login name Signed-off-by: Karel Zak misc-utils/logger.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 8e455177feb7f7ec2294c8f641aa93a06fd02ca5 Merge: 5fe1d1e89 d53346ed0 Author: Karel Zak Date: Thu Sep 16 11:32:57 2021 +0200 Merge branch 'losetup-direct-dio' of https://github.com/Hello71/util-linux * 'losetup-direct-dio' of https://github.com/Hello71/util-linux: losetup: directly set dio instead of afterwards commit 5fe1d1e89b5b38e284c632579e81c6477aa27c3d Merge: bc75fb472 e5e0eac42 Author: Karel Zak Date: Thu Sep 16 11:00:33 2021 +0200 Merge branch 'more-shell-execution' of https://github.com/ritikrajdev/util-linux * 'more-shell-execution' of https://github.com/ritikrajdev/util-linux: more - Bug Resolve - new line separated command execution commit bc75fb4729782e135240eab5501d188040d5d196 Merge: 78001b7af 635fd4af5 Author: Karel Zak Date: Thu Sep 16 10:51:27 2021 +0200 Merge branch 'refactor-tests' of https://github.com/Ajchler/util-linux * 'refactor-tests' of https://github.com/Ajchler/util-linux: tests: use subtests tests: make use of subtests commit e5e0eac42c55b007766221e1971fceda3a64bb08 Author: ritikrajdev Date: Tue Sep 14 04:27:14 2021 +0530 more - Bug Resolve - new line separated command execution text-utils/more.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 635fd4af54690b988111e46a01587f56841773d5 Author: Vojtěch Eichler Date: Mon Sep 13 10:59:59 2021 +0200 tests: use subtests tests/expected/ipcs/headers | 64 ------------------------------- tests/expected/ipcs/headers-all-headers | 35 +++++++++++++++++ tests/expected/ipcs/headers-mesg-headers | 8 ++++ tests/expected/ipcs/headers-sem-headers | 6 +++ tests/expected/ipcs/headers-shm-headers | 8 ++++ tests/ts/ipcs/headers | 66 ++++++++++++++++---------------- 6 files changed, 90 insertions(+), 97 deletions(-) commit d53346ed082db8717df7a76d2df9fd657d3e23e9 Author: Alex Xu (Hello71) Date: Thu Sep 9 09:55:03 2021 -0400 losetup: directly set dio instead of afterwards This avoids an extra syscall, and allows the kernel to automatically set block size [0], avoiding unnecessary failure with 4096-byte devices. This changes the observable behavior of losetup --direct-io in the case where DIO is not supported to fully fail, instead of creating a non-direct-io device. If the user explicitly specifies --direct-io, then they should get either a DIO loopdev or no loopdev, not a non-DIO loopdev and a misleading error. Additionally, loopcxt_setup_device now uses O_CLOEXEC in the read-only fallback. [0] https://github.com/torvalds/linux/commit/85560117d00f5d528e928918b8f61cadcefff98b lib/loopdev.c | 10 +++++++--- sys-utils/losetup.c | 5 ++--- 2 files changed, 9 insertions(+), 6 deletions(-) commit 99120a8bded6493a27d7dce7f51704fb3e9e54e3 Author: Vojtěch Eichler Date: Wed Sep 8 12:36:19 2021 +0200 tests: make use of subtests tests/expected/mount/fstab-devname | 1 - tests/expected/mount/fstab-label | 1 - tests/expected/mount/fstab-label2devname | 1 - tests/expected/mount/fstab-label2uuid | 1 - tests/expected/mount/fstab-uuid | 1 - tests/expected/mount/fstab-uuid2devname | 1 - tests/expected/mount/fstab-uuid2label | 1 - tests/expected/mount/label | 1 - tests/expected/mount/uuid | 1 - tests/ts/mount/fstab-devname | 20 ++++++++++++-------- tests/ts/mount/fstab-label | 28 ++++++++++++++-------------- tests/ts/mount/fstab-label2devname | 22 ++++++++++++---------- tests/ts/mount/fstab-label2uuid | 21 ++++++++++++--------- tests/ts/mount/fstab-uuid | 27 +++++++++++++++------------ tests/ts/mount/fstab-uuid2devname | 21 ++++++++++++--------- tests/ts/mount/fstab-uuid2label | 22 ++++++++++++---------- tests/ts/mount/label | 19 ++++++++++--------- tests/ts/mount/uuid | 19 ++++++++++--------- 18 files changed, 109 insertions(+), 99 deletions(-) commit 00b8a51f88b539e317a437bbbf847ce9101502bd Author: Alex Xu (Hello71) Date: Tue Sep 7 18:58:48 2021 -0400 meson: make asciidoc optional it should be under an option like autoconf, but cba to do that now, and this is an improvement over the status quo. meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 231c2ffb9a5ce44193ebcab0c5c9d92ac5430066 Author: Alex Xu (Hello71) Date: Tue Sep 7 18:58:32 2021 -0400 meson: fix building libsmartcols libsmartcols/meson.build | 1 - 1 file changed, 1 deletion(-) commit dbb9999fead6a82d17afb494e587ce75573ac49f Author: Alex Xu (Hello71) Date: Tue Sep 7 18:58:16 2021 -0400 meson: fix building logger meson.build | 2 ++ 1 file changed, 2 insertions(+) commit 78001b7af36f685265e21feaf384a4be12118c64 Merge: bcfa32d71 a283ad4ed Author: Karel Zak Date: Tue Sep 7 12:30:15 2021 +0200 Merge branch 'master' of https://github.com/yugart/util-linux * 'master' of https://github.com/yugart/util-linux: Fix memory leaks in the chcpu commit bcfa32d7144a5f374137bdd96de59cb2ca6b6593 Author: Karel Zak Date: Tue Sep 7 12:27:54 2021 +0200 eject: fix typo in docs Fixes: https://github.com/karelzak/util-linux/issues/1436 Signed-off-by: Karel Zak sys-utils/eject.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a283ad4ed27b19da176e75d4bec521dea067fedc Author: jiazhenyuan Date: Mon Sep 6 16:50:27 2021 +0800 Fix memory leaks in the chcpu sys-utils/chcpu.c | 1 + 1 file changed, 1 insertion(+) commit 0e85613e3a519cbef68f0b47b8975f60e176f54b Author: Rafael Fontenelle Date: Sat Sep 4 11:11:04 2021 -0300 Fix misspellings Documentation/TODO | 2 +- Documentation/howto-contribute.txt | 2 +- include/buffer.h | 2 +- lib/strutils.c | 2 +- libblkid/src/blkidP.h | 2 +- libblkid/src/superblocks/btrfs.c | 2 +- libmount/src/optstr.c | 2 +- sys-utils/lscpu-cputype.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) commit c83a52f03f3e9796a2454e6adb48c82cd70806d5 Author: Rafael Fontenelle Date: Thu Sep 2 10:20:35 2021 -0300 docs: Uniformize references to section titles Wrap section title references with asterisks, and prioritize 'see the *TITLE* section' over 'see section TITLE'. disk-utils/cfdisk.8.adoc | 2 +- disk-utils/sfdisk.8.adoc | 2 +- lib/terminal-colors.d.5.adoc | 4 ++-- login-utils/login.1.adoc | 2 +- misc-utils/blkid.8.adoc | 2 +- misc-utils/cal.1.adoc | 2 +- misc-utils/getopt.1.adoc | 4 ++-- misc-utils/look.1.adoc | 2 +- sys-utils/lsmem.1.adoc | 2 +- sys-utils/mount.8.adoc | 4 ++-- sys-utils/prlimit.1.adoc | 2 +- sys-utils/rfkill.8.adoc | 2 +- sys-utils/unshare.1.adoc | 2 +- term-utils/agetty.8.adoc | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) commit 597ccb7bf564f65bb059bfe420224cab0fba46ac Author: Chris Hofstaedtler Date: Fri Aug 20 10:30:50 2021 +0000 tests: Skip lsns/ioctl_ns test if unshare fails Some parts of the Debian build infrastructure uses unshare to run the package build, and that appears to cause a "nested" unshare in the lsns/ioctl_ns test to fail. Unfortunately the tests then hang at this point. Try running unshare before the actual test, and skip the test if unshare already fails. [kzak@redhat.com: - add --fork to the test - don't write to stdout/err] Signed-off-by: Chris Hofstaedtler Signed-off-by: Karel Zak tests/ts/lsns/ioctl_ns | 2 ++ 1 file changed, 2 insertions(+) commit 059811d096f0051d911f884d47ebc6147630990a Author: Karel Zak Date: Tue Aug 31 12:51:40 2021 +0200 su: (bash-completion) offer usernames rather than files Fixes: https://github.com/karelzak/util-linux/issues/1424 Signed-off-by: Karel Zak bash-completion/su | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9714331843ef3a6d9c10ff1d3bc5fcf53d44d930 Author: Karel Zak Date: Tue Aug 31 12:31:15 2021 +0200 column: segmentation fault on invalid unicode input passed to -s option The function mbs_to_wcs() returns NULL on invalid UTF. Fixes: https://github.com/karelzak/util-linux/issues/1425 Signed-off-by: Karel Zak text-utils/column.c | 2 ++ 1 file changed, 2 insertions(+) commit 4693a1bba9c769080d721350a87737e116d845ca Merge: f362b6c0e 9c59b604d Author: Karel Zak Date: Tue Aug 31 12:26:00 2021 +0200 Merge branch 'bug/1416' of https://github.com/V-Smeets/util-linux * 'bug/1416' of https://github.com/V-Smeets/util-linux: Erase line before writing the filename commit f362b6c0ea2f7052cd5f42bf60e2c61e492fd86e Merge: 2987dddca 5f618ca4b Author: Karel Zak Date: Tue Aug 31 12:08:38 2021 +0200 Merge branch 'patch-2' of https://github.com/rffontenelle/util-linux * 'patch-2' of https://github.com/rffontenelle/util-linux: asciidoc: unconstrained formatting pair in fdisk commit 2987dddca6c58ed0054f6b9316a3ea556b676266 Merge: e46f9fce3 e3668f436 Author: Karel Zak Date: Tue Aug 31 12:07:34 2021 +0200 Merge branch 'patch-1' of https://github.com/rffontenelle/util-linux * 'patch-1' of https://github.com/rffontenelle/util-linux: asciidoc: fix quoted message in fsck.minix commit e46f9fce3035f5e7ea7c51b1d427ef114e9efb09 Author: Karel Zak Date: Tue Aug 31 11:57:30 2021 +0200 tests: use sub-tests for dm-verity * write error to the test log file rather than on stdout * use sub-tests to get more info on output * don't use ts_die in sub-tests to make sure we call final dmsetup remove Signed-off-by: Karel Zak tests/expected/mount/dm-verity | 1 - tests/ts/mount/dm-verity | 24 +++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) commit 688edfc15b9d0ed4764f774aafecd1abc4ac9fa5 Author: Karel Zak Date: Tue Aug 31 11:40:45 2021 +0200 tests: check for dm-verity support Signed-off-by: Karel Zak tests/ts/mount/dm-verity | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 8edd055f41e26692e98d6b3af31a0dc9ca4b4790 Author: Vojtěch Eichler Date: Fri Aug 27 10:48:27 2021 +0200 tests: add tests for dm-verity support in mount tests/expected/mount/dm-verity | 1 + tests/ts/mount/dm-verity | 64 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) commit 68d7dc7b46943994b042b12351e6106acfcda96d Author: Karel Zak Date: Tue Aug 31 11:02:26 2021 +0200 docs: add hint about TP Addresses: https://github.com/karelzak/util-linux/issues/1421 Signed-off-by: Karel Zak Documentation/howto-contribute.txt | 4 ++++ 1 file changed, 4 insertions(+) commit e72528403ecfc38d72364c9a1c031f830b047847 Author: Naohiro Aota Date: Mon Aug 30 14:52:57 2021 +0900 lsblk: add zoned columns to "lsblk -z" Add zoned columns to the "-z" option as follow. $ lsblk -z -i NAME ZONED ZONE-SZ ZONE-NR ZONE-AMAX ZONE-OMAX ZONE-APP ZONE-WGRAN sda host-managed 256M 55880 0 128 672K 4K sdb host-managed 256M 55880 0 128 672K 4K zram0 none 0B 0 0 0 0B 0B nvme2n1 none 0B 0 0 0 0B 0B |-nvme2n1p1 none 0B 0 0 0 0B 0B |-nvme2n1p2 none 0B 0 0 0 0B 0B `-nvme2n1p3 none 0B 0 0 0 0B 0B nvme0n1 none 0B 0 0 0 0B 0B nvme1n1 none 0B 0 0 0 0B 0B nvme0n2 host-managed 2G 1844 14 14 4M 4K nvme1n2 host-managed 2G 1844 14 14 4M 4K Reviewed-by: Damien Le Moal Signed-off-by: Naohiro Aota misc-utils/lsblk.8.adoc | 2 +- misc-utils/lsblk.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) commit ca5f4bd0d63ec9b10ecb8d94713dd8c0c17ea695 Author: Naohiro Aota Date: Mon Aug 30 14:52:56 2021 +0900 lsblk: add columns of zoned parameters Several parameters for zoned devices are missing from lsblk's columns. This commit introduces them as following. ZONE-SZ zone size ZONE-WGRAN zone write granularity ZONE-APP zone append max bytes ZONE-NR number of zones ZONE-OMAX maximum number of open zones ZONE-AMAX maximum number of active zones Reviewed-by: Damien Le Moal Signed-off-by: Naohiro Aota bash-completion/lsblk | 3 ++- misc-utils/lsblk.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) commit abb6e8e67a8d14a13cff7582bad4f9c8f3507b77 Author: Naohiro Aota Date: Mon Aug 30 14:52:55 2021 +0900 lsblk: factor out function to read sysfs param as bytes Factor out a new function device_read_bytes() to read a sysfs path as bytes for a preparation for the next commit and to reduce the code duplication. Reviewed-by: Damien Le Moal Signed-off-by: Naohiro Aota misc-utils/lsblk.c | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) commit 5f618ca4b263735440edbd82de17da40506c6abf Author: Rafael Fontenelle Date: Mon Aug 30 07:19:06 2021 -0300 asciidoc: unconstrained formatting pair in fdisk Not using unconstrained witl result in showing asterisk instead, which is unwanted. disk-utils/fdisk.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e3668f436cd3ef145c076b11ca2b5ceaa2772fa3 Author: Rafael Fontenelle Date: Sun Aug 29 17:10:05 2021 -0300 asciidoc: fix quoted message in fsck.minix disk-utils/fsck.minix.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 28d6722d930566429f9f371c05ca7101b9af3b36 Author: Hill Ma Date: Tue Aug 24 14:21:27 2021 -0700 Add partition type GUID for Haiku. include/pt-gpt-partnames.h | 3 +++ 1 file changed, 3 insertions(+) commit abe16d0d34413555fbd621f90a0b93c2105116a2 Author: Karel Zak Date: Tue Aug 24 10:49:32 2021 +0200 tests: make eject umount tests more robust Signed-off-by: Karel Zak tests/ts/eject/umount | 3 +++ 1 file changed, 3 insertions(+) commit 85ae61dd6d956e7c9fe2b22b8c46bb1d0bfd13da Author: Karel Zak Date: Mon Aug 23 16:28:52 2021 +0200 tests: make mount/fstab-all more robust Signed-off-by: Karel Zak tests/ts/mount/fstab-all | 6 ++++++ 1 file changed, 6 insertions(+) commit 331c5e0c54d9cb6f67dc3e825eec2d78c67d8ce6 Author: Karel Zak Date: Mon Aug 23 15:15:38 2021 +0200 tests: make ./run.sh more robust Signed-off-by: Karel Zak tests/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9c59b604d385a54070dc8a148876e15773dd4356 Author: Vincent Smeets Date: Fri Aug 20 11:00:33 2021 +0200 Erase line before writing the filename text-utils/more.c | 2 ++ 1 file changed, 2 insertions(+) commit 0c7e7cc4eccb6303c4723587d536d9e45fa8e5f3 Author: Karel Zak Date: Thu Aug 19 12:10:02 2021 +0200 sfdisk: write empty label also when only ignored partition specified sfdisk writes empty disk label only when "label:" header specified. Unfortunately, this feature is ignored when all specified partitions are ignored echo -e "label: dos\n0,0,0\n" | sfdisk /dev/sdc Fixes: https://github.com/karelzak/util-linux/issues/1413 Signed-off-by: Karel Zak disk-utils/sfdisk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit d73690420693677ab07e331f20a80805a327773d Merge: 82189f7ba 91724a713 Author: Karel Zak Date: Thu Aug 19 11:12:31 2021 +0200 Merge branch 'rfkill-event-abort' of https://github.com/lightmare/util-linux * 'rfkill-event-abort' of https://github.com/lightmare/util-linux: rfkill: quit when read end of stdout is closed commit 82189f7bae847d6e1ad920d65e90f46885f0c21e Author: Karel Zak Date: Thu Aug 19 11:01:19 2021 +0200 github: add linux-modules-extra package to CI tests It should be enough to get scsi_debug kernel module. Suggested-by: Milan Broz Signed-off-by: Karel Zak .github/workflows/cibuild-setup-ubuntu.sh | 2 ++ 1 file changed, 2 insertions(+) commit 91724a713cb2b4d99b1896ca266252d271fdbdf1 Author: Mickey Rose Date: Tue Aug 17 16:36:06 2021 +0200 rfkill: quit when read end of stdout is closed sys-utils/rfkill.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) commit b1b0259fe42aad1bf0997ce1c03a020ce59e38ab Author: Hans de Goede Date: Fri Jul 30 13:22:54 2021 +0200 wdctl: Workaround reported boot-status bits not being present in wd->ident.options Some watchdog drivers are capable of reporting WDIOF_CARDRESET in their bootstatus, but they do not advertise this in the options field returned by the WDIOC_GETSUPPORT ioctl. This causes wdctl to not print the CARDRESET flag on these devices, even when the reset was caused by the watchdog and this is being reported in the WDIOC_GETBOOTSTATUS return. Add a workaround by or-ing any bits which are set in the status and bstatus returns into wd->ident.options so that reported flags will get printend independent of them being advertised as supported in wd->ident.options. This will make wdctl print a CARDRESET line when the system was actually reset by the watchdog while omitting it when it was not reset by the watchdog. At least on drivers which have the CARDRESET is missing from info.options problem. On other drivers the CARDRESET line will always be printend, but the actual reported value will change. Signed-off-by: Hans de Goede sys-utils/wdctl.c | 7 +++++++ 1 file changed, 7 insertions(+) commit e826aa3f4914ac6a8685454f18f41b2053c18346 Author: Karel Zak Date: Wed Aug 18 11:35:07 2021 +0200 libfdisk: check calloc() return [gcc-analyzer] Signed-off-by: Karel Zak libfdisk/src/ask.c | 4 ++++ libfdisk/src/item.c | 3 +++ 2 files changed, 7 insertions(+) commit 58b43e4b4f2268b08cfdf743fda2ea231fd01947 Author: Karel Zak Date: Wed Aug 18 11:28:43 2021 +0200 libfdisk: make self_partition() use more robust [gcc-analyzer] Signed-off-by: Karel Zak libfdisk/src/dos.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit c36203873f8dd87e8561c50fba5e4f4b5b0170c2 Author: Karel Zak Date: Wed Aug 18 11:15:55 2021 +0200 libfdisk: dereference of possibly-NULL [gcc-analyzer] Signed-off-by: Karel Zak libfdisk/src/parttype.c | 3 +++ 1 file changed, 3 insertions(+) commit 0fab76bd23a8b4b0a939a3b6fdb4545ff5737d62 Author: Karel Zak Date: Wed Aug 18 11:02:45 2021 +0200 libmount: make mnt_table_get_fs_root() more robust [gcc-analyzer] Signed-off-by: Karel Zak libmount/src/tab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 463e96d0bf6e364868fa2b3d7866a52ad345a332 Author: Karel Zak Date: Wed Aug 18 10:38:52 2021 +0200 ipcmk: fix strtoul use, remove deadcode [coverity scan] Signed-off-by: Karel Zak sys-utils/ipcmk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 987afa1a5fba4a2e2089deac31ec2d1aef6cf5c9 Author: Karel Zak Date: Wed Aug 18 10:26:48 2021 +0200 hardlink: Calling posix_fadvise without checking return value [coverity scan] Signed-off-by: Karel Zak misc-utils/hardlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c67497ce66e4c6f4bad82f952cd49886ef6bef00 Author: Karel Zak Date: Wed Aug 18 10:25:14 2021 +0200 more: Calling open without checking return value [coverity scan] Signed-off-by: Karel Zak text-utils/more.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6e7a4ab0ec38940c560575a29390f9b03a2eaa19 Author: Karel Zak Date: Wed Aug 18 10:19:23 2021 +0200 lscpu: fix cppcheck warning [Uninitialized variable] Signed-off-by: Karel Zak sys-utils/lscpu-cputype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f5c68982f5e34563cd747f0e66171af3b73d4638 Author: Karel Zak Date: Tue Aug 17 15:28:28 2021 +0200 mount: (adoc) ext_N_ → ext__N__ [manpage-l10n] Reported-by: Helge Kreutzmann Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6ccd33fbb554e938e0ece71b0631cfa69304b281 Author: Karel Zak Date: Tue Aug 17 15:22:09 2021 +0200 mount: (adoc) mount → mount(2), of → or [manpage-l10n] Reported-by: Helge Kreutzmann Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c71a3c4904a2261a6058b2d305c3b1ff2afe9edb Author: Karel Zak Date: Tue Aug 17 15:07:59 2021 +0200 mount: (adoc) fix missing period [manpage-l10n] Reported-by: Helge Kreutzmann Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1d6fdf751b9cbe270fa6d623d9ae7325669387b3 Merge: 615e37c80 fd06bb22b Author: Karel Zak Date: Tue Aug 17 13:55:02 2021 +0200 Merge branch 'master' of https://github.com/panchenbo/util-linux commit 615e37c80ff5a0cb9a75e9ea15626da3bc8404f4 Author: Karel Zak Date: Tue Aug 17 13:50:52 2021 +0200 agetty: (adoc) double hyphen replaced by dash in man pages Fixes: https://github.com/karelzak/util-linux/issues/1411 Signed-off-by: Karel Zak term-utils/agetty.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 93f1c0fa1d7e2201fa366a6f4c9607d31f0aeb0c Author: Karel Zak Date: Tue Aug 17 13:32:10 2021 +0200 zramctl: improve usage() output Signed-off-by: Karel Zak sys-utils/zramctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit fd06bb22b0a78f4ce40b547961e0e6098addec64 Author: panchenbo Date: Tue Aug 17 11:29:12 2021 +0800 fix error ft_part 0x662 sys-utils/lscpu-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ee16b9ff45be890eb08696898526a9373bf8e18b Author: Jan Samek Date: Mon Aug 16 21:22:15 2021 +0200 zramctl: add zstd compression algorithm option Add information about the possible value 'zstd' for the 'zramctl --algorithm' option to 'zramctl --help' and zramctl (8) manpage. The kernel supports zram with zstd compression starting with 4.15 (see https://lore.kernel.org/lkml/20170912050005.3247-1-sergey.senozhatsky@gmail.com/#r). Signed-off-by: Jan Samek sys-utils/zramctl.8.adoc | 2 +- sys-utils/zramctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 5a72054bd0e4590ed5f17ed862dcfeeb568f1c91 Author: Karel Zak Date: Thu Aug 12 13:51:57 2021 +0200 mount: add -m,--mkdir as shortcut for X-mount.mkdir Suggested-by: Zbigniew Jędrzejewski-Szmek Signed-off-by: Karel Zak bash-completion/mount | 3 ++- sys-utils/mount.8.adoc | 5 ++++- sys-utils/mount.c | 52 +++++++++++++++++++++++++++++++++----------------- 3 files changed, 40 insertions(+), 20 deletions(-) commit 6ba7fbb4427345fac61b69bb05da42ef78edd007 Author: Karel Zak Date: Thu Aug 12 13:44:19 2021 +0200 libmount: support quotes in X-mount options Signed-off-by: Karel Zak libmount/src/context.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) commit 52f05cd4c392083aa4a53b24f0ab971d4d38cf80 Author: Karel Zak Date: Thu Aug 12 13:41:56 2021 +0200 libmount: show options string on parse error Signed-off-by: Karel Zak libmount/src/context_mount.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) commit d85f45d5ddb020b9858356b4c2c91d962ac7e6d7 Author: Karel Zak Date: Thu Aug 12 13:39:39 2021 +0200 libmount: allow X-* options more than once Signed-off-by: Karel Zak libmount/src/optstr.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 315e8f634a7936532d08cd5ab056cd875d2a262e Author: Karel Zak Date: Thu Aug 12 12:12:39 2021 +0200 libmount: change propagation of /run for X-mount.subdir We do not need to create a new mount node from /run/mount/tmptgt (where we mount filesystem root), because /run is already mount node in all mainstream distros, and we can use MS_PRIVATE for this top-level directory. There is still fallback if /run is on root filesystem. This solution reduces number of mount operations, with the patch the subdir implementation is: * open current namespace from /proc/self/ns/mnt * mkdir /run/mount/tmptg (if it does not exist) * make /run private by mount(MS_PRIVATE) * mount filesystem to /run/mount/tmptg * bind mount /run/mount/tmptg/ to * umount /run/mount/tmptg * setns() to the original namespace Signed-off-by: Karel Zak libmount/src/utils.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) commit 7ae195affb0ea5fb9b777a7a2e89f4d2a69bd578 Author: Karel Zak Date: Thu Aug 12 10:58:18 2021 +0200 libmount: use /run/mount/tmptgt rather than /tmp/mount/mount. The unshared namespace is per-process, so we can use the same directory in all mount(8) instances. It's unnecessary to create and remove process specific directory. Signed-off-by: Karel Zak libmount/src/context.c | 9 +-------- libmount/src/context_mount.c | 11 +++++------ libmount/src/mountP.h | 10 +++++----- libmount/src/utils.c | 36 +++++++++++++++--------------------- 4 files changed, 26 insertions(+), 40 deletions(-) commit f8ccd659560d9fc12ecc1eff7f47f9bbd50565f0 Author: Karel Zak Date: Thu Aug 12 10:44:03 2021 +0200 libmount: remove support for obsolete /dev/.mount/utab The default is /run/mount/utab for years. Signed-off-by: Karel Zak libmount/src/mountP.h | 2 -- libmount/src/utils.c | 12 ++---------- 2 files changed, 2 insertions(+), 12 deletions(-) commit 926cb4d039344065768b835785317591d812b884 Merge: 6e68b8414 3b511f71a Author: Karel Zak Date: Wed Aug 11 16:22:39 2021 +0200 Merge branch 'master' of https://github.com/panchenbo/util-linux * 'master' of https://github.com/panchenbo/util-linux: lscpu:Add Phytium FT-2000+ & S2500 support commit 6e68b841449ba5fac183167ef62a23878a520e9e Author: Karel Zak Date: Wed Aug 11 16:18:29 2021 +0200 mount.8: don't consider additional mounts as experimental This is bug, we have "EXPERIMENTAL" flag in the man page since v2.23. Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e311e731be92d96a674be0609da4b7ef44c16522 Author: Karel Zak Date: Wed Aug 11 15:57:37 2021 +0200 libmount: add X-mount.subdir= Like btrfs subvol=, but more generic and for all filesystems. This feature is marked as EXPERIMENTAL (may be removed). # mount /dev/sdc /mnt/test -o X-mount.subdir=AAA # findmnt /dev/sdc TARGET SOURCE FSTYPE OPTIONS /mnt/test /dev/sdc[/AAA] ext4 rw,relatime,stripe=512 Implemented as: * open current namespace from /proc/self/ns/mnt * mkdir /tmp/mount/mount. * unshare mount namespace * create mount node from /tmp/mount/mount. by mount(MS_BIND) * mark /tmp/mount/mount. private by mount(MS_PRIVATE|MS_REC) * bind mount /tmp/mount/mount./subdir to * umount /tmp/mount/mount. * rmdir /tmp/mount/mount. * setns() to the original namespace Note that /tmp/mount/mount. conversion to mount node and call for MS_PRIVATE are visible (propagated to the system) if /tmp is a shared filesystem, the rest (all operations with the desired filesystem) is atomic for a parental namespace. Maybe one day it will be possible to reimplement it in more elegant way with new mount kernel APIs (open_tree(), etc.). Fixes: https://github.com/karelzak/util-linux/issues/1103 Signed-off-by: Karel Zak libmount/src/context.c | 44 +++++++++++++++++++++++++ libmount/src/context_mount.c | 77 ++++++++++++++++++++++++++++++++++++++------ libmount/src/mountP.h | 7 ++++ libmount/src/utils.c | 71 ++++++++++++++++++++++++++++++++++++++++ sys-utils/mount.8.adoc | 3 ++ 5 files changed, 192 insertions(+), 10 deletions(-) commit 3b511f71a4922d9dea034c5af47fb236df47079a Author: panchenbo Date: Wed Aug 11 19:33:31 2021 +0800 lscpu:Add Phytium FT-2000+ & S2500 support sys-utils/lscpu-arm.c | 2 ++ 1 file changed, 2 insertions(+) commit 77d4e97784714a4862334fa05ab8590735d0eab6 Merge: 28af0586b 642a1a00a Author: Karel Zak Date: Wed Aug 11 10:04:35 2021 +0200 Merge branch 'master' of https://github.com/panchenbo/util-linux * 'master' of https://github.com/panchenbo/util-linux: lscpu:Add Phytium aarch64 cpupart commit 642a1a00a52a8c9ef8d48980a8567ab0aa307d0c Author: panchenbo Date: Wed Aug 11 13:00:08 2021 +0800 lscpu:Add Phytium aarch64 cpupart sys-utils/lscpu-arm.c | 5 +++++ 1 file changed, 5 insertions(+) commit 28af0586b7ea96efe04fc96cb23613d77445b1c2 Author: Karel Zak Date: Tue Aug 10 10:12:26 2021 +0200 docs: fix info about LIBSMARTCOLS_DEBUG_PADDING Signed-off-by: Karel Zak disk-utils/fdisk.8.adoc | 2 +- libsmartcols/src/table.c | 2 +- misc-utils/findmnt.8.adoc | 2 +- misc-utils/lsblk.8.adoc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) commit 9c35c5728b4887da73a95283c6a5f1d7c26c7abc Merge: 68463f5af e091d5b7b Author: Karel Zak Date: Mon Aug 9 11:58:42 2021 +0200 Merge branch 'whereis-bash-complete' of https://github.com/Smittyvb/util-linux * 'whereis-bash-complete' of https://github.com/Smittyvb/util-linux: whereis: use commands for Bash completions commit 68463f5af1fcee0622e545f2bab9c6101f84a276 Author: Karel Zak Date: Mon Aug 9 11:07:17 2021 +0200 lib/buffer: fix buffer reset Signed-off-by: Karel Zak lib/buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 27ffec8369a04e78b548c8d6bd0181bd214955ec Author: Karel Zak Date: Mon Aug 9 09:52:46 2021 +0200 lscpu: fix compilation against librtas Fixes: https://github.com/karelzak/util-linux/issues/1406 Signed-off-by: Karel Zak sys-utils/lscpu-cputype.c | 4 ++++ 1 file changed, 4 insertions(+) commit 87559313dfaf2f949c6ab87d54569d94599b649a Author: Karel Zak Date: Mon Aug 9 09:45:21 2021 +0200 prlimit: fix compiler warning [-Wmaybe-uninitialized] sys-utils/prlimit.c:467:16: warning: 'hard' may be used uninitialized in this function [-Wmaybe-uninitialized] lim->rlim_max = hard; ~~~~~~~~~~~~~~^~~~~~ sys-utils/prlimit.c:456:15: note: 'hard' was declared here rlim_t soft, hard; ^~~~ sys-utils/prlimit.c:466:16: warning: 'soft' may be used uninitialized in this function [-Wmaybe-uninitialized] lim->rlim_cur = soft; ~~~~~~~~~~~~~~^~~~~~ sys-utils/prlimit.c:456:9: note: 'soft' was declared here rlim_t soft, hard; ^~~~ References: https://github.com/karelzak/util-linux/issues/1406 Signed-off-by: Karel Zak sys-utils/prlimit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e091d5b7b10bedba3e4a60c780b9d747a32651dd Author: Smitty Date: Sun Aug 8 18:04:30 2021 -0400 whereis: use commands for Bash completions Currently, the Bash completions for `whereis ` gives `whereis file` ("file" is not a placeholder here, it literally expands to that). This fixes that by passing the `-c` flag to `compgen` to request completions for command names. Signed-off-by: Smitty van Bodegom bash-completion/whereis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4be393a4ba59a2cada9d374c059544ea2bc0c0ad Author: Karel Zak Date: Fri Aug 6 12:04:05 2021 +0200 libsmartcols: use lib/buffer, remove local implementation Signed-off-by: Karel Zak libsmartcols/src/Makemodule.am | 1 - libsmartcols/src/buffer.c | 154 ----------------------------------------- libsmartcols/src/calculate.c | 12 ++-- libsmartcols/src/print-api.c | 18 ++--- libsmartcols/src/print.c | 123 ++++++++++++++++---------------- libsmartcols/src/smartcolsP.h | 38 +++------- 6 files changed, 91 insertions(+), 255 deletions(-) commit 9ea47344ca59f1fb9fc5dfb11f223a309c0644e3 Author: Karel Zak Date: Fri Aug 6 12:02:39 2021 +0200 lib/buffer: add support for "safe" encoding Signed-off-by: Karel Zak include/buffer.h | 9 ++++++- lib/Makemodule.am | 2 +- lib/buffer.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++---- libmount/src/optstr.c | 14 +++++------ misc-utils/lsblk.c | 4 +-- 5 files changed, 80 insertions(+), 16 deletions(-) commit f55be401884d651350f15881cb5a9b8a8f120b24 Author: Karel Zak Date: Thu Aug 5 16:45:07 2021 +0200 lib/buffer: add possibility to save position in the buffer This is necessary to use lib/buffer.c in libsmart cols. Signed-off-by: Karel Zak include/buffer.h | 8 ++++++++ lib/buffer.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) commit f60dc888489a0b8dcb24fe64659d3b7e8ebc778f Author: Karel Zak Date: Thu Aug 5 16:05:58 2021 +0200 lib/buffer: retun size of the buffer and data Signed-off-by: Karel Zak include/buffer.h | 3 ++- lib/buffer.c | 24 +++++++++++++++++------- libmount/src/optstr.c | 14 +++++++------- misc-utils/lsblk.c | 4 ++-- 4 files changed, 28 insertions(+), 17 deletions(-) commit 2e03758dc56ccfdec4ca3401136d2701a219b943 Author: Karel Zak Date: Thu Aug 5 15:42:15 2021 +0200 lib/strutils: add strappend() Signed-off-by: Karel Zak include/strutils.h | 3 +++ lib/strutils.c | 25 +++++++++++++++++++++++++ libmount/src/fs.c | 2 +- libmount/src/mountP.h | 1 - libmount/src/tab.c | 4 ++-- libmount/src/utils.c | 38 -------------------------------------- 6 files changed, 31 insertions(+), 42 deletions(-) commit 8420463b6d4cb30251e8a79b7fa3c19b0091da8e Author: Karel Zak Date: Thu Aug 5 11:25:54 2021 +0200 lib/strutils: rename strappend() to strconcat() It concatenates two strings to a new string. It's something else than "append". Signed-off-by: Karel Zak include/strutils.h | 6 +++--- lib/strutils.c | 13 ++++++++----- lib/strv.c | 2 +- libmount/src/tab.c | 2 +- misc-utils/getopt.c | 2 +- misc-utils/logger.c | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) commit 5f9b88f43ba7f98f81bde3538d5f4e5cd1a6c01c Author: Karel Zak Date: Thu Aug 5 09:46:21 2021 +0200 libuuid: include c.h to cover restrict keyword References: https://github.com/karelzak/util-linux/issues/1405 Signed-off-by: Karel Zak libuuid/src/unparse.c | 1 + 1 file changed, 1 insertion(+) commit 2964fd916f4687dbab09ca91674703feffbb5833 Author: Karel Zak Date: Tue Aug 3 13:29:16 2021 +0200 libblkid: (btrfs) add debug messages to zoned support Signed-off-by: Karel Zak libblkid/src/probe.c | 4 ++-- libblkid/src/superblocks/btrfs.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) commit 5f8244c66e9190135c84c0fb5af5e1671c929f94 Author: Karel Zak Date: Mon Aug 2 15:49:10 2021 +0200 libfdisk: (dos) index partition from zero for DBG() References: https://github.com/karelzak/util-linux/pull/1394 Signed-off-by: Karel Zak libfdisk/src/dos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2d29fccaad267d1b003dc0ed2bb9634ff76f3e49 Author: WANG Xuerui Date: Mon Aug 2 17:55:19 2021 +0800 libfdisk: add new Linux GPT partition types Add new partition type UUIDs introduced in the following systemd PRs: - https://github.com/systemd/systemd/pull/17700 - https://github.com/systemd/systemd/pull/20087 [kzak@redhat.com: - add missing commas] Signed-off-by: WANG Xuerui Signed-off-by: Karel Zak include/pt-gpt-partnames.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit afaece0eb2bc9db7e5b0847265e43e80be8f0e71 Author: Karel Zak Date: Mon Aug 2 10:58:56 2021 +0200 libmount: assert() is enough [lgtm scan] Signed-off-by: Karel Zak libmount/src/lock.c | 3 --- 1 file changed, 3 deletions(-) commit 8ad22184b5cdc2c81d61b9f6b283d08e588fcb08 Merge: b5456d167 973c3fc75 Author: Karel Zak Date: Mon Aug 2 10:40:10 2021 +0200 Merge branch 'chs' of https://github.com/pali/util-linux * 'chs' of https://github.com/pali/util-linux: fdisk: Add support for fixing MBR partitions CHS values libfdisk: (dos) Add function fdisk_dos_fix_chs() for fixing CHS values for all partitions libfdisk: (dos) Add function dos_partition_sync_chs() for updating CHS values commit b5456d16767d196bc6ab31e1cf613198e97d2669 Author: Nicolas Melot Date: Sun Aug 1 19:20:58 2021 +0200 Forward value of sector_size instead of its address in blkdev_get_physector_size lib/blkdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit e5041e76f8fcfaf5e55a1659a5f1052e43ba5491 Author: Karel Zak Date: Fri Jul 30 15:32:24 2021 +0200 tests: add rv64 lscpu test References: https://github.com/karelzak/util-linux/issues/1401 Signed-off-by: Karel Zak tests/expected/lscpu/lscpu-rv64-linux | 16 ++++++++++++++++ tests/ts/lscpu/dumps/rv64-linux.tar.gz | Bin 0 -> 4215 bytes 2 files changed, 16 insertions(+) commit 0d7cef3ddbd2aacbea8c11e8524a3de68dfb8ff6 Author: Karel Zak Date: Fri Jul 30 14:35:25 2021 +0200 lscpu: fix NULL dereference Fixes: https://github.com/karelzak/util-linux/issues/1401 Signed-off-by: Karel Zak sys-utils/lscpu-cputype.c | 2 +- sys-utils/lscpu.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) commit 5cc37e883ee5dbe59a89b925e06f3a92d54cbb29 Author: Karel Zak Date: Fri Jul 30 14:16:03 2021 +0200 Revert "sulogin: fix getpasswd()" This patch is unnecessary in the master branch. This reverts commit 2d8a9fcee2e3d63deb6bcba650894ff14d8e2d3b. References: https://github.com/karelzak/util-linux/issues/1400 login-utils/sulogin.c | 1 - 1 file changed, 1 deletion(-) commit 973c3fc7531ded5469de58aa7ff56fe31ea439b1 Author: Pali Rohár Date: Fri Jul 30 11:19:20 2021 +0200 fdisk: Add support for fixing MBR partitions CHS values Add a new extended option 'F' to fdisk which recalculates and fixes CHS values for each partition in MBR table according to current fdisk settings for number of heads and sectors per track. This allows in interactive mode to repair existing partitions to be compatible with CHS addressing after changing extended option 'h' (number of heads) or 's' (sectors per track) as these options do not modify content of existing partitions. Signed-off-by: Pali Rohár disk-utils/fdisk-menu.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit dac364addbfb32b099658c89fcc5e40c834ccf79 Author: Pali Rohár Date: Fri Jul 30 11:15:15 2021 +0200 libfdisk: (dos) Add function fdisk_dos_fix_chs() for fixing CHS values for all partitions This function fixes beginning and ending CHS values for every partition according to LBA relative offset, relative beginning and size and fdisk idea of disk geometry (sectors per track and number of heads). This function may be used for repairing existing partitions to be compatible with CHS addressing. Signed-off-by: Pali Rohár libfdisk/docs/libfdisk-sections.txt | 1 + libfdisk/src/dos.c | 87 +++++++++++++++++++++++++++++++++++-- libfdisk/src/libfdisk.h.in | 1 + libfdisk/src/libfdisk.sym | 4 ++ 4 files changed, 90 insertions(+), 3 deletions(-) commit 6eb1c01e9dd25a73100f06db37190c63fd57d4d9 Author: Karel Zak Date: Fri Jul 30 11:50:46 2021 +0200 agetty: use CTRL+C to erase username aggety(8) from the beginning ignores ^C (the small exception was between 2.32 and 2.34 when this char has been misinterpreted). This patch forces agetty to interpret ^C like ^U, it means to erase the user's input and wait for a completely new username. The small difference is that for ^C it does not set 'kill character'. This change does not affect serial lines where ^C is still ignored like in previous decades. I'd like to avoid any regression as I have no clue if any serial lines do not send this control char in some context ... Fixes: https://github.com/karelzak/util-linux/issues/1399 References: https://github.com/karelzak/util-linux/issues/1046 Signed-off-by: Karel Zak term-utils/agetty.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit e63d9ab1d604c786f3bc84f0206407433c241951 Author: Pali Rohár Date: Fri Jul 30 11:01:36 2021 +0200 libfdisk: (dos) Add function dos_partition_sync_chs() for updating CHS values Call this function everytime after changing either relative LBA partition offset or LBA partition size to ensure that CHS values are in sync with LBA. This should fix partition CHS values after moving or deleting partition. Signed-off-by: Pali Rohár include/pt-mbr.h | 22 ++++++++++++++++++++++ libfdisk/src/dos.c | 22 ++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) commit 37c6c5783e0cca3cc4925330530f76c25780bb09 Merge: 2d8a9fcee 0a002b617 Author: Karel Zak Date: Thu Jul 29 21:34:20 2021 +0200 Merge branch 'xget' of https://github.com/ericonr/util-linux * 'xget' of https://github.com/ericonr/util-linux: lib/pwdutils: use assert to check correct usage. logger: use xgetlogin from pwdutils. wall: use xgetlogin. lib/pwdutils: don't use getlogin(3). commit 2d8a9fcee2e3d63deb6bcba650894ff14d8e2d3b Author: Karel Zak Date: Thu Jul 29 21:28:00 2021 +0200 sulogin: fix getpasswd() Fixes: https://github.com/karelzak/util-linux/issues/1400 Signed-off-by: Karel Zak login-utils/sulogin.c | 1 + 1 file changed, 1 insertion(+) commit c6d0ea9844fb502e79e558a4ef79ab4e4746afe6 Author: Karel Zak Date: Thu Jul 29 20:37:32 2021 +0200 libmount: don't use setgroups at all() It's probably good idea to call setgroups() to cleanup groups, but it introduces a regression as some mount helpers depend on supplementary groups like "network" etc. Fixes: https://github.com/karelzak/util-linux/issues/1398 Signed-off-by: Karel Zak include/c.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit 0a002b6179ec1ffededc4f7f8bdf3b9ee59788b9 Author: Érico Nogueira Date: Tue Jul 27 23:58:26 2021 -0300 lib/pwdutils: use assert to check correct usage. Since these functions are only used internally, we can make sure they are being used correctly, and assert() helps in catching remaining issues. Usage of each changed function has been reviewed: For xgetpwnam: - chsh(1) only calls it if a username has been set - login(1) only calls it if username has been set and is not empty - su(1) always initializes new_user to "root" - unshare(1) calls get_user with optarg, so always set as well For xgetgrnam: - unshare(1) calls get_group with optarg For xgetpwuid: - chsh(1) passes a stack allocated struct for struct passwd Signed-off-by: Érico Nogueira lib/pwdutils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 7f22751bd1fa6693dbe05872551c6f13f6371096 Author: Érico Nogueira Date: Tue Jul 27 23:54:42 2021 -0300 logger: use xgetlogin from pwdutils. It defined its own xgetlogin, which queried geteuid() instead of getuid(), with a fallback to "" when lookup fails. This has been the case since the function was introduced in 019b97024fde3f07eaf541eef990762483369a11, so geteuid() has always been used. Since using geteuid for identification isn't consistent with the rest of util-linux, switching to xgetlogin(), which uses getuid(), should be correct. Signed-off-by: Érico Nogueira misc-utils/Makemodule.am | 2 +- misc-utils/logger.c | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) commit 11109352d4a3fb34ecfdb120cca65640bcecf5b2 Author: Érico Nogueira Date: Tue Jul 27 23:51:34 2021 -0300 wall: use xgetlogin. getlogin(3) shouldn't be used for identification here. This also removes the bug where a missing entry for getuid() in passwd database wouldn't print a warning, because whom would be set to "???". For consistency, switch to "" when pw look up fails. Signed-off-by: Érico Nogueira term-utils/wall.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 3386b92e09e8a945cb071808e012e0b600f8bcb2 Author: Érico Nogueira Date: Tue Jul 27 23:41:30 2021 -0300 lib/pwdutils: don't use getlogin(3). Per the man page, it shouldn't be used for security purposes. This is an issue especially on musl, where getlogin is implemented as getenv("LOGNAME"). Since xgetlogin is being used as user identity in su(1), to set PAM_RUSER, we simply switch to always using getpwuid(getuid()). Signed-off-by: Érico Nogueira lib/pwdutils.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 420e914c4cc4c2ba34fd75790ea194d7f4a47d2c Author: Karel Zak Date: Thu Jul 29 11:50:48 2021 +0200 libmount: fix setgroups() use * keep process in single supplementary group, which is the real group ID for the process * make sure we have rights to call setgroups(), requires group permissions Fixes: https://github.com/karelzak/util-linux/issues/1398 Signed-off-by: Karel Zak include/c.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 760587e1303edb722eb5f7ce059bfd9541b861e1 Merge: 583990d25 ef7eccad5 Author: Karel Zak Date: Wed Jul 28 11:17:59 2021 +0200 Merge branch 'procmnt-fix' of https://github.com/benaryorg/util-linux * 'procmnt-fix' of https://github.com/benaryorg/util-linux: fix #648 by ignoring EINVAL on-remount of proc commit 583990d25b5d65a9a9771a39d112de0ee16a1f3a Author: Karel Zak Date: Wed Jul 28 11:05:36 2021 +0200 losetup: use LOOP_CONFIGURE in a more robust way 32-bit userspace returns ENOTTY: ioctl(4, LOOP_CONFIGURE, {fd=3, block_size=0, info={lo_offset=0, lo_number=0, lo_flags=LO_FLAGS_AUTOCLEAR, lo_file_name="/usr/install/iso/systemrescue-8.04-amd64.iso", ...}}) = -1 ENOTTY (Inappropriate ioctl for device) 64-bit userspace returns EINVAL: ioctl(4, LOOP_CONFIGURE, {fd=3, block_size=0, info={lo_offset=0, lo_number=0, lo_flags=LO_FLAGS_AUTOCLEAR, lo_file_name="/usr/src/PACKAGES/systemrescue-8.04-amd64.iso", ...}}) = -1 EINVAL (Invalid argument) The correct return value for an unknown ioctl is ENOTTY, but we need to support already released kernels, so let's support both errnos. Reported-by: Krzysztof Olędzki Signed-off-by: Karel Zak lib/loopdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 627216cf43c1131866276f6ff1bacae18598a39d Author: Anatoly Pugachev Date: Tue Jul 27 19:33:03 2021 +0300 tests: fix fdisk/bsd on big endian systems (tested on sparc64 and ppc64) Fixes: 5d0f0ca56 Closes #1392 Signed-off-by: Anatoly Pugachev tests/expected/fdisk/bsd_0_64.BE | 26 +++++++++++++------------- tests/expected/fdisk/bsd_1_0.BE | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) commit 082b79ff8ed75336822ea65f4b85cc75776e1bfe Merge: b44035290 96209c98e Author: Karel Zak Date: Tue Jul 27 14:14:51 2021 +0200 Merge branch 'rename-all' of https://github.com/utoddl/util-linux * 'rename-all' of https://github.com/utoddl/util-linux: rename: size_t, mutually exclusive parameters rename: stop after count changes rename: add --all and --last parameters commit b44035290005adb19eaaf24c5685a5d5f35ed750 Merge: 914966e92 b169cf895 Author: Karel Zak Date: Tue Jul 27 13:34:16 2021 +0200 Merge branch 'patch-1' of https://github.com/cfinnberg/util-linux commit 914966e925dc4d328522feb5663003a4316c6035 Author: Karel Zak Date: Tue Jul 27 13:31:57 2021 +0200 readprofile: use snprintf() rather than sprintf() sys-utils/readprofile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 34cf0aa56dfd62219928f52a601acf5362bd4e6e Author: Karel Zak Date: Tue Jul 27 13:31:47 2021 +0200 ipcs: use snprintf() rather than sprintf() sys-utils/ipcutils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit c1cc6fb2bf86132e7bd01cddc5dd24dcc58e4001 Author: Karel Zak Date: Tue Jul 27 13:31:30 2021 +0200 write: use snprintf() rather than sprintf() term-utils/write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 042fbf3712984d0f56f4e4fdae774a82714eed8f Author: Karel Zak Date: Tue Jul 27 13:31:18 2021 +0200 more: use snprintf() rather than sprintf() text-utils/more.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 09eee8b489c7a43dea56a683c6c350b0f850f00b Author: Karel Zak Date: Tue Jul 27 13:30:56 2021 +0200 lslocks: use snprintf() rather than sprintf() misc-utils/lslocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 948cac89f39ee6af1f9826aaec50b1e45feddb4b Author: Karel Zak Date: Tue Jul 27 13:30:42 2021 +0200 uuidd: use snprintf() rather than sprintf() misc-utils/uuidd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 2605d883790617ef6c2cf42191ae4299958a91cc Author: Karel Zak Date: Tue Jul 27 13:30:14 2021 +0200 vipw: use snprintf() rather than sprintf() login-utils/vipw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a6d7f918ac479bd483c9889f6d2f4e61e2873230 Author: Karel Zak Date: Tue Jul 27 13:30:01 2021 +0200 logindefs: use snprintf() rather than sprintf() login-utils/logindefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 79fb7e18f45e84c6f1a030b5df56cb2bdad26df0 Author: Karel Zak Date: Tue Jul 27 13:29:36 2021 +0200 last: use snprintf() rather than sprintf() login-utils/last.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) commit 4c5e1485e23f107485f9574320c2f53284be2d31 Author: Karel Zak Date: Tue Jul 27 13:29:19 2021 +0200 lib: use snprintf() rather than sprintf() lib/procutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 822324953e8a0e258f734fed410e5be9433bc1bf Author: Karel Zak Date: Tue Jul 27 13:29:05 2021 +0200 libblkid: use snprintf() rather than sprintf() libblkid/src/devname.c | 16 +++++++++------- libblkid/src/save.c | 10 ++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) commit 2342efec202ccf9415f1574df7b07b294f375475 Author: Karel Zak Date: Tue Jul 27 13:28:52 2021 +0200 libsmartcols: use snprintf() rather than sprintf() libsmartcols/samples/continuous.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 26266436c849286f2934f752e4c911a8d0962fe2 Author: Karel Zak Date: Tue Jul 27 12:51:43 2021 +0200 blockdev: use snprintf() rather than sprintf() Signed-off-by: Karel Zak disk-utils/blockdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 05c4b11d5ebaff9d1901553ba14f84a3c850b1e1 Merge: 1c9143d0c d73a71840 Author: Karel Zak Date: Tue Jul 27 12:49:59 2021 +0200 Merge branch 'master' of https://github.com/tabraham/util-linux commit 1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c Author: Karel Zak Date: Tue Jul 27 11:58:31 2021 +0200 sys-utils/ipcutils: be careful when call calloc() for uint64 nmembs Fix: https://github.com/karelzak/util-linux/issues/1395 Signed-off-by: Karel Zak sys-utils/ipcutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 03c3aae63cbe33a7c595b759cd65d1fc35450db7 Author: Karel Zak Date: Tue Jul 27 11:40:32 2021 +0200 libfdisk: (dos) support partition and MBR overlap Let's support this crazy use-case in expert menu, because it's normal for removable FAT disks, etc. Signed-off-by: Karel Zak libfdisk/src/dos.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit c31a5ee4efa363510476416f8968b245ce512b14 Author: Karel Zak Date: Tue Jul 27 11:10:53 2021 +0200 libfdisk: (dos) don't ignore MBR+FAT use-case Since libblkid commit 751eca28fcfa1e325770904d7181b22e48c72b29 it does not ignore FAT on whole-disks, so now libfdisk sees collision between FAT and MBR. It's fine to report the collision to users, but we should not ignore the MBR. Signed-off-by: Karel Zak libfdisk/src/dos.c | 6 ------ 1 file changed, 6 deletions(-) commit d73a71840b881d5af0f7f16a82f0b910f0b616c0 Author: Thomas Abraham Date: Thu Jul 22 15:43:13 2021 -0400 blockdev: allow for larger values for start sector commit 9147d2ad8a ("blockdev: Don't fail on missing start sector") limits the size of the start sector to 10 digits. Multi-terrabyte devices can have partitions with a start sector larger than 10 digits, which will cause an sprintf() to abort due to overflowing the buffer. It causes: # blockdev --report /dev/sda4 RO RA SSZ BSZ StartSec Size Device *** buffer overflow detected ***: terminated Aborted (core dumped) disk-utils/blockdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit b169cf895e4c736c361f66bbca1043f327727e1f Author: Christian Finnberg Date: Thu Jul 22 19:03:54 2021 +0300 Fix typo po/es.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8344a81f7a726cef4640f9368bd6728eff6987bc Author: Karel Zak Date: Thu Jul 22 11:34:11 2021 +0200 lslogins: fix memory leak [asan] Signed-off-by: Karel Zak login-utils/lslogins.c | 1 + 1 file changed, 1 insertion(+) commit 21ee5ef448729d0263de3d57ba7a8635ec526b8b Author: Karel Zak Date: Thu Jul 22 11:30:22 2021 +0200 lslogins: ask for supplementary groups only once [asan] Signed-off-by: Karel Zak login-utils/lslogins.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 31d730eb7730f186a0a245f97a09df2fa625f6bd Author: Karel Zak Date: Thu Jul 22 11:03:54 2021 +0200 lslogins: use sd_journal_get_data() in proper way man sd_journal_get_data: The returned data is in a read-only memory map and is only valid until the next invocation of sd_journal_get_data(). It means that use data after 3x sd_journal_get_data() is really bad idea. It also seems better to not assume the fields are zero terminated as journal API works with void* and size_t to address the data. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1984704 Signed-off-by: Karel Zak login-utils/lslogins.c | 59 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 24 deletions(-) commit d95d552e36269c1576fc0b043d0b0a3a2c9d63ce Merge: 44d3ce043 5d0f0ca56 Author: Karel Zak Date: Mon Jul 19 13:34:24 2021 +0200 Merge branch 'chs' of https://github.com/pali/util-linux * 'chs' of https://github.com/pali/util-linux: tests: fdisk: Update CHS values in MBR partitions libfdisk: (dos) Fix determining number of heads and sectors per track from MBR libfdisk: (dos) Fix upper bound cylinder check in check_consistency() libfdisk: (dos) Fix upper bound cylinder check in check() libfdisk: (dos) Fix setting CHS values when creating new partition libfdisk: (dos) Use helper macros cylinder() and sector() in check_consistency() libfdisk: (dos) Put number of CHS check_consistency errors into summart message libfdisk: (dos) Add check both begin and end CHS partition parameters libfdisk: (dos) Fix check error message when CHS calculated sector does not match LBA libfdisk: (dos) Fix printing number of CHS sectors in check error message libfdisk: (dos) Recalculate number of cylinders after changing number of heads and sectors commit 5d0f0ca563ebde56f37aa0895a6f1752cf035b6f Author: Pali Rohár Date: Fri Jul 16 22:26:38 2021 +0200 tests: fdisk: Update CHS values in MBR partitions It looks like that old CHS values prior this change in test data are incorrect. Possible explanation why CHS values are incorrect is in commit message 9cade4fbf8c4 ("libfdisk: (dos) Fix determining number of heads and sectors per track from MBR"). This change updates test data to pass test suite after applying mentioned commit. Signed-off-by: Pali Rohár tests/expected/fdisk/bsd_1_0.LE | 18 +++++++++--------- .../expected/fdisk/mbr-nondos-mode-1st-primary-delete | 4 ++-- .../fdisk/mbr-nondos-mode-1st-primary-recreate | 4 ++-- tests/expected/fdisk/mbr-nondos-mode-2nd-primary | 6 +++--- tests/expected/fdisk/mbr-nondos-mode-extended | 6 +++--- .../expected/fdisk/mbr-nondos-mode-first-sector-at-end | 2 +- tests/expected/fdisk/mbr-nondos-mode-logical | 6 +++--- tests/expected/fdisk/mbr-nondos-mode-logical-delete | 6 +++--- tests/expected/fdisk/mbr-nondos-mode-logical-recreate | 6 +++--- 9 files changed, 29 insertions(+), 29 deletions(-) commit 44d3ce043de93f7c549786a56e58da3ab8b8d194 Merge: cae071ed7 d9567bdea Author: Karel Zak Date: Fri Jul 16 14:17:19 2021 +0200 Merge branch 'verity_exp' of https://github.com/bluca/util-linux * 'verity_exp' of https://github.com/bluca/util-linux: verity: remove experimental tag from mount manpage commit d9567bdead5f50973a459339aca2f9e81a4e94d8 Author: Luca Boccassi Date: Fri Jul 16 11:52:44 2021 +0100 verity: remove experimental tag from mount manpage It has been around for a year and a half, and 3 releases. sys-utils/mount.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9cade4fbf8c40640d94b5cd8ed1a3ac4b20a965d Author: Pali Rohár Date: Tue Jul 6 19:43:56 2021 +0200 libfdisk: (dos) Fix determining number of heads and sectors per track from MBR Current algorithm implemented in get_partition_table_geometry() function is wrong. It take head bits from CHS position from the end of the last partition and proclaim that this value is number of heads on disk. Same does for sectors bits from CHS and proclaim that this value is number of sectors per tracks. As number of disk heads and head bits in CHS position are different things this just results in bogus detected disk geometry. Implement a new algorithm to determinate number of heads and sectors per track from partition sector offsets. In MBR table for every partition is stored every sector offset in two formats: one as CHS and one as LBA. Conversion from CHS to LBA is defined by formula: LBA = (c * N_heads + h) * N_sectors + (s - 1) So if we have two different offsets in both CHS and LBA formats, written as (LBA1, c1, h1, s1) and (LBA2, c2, h2, s2) then we can calculate number of heads and sectors per tracks by solving linear equations as: N_heads = (o1 * h2 - o2 * h1) / (o2 * c1 - o1 * c2) N_sectors = (o2 * c1 - o1 * c2) / (c1 * h2 - c2 * h1) where o = LBA - (s - 1) Integer division also verifies that offsets were calculated from same number of heads and sectors per track as division must be always positive with no reminder. There is a special case when either numerator or denominator is zero. This indicates that comparing partition offsets have also same CHS offset divisor which leads to fact that calculation of number of heads and sector per tracks is not possible. In MBR table are stored up to 8 offset numbers, so it means there are up to the 28 of candidates which can expose number of disk heads and number of disk sectors per track. Start with offsets which belongs to same partition and start from the first partition. As the first partition in most cases was used by BIOS for booting. It is required to skip CHS values 1023/254/63 and 1023/255/63 as these indicates that values are invalid or overflowed. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 112 insertions(+), 13 deletions(-) commit 639f6507b6e2b2e9a28a602675ea50c689a2659a Author: Pali Rohár Date: Tue Jul 6 18:29:10 2021 +0200 libfdisk: (dos) Fix upper bound cylinder check in check_consistency() To determinate if CHS values are valid for consistency check and not overflowed, it is needed to check current CHS cylinder value and not total disk cylinder values. It is possible that also on "big" disk there is first small partition which can be represented by CHS tuple. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c0a0e567d84b5fb6cffb58c72c5d40191f30d441 Author: Pali Rohár Date: Tue Jul 6 18:26:52 2021 +0200 libfdisk: (dos) Fix upper bound cylinder check in check() To check if LBA sector can be represented in CHS without overflow it is required to check for cylinder value which belongs to the LBA sector. And not the total number of disk cylinders. Note that maximal representable total number of disk cylinders is 1024 and therefore the last cylinder which which can be stored in CHS tuple is 1023. Hence strict inequality is used. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ed5a0f331bd825b9613445fdf2032b6af8ef7949 Author: Pali Rohár Date: Tue Jul 6 17:12:13 2021 +0200 libfdisk: (dos) Fix setting CHS values when creating new partition It does not matter if dos compatibility flag is turned on or off. CHS values in partition entry can overflow also when dos compatibility flag is turned off. In this case maximal representable CHS values should be used. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit bfdee4708245f4020692ee4fef292ddeeebcd388 Author: Pali Rohár Date: Tue Jul 6 15:03:21 2021 +0200 libfdisk: (dos) Use helper macros cylinder() and sector() in check_consistency() Helper macros are already used there and make code more readable. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 83ff6dfd01e1e1a230fc75852b53629be7cae50e Author: Pali Rohár Date: Tue Jul 6 14:57:13 2021 +0200 libfdisk: (dos) Put number of CHS check_consistency errors into summart message Function check_consistency() prints errors to console output but does not calculate correct error numbers in summary error message. Fix it, so fdisk prints correct number in summary message "N errors detected.". Signed-off-by: Pali Rohár libfdisk/src/dos.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 77b77e98a133bcc485f8e6d6e52d1b3180962b8e Author: Pali Rohár Date: Tue Jul 6 14:54:40 2021 +0200 libfdisk: (dos) Add check both begin and end CHS partition parameters There is no reason to check only end CHS partition parameters. Check also begin values and correctly count errors in nerrors variable. fdisk then print correctly summary message "N errors detected.". Signed-off-by: Pali Rohár libfdisk/src/dos.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) commit 7ab459dff15b450d968db3af71c3cb6d7e55b60a Author: Pali Rohár Date: Tue Jul 6 14:08:42 2021 +0200 libfdisk: (dos) Fix check error message when CHS calculated sector does not match LBA Function check() checks that LBA addresses sector number matches CHS sector number. But error message contains information about "previous sectors" and "total sectors" which is misleading so change it. Also rename variables 'start' and 'total' to make it clear what value is stored in them. Note that in 'start' variable is currently stored last LBA partition sector and in 'total' is stored last CHS partition sector. So neither sector where partition starts nor total sectors of partition. Code and check logic looks to be correct, just error message and variable names are misleading. Therefore no functional changes in this patch. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 6fc455661a225877743163a7f35d3bc34bb3a259 Author: Pali Rohár Date: Tue Jul 6 13:51:22 2021 +0200 libfdisk: (dos) Fix printing number of CHS sectors in check error message Number of CHS sectors (indexed from zero) is stored in variable 'real_s'. In variable 's' is stored in high 2 bits number of CHS cylinders. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b27ebfe59a414471b4068947291b74e66472ce3a Author: Pali Rohár Date: Mon Jul 5 22:13:11 2021 +0200 libfdisk: (dos) Recalculate number of cylinders after changing number of heads and sectors After geometry is changes it is required to recalculate total number of cylinders. Otherwise total disk capacity is either reduced or extended. Signed-off-by: Pali Rohár libfdisk/src/dos.c | 2 ++ 1 file changed, 2 insertions(+) commit 96209c98e624d9db8f0c72dbed05da4e8da291d1 Author: Todd Lewis Date: Thu Jul 15 09:58:45 2021 -0400 rename: size_t, mutually exclusive parameters Use size_t for strlen-like stuff. Use optutils.h to detect, error out when mutually exclusive flags are given. misc-utils/rename.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) commit cae071ed7264fbbfb03a250a28c78d12e641c51f Author: Karel Zak Date: Thu Jul 15 12:51:39 2021 +0200 login: add callback for close_range() Let's make it more robust for old kernels where is no close_range() or in cases when it's unsuccessful. Reported-by: Florian Weimer Signed-off-by: Karel Zak include/fileutils.h | 2 -- lib/fileutils.c | 8 +++----- login-utils/login.c | 5 ++--- 3 files changed, 5 insertions(+), 10 deletions(-) commit 913829559b19a6a13e3574a3e0746410a7005ffb Author: Karel Zak Date: Thu Jul 15 12:24:07 2021 +0200 lslogins: consolidate and optimize utmp files use * the original read_utmp() code is from GPLv3+, but lslogins is GPLv2+ (see https://github.com/karelzak/util-linux/commit/a6bf40ee77a85f5108208dc764b5d023a07998f5#commitcomment-53407151) * remove redundant parse_btmp() and parse_wtmp() as it does not provide anything * reduce realloc() calls, allocate all in one step Signed-off-by: Karel Zak login-utils/lslogins.c | 79 ++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 41 deletions(-) commit 5b65b68cd8c57766e236a47500f969fee4230772 Merge: be199d34f 88c197c69 Author: Karel Zak Date: Thu Jul 15 10:20:09 2021 +0200 Merge branch 'fdisk-tests-more-details' of https://github.com/pali/util-linux * 'fdisk-tests-more-details' of https://github.com/pali/util-linux: tests: fdisk: Layout with more details commit b0e402c354bffed699e66b9eed870c9381a48288 Author: Todd Lewis Date: Thu Jul 15 01:34:00 2021 -0400 rename: stop after count changes misc-utils/rename.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a2b23d3a91f8f50a64008ba5cda0a71ed020d1db Author: Todd Lewis Date: Thu Jul 15 00:15:55 2021 -0400 rename: add --all and --last parameters Renaming files with rename often involves multiple passes in order to, say, replace all spaces with underscores because traditionally rename only replaces the first occurrence of the expression. The --all parameter makes this task simple. With the addition of --last, rename becomes much safer to use when replacing file extensions, whereas before it would mangle a file which had its extension also embedded elsewhere in its name. The implied --first, together with --all and --last, round out the common cases for renaming files. bash-completion/rename | 2 +- misc-utils/rename.1.adoc | 6 ++++++ misc-utils/rename.c | 46 ++++++++++++++++++++++++++++++++++++--------- tests/expected/rename/basic | 14 ++++++++++++++ tests/ts/rename/basic | 30 +++++++++++++++++++++++++++++ 5 files changed, 88 insertions(+), 10 deletions(-) commit be199d34f2698119ea03b4d583421cabcd565980 Author: Karel Zak Date: Wed Jul 14 17:51:07 2021 +0200 hardlink: remove pcre2posix.h support It's deprecated for years. Let's rely on old good libc regex.h for now. Signed-off-by: Karel Zak configure.ac | 8 -------- meson.build | 6 ------ misc-utils/Makemodule.am | 4 ---- misc-utils/hardlink.c | 9 +-------- 4 files changed, 1 insertion(+), 26 deletions(-) commit b8d99a618baffb4fc03cda4c40e29778b6d77ad4 Author: Karel Zak Date: Wed Jul 14 17:25:57 2021 +0200 login: fix close_range() use This new syscall comes with three arguments (see kernel commit 278a5fbaed89dacd04e9d052f4594ffd0e0585de). Not sure why util-linux assume only two. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1981729 Signed-off-by: Karel Zak include/fileutils.h | 4 ++-- lib/fileutils.c | 2 +- login-utils/login.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) commit 50a3c3bd28047dbcfdda3b4da99110279eb76ac4 Author: Karel Zak Date: Wed Jul 14 16:18:20 2021 +0200 tests: update sfdisk reorder test References: commit f05a5bb2c2e62d3753f8c9262b9f6cbf469e5b0 Signed-off-by: Karel Zak tests/expected/sfdisk/gpt-reorder | 1 + 1 file changed, 1 insertion(+) commit a0b07d9f2e02702573e6eb75df65610327b27681 Author: Karel Zak Date: Wed Jul 14 16:13:21 2021 +0200 tests: skip if scsi_debug model file is not accessible * do not print grep(1) info message * use ts_skip rather than ts_die when scsi_debug is useless Fixes: https://github.com/karelzak/util-linux/issues/1376 Signed-off-by: Karel Zak tests/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 90a1baf9a72454140a370a35c8dc42bd0dddac24 Author: Karel Zak Date: Wed Jul 14 15:57:00 2021 +0200 tools/git-version-gen: use NEWS as a fallback * define ".tarball-version" as the default if not specified by $1 * try read the version string from NEWS file as a fallback if the git-repository or .tarball-version is not available Fixes: https://github.com/karelzak/util-linux/issues/1381 Signed-off-by: Karel Zak tools/git-version-gen | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) commit cd313d30952ec43554fde087a86087b615124825 Merge: 902ecb708 c3f10636e Author: Karel Zak Date: Wed Jul 14 12:23:52 2021 +0200 Merge branch 'fat' of https://github.com/pali/util-linux * 'fat' of https://github.com/pali/util-linux: libblkid: vfat: Fix reading FAT32 boot label libblkid: vfat: Fix reading FAT16 boot label and serial id commit 902ecb708ed9367d65adf95ce097097f7cf75996 Merge: a8c4f2f9a f05a5bb2c Author: Karel Zak Date: Wed Jul 14 12:21:54 2021 +0200 Merge branch 'reorder' of https://github.com/pali/util-linux * 'reorder' of https://github.com/pali/util-linux: fdisk: move reorder diag messages to fdisk_reorder_partitions() fdisk: do not print error message when partition reordering is not needed commit a8c4f2f9a90dadf671df6a16535e461b72e24e23 Merge: d6abaa027 c9c5933a3 Author: Karel Zak Date: Wed Jul 14 12:20:30 2021 +0200 Merge branch 'verity_sig_extension' of https://github.com/bluca/util-linux * 'verity_sig_extension' of https://github.com/bluca/util-linux: mount: fix roothash signature extension in manpage commit d6abaa02715b79b2c79ecc729485881558ccf0b4 Merge: 4f16e3bc8 e6a4b4a16 Author: Karel Zak Date: Wed Jul 14 12:19:49 2021 +0200 Merge branch 'meson_verity' of https://github.com/bluca/util-linux * 'meson_verity' of https://github.com/bluca/util-linux: meson: fix dlopen support for cryptsetup meson: fix crypt_activate_by_signed_key detection commit 4f16e3bc81fa8830fb22097272acc4c35019cd22 Merge: 4ca2ee33b 5c49a482a Author: Karel Zak Date: Wed Jul 14 12:18:08 2021 +0200 Merge branch 'verity_corruption' of https://github.com/bluca/util-linux * 'verity_corruption' of https://github.com/bluca/util-linux: verity: fix verity.roothashsig only working as last parameter verity: add support for corruption action flag build-sys: display cryptsetup status after ./configure commit 4ca2ee33b4193af7629ff93d47cec1311f3b8b89 Author: Karel Zak Date: Wed Jul 14 10:25:33 2021 +0200 tests/eject: check for root perms at beginning Signed-off-by: Karel Zak tests/ts/eject/umount | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a3c2f259e09127fa4a130b73da528d204ea64074 Merge: c2ca2837a dd956268b Author: Karel Zak Date: Wed Jul 14 10:21:20 2021 +0200 Merge branch 'test' of https://github.com/rossburton/util-linux * 'test' of https://github.com/rossburton/util-linux: test/eject: guard asan LD_PRELOAD with use-system-commands check commit f05a5bb2c2e62d3753f8c9262b9f6cbf469e5b0e Author: Pali Rohár Date: Tue Jul 13 00:40:00 2021 +0200 fdisk: move reorder diag messages to fdisk_reorder_partitions() The function fdisk_reorder_partitions() is also used in sfdisk and cfdisk and these commands assume info/warn messages from the library. So move all messages from fdisk to fdisk_reorder_partitions(). Signed-off-by: Pali Rohár disk-utils/fdisk-menu.c | 11 ----------- libfdisk/src/label.c | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 12 deletions(-) commit 5c49a482a9a9f93e8eed4f0882552855c4330c89 Author: Luca Boccassi Date: Sun Jul 11 18:14:40 2021 +0100 verity: fix verity.roothashsig only working as last parameter Parsing of verity.roothashsig did not take into consideration that other options might follow, and used the whole string as a file path. But mnt_optstr_get_option just returns a pointer in the mount option string, it doesn't extract it, so it would have other subsequent options too. The length parameter has to be used. Signed-off-by: Luca Boccassi libmount/src/context_veritydev.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit ce02babfa6f55b1fd4b62875e6accfd39a4cdedd Author: Luca Boccassi Date: Fri Jul 2 18:51:41 2021 +0100 verity: add support for corruption action flag Add verity.oncorruption= to let users override the default kernel behaviour, using libcrypsetup's relevant flags. Signed-off-by: Luca Boccassi libmount/src/context_veritydev.c | 27 +++++++++++++++++++++++++-- libmount/src/libmount.h.in | 1 + libmount/src/optmap.c | 1 + sys-utils/mount.8.adoc | 3 +++ 4 files changed, 30 insertions(+), 2 deletions(-) commit 88c197c690a9e123e6d7d0735cb30711c2b2f85d Author: Pali Rohár Date: Wed Jul 7 00:56:21 2021 +0200 tests: fdisk: Layout with more details Use fdisk -x instead of fdisk -l for printing layout in fdisk tests. This can help debugging why some fdisk tests fail. Signed-off-by: Pali Rohár tests/expected/fdisk/bsd_1_0.LE | 10 ++-- tests/expected/fdisk/mbr-dos-mode | 62 +++++++++++----------- .../fdisk/mbr-nondos-mode-1nd-primary-delete | 8 +-- tests/expected/fdisk/mbr-nondos-mode-1st-active | 4 +- tests/expected/fdisk/mbr-nondos-mode-1st-primary | 4 +- .../fdisk/mbr-nondos-mode-1st-primary-delete | 10 ++-- .../fdisk/mbr-nondos-mode-1st-primary-recreate | 4 +- tests/expected/fdisk/mbr-nondos-mode-2nd-primary | 6 +-- tests/expected/fdisk/mbr-nondos-mode-extended | 8 +-- .../fdisk/mbr-nondos-mode-first-sector-at-end | 10 ++-- tests/expected/fdisk/mbr-nondos-mode-logical | 16 +++--- .../expected/fdisk/mbr-nondos-mode-logical-delete | 10 ++-- .../fdisk/mbr-nondos-mode-logical-recreate | 12 ++--- tests/expected/fdisk/mbr-sort | 46 ++++++++-------- tests/expected/fdisk/sunlabel | 58 ++++++++++++++++---- tests/ts/fdisk/bsd | 2 +- tests/ts/fdisk/mbr-dos-mode | 2 +- tests/ts/fdisk/mbr-nondos-mode | 2 +- tests/ts/fdisk/mbr-sort | 2 +- tests/ts/fdisk/oddinput | 6 +-- tests/ts/fdisk/sunlabel | 12 ++--- 21 files changed, 165 insertions(+), 129 deletions(-) commit b948bbf991a2b019a94bba980b248a80a99f468f Author: Pali Rohár Date: Tue Jul 6 15:35:25 2021 +0200 fdisk: do not print error message when partition reordering is not needed Option 'f' currently prints following RED error message: Nothing to do. Ordering is correct already. Failed to fix partitions order. This change removes RED error message when ordering is already correct. Signed-off-by: Pali Rohár disk-utils/fdisk-menu.c | 11 +++++++++-- libfdisk/src/dos.c | 4 +--- libfdisk/src/gpt.c | 4 +--- 3 files changed, 11 insertions(+), 8 deletions(-) commit c3f10636ef925dda5ec4b622a728a807a2f54749 Author: Pali Rohár Date: Mon Jul 5 15:10:51 2021 +0200 libblkid: vfat: Fix reading FAT32 boot label FAT32 can be formatted with boot sign 0x28 to indicate that only serial id is present or with boot sign 0x29 which indicates that both boot label and serial id is present. Signed-off-by: Pali Rohár libblkid/src/superblocks/vfat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 575b559254a48751e916e8814b2c631335825705 Author: Pali Rohár Date: Mon Jul 5 15:09:12 2021 +0200 libblkid: vfat: Fix reading FAT16 boot label and serial id Older FAT16 variants do not have to contain boot label or serial id. Boot sign 0x28 indicates that only serial id is present and boot sign 0x29 indicates that both boot label and serial id is present. Other boot sign values (e.g. zero) indicates older FAT16 variant without boot label and boot sign. Signed-off-by: Pali Rohár libblkid/src/superblocks/vfat.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) commit c9c5933a386fe340964018c1b880b72171f213c9 Author: Luca Boccassi Date: Sat Jul 3 12:15:53 2021 +0100 mount: fix roothash signature extension in manpage The PKCS7 RFC recommends to use .p7s for detached signatures file extensions, so use that in the example. https://datatracker.ietf.org/doc/html/rfc5751#section-3.2.1 sys-utils/mount.8.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e6a4b4a1632ced42a0f577e01d67ebff116592be Author: Luca Boccassi Date: Fri Jul 2 19:44:59 2021 +0100 meson: fix dlopen support for cryptsetup dlopen is treated as a dependency, but that's not quite right, it should be an alternative way to link to libcryptsetup. Search for it only if cryptsetup is not disabled, and if the cryptsetup-dlopen is explicitly set to enabled. If it is, do not link to libcryptsetup. Add cryptsetup support status to the meson summary. libmount/meson.build | 2 +- meson.build | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) commit 5a6e9adfdcbd02cc0ab30d3a820a034b11dfef75 Author: Luca Boccassi Date: Fri Jul 2 19:11:58 2021 +0100 meson: fix crypt_activate_by_signed_key detection It should set HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY, rather than HAVE_CRYPTSETUP which enables the verity features, as it needs to detect the availability of the crypt_activate_by_signed_key API meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 034ca748a154e153595ef050f2dfde971d2bdc9e Author: Luca Boccassi Date: Fri Jul 2 18:09:03 2021 +0100 build-sys: display cryptsetup status after ./configure Signed-off-by: Luca Boccassi configure.ac | 1 + 1 file changed, 1 insertion(+) commit c2ca2837a27a3f1344904037ea691bfdbb288f02 Author: Karel Zak Date: Fri Jul 2 13:12:13 2021 +0200 lscpu: don't use DMI if executed with --sysroot Signed-off-by: Karel Zak sys-utils/lscpu-arm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit ef7eccad5b4e25237baeb2a50ce184f6cc0fc8ea Author: benaryorg Date: Fri Jun 4 12:34:52 2021 +0000 fix #648 by ignoring EINVAL on-remount of proc When using --mount-proc=/some/path then unshare fails if the path provided is not already mounted due to the mount(2) call to change the propagation of the mount. In such a case mount(2) returns EINVAL, which however is used for a variety of other errors. If this error is ignored mistakenly the effects however should be negligible since: 1. the mount of proc afterwards happens regardless, errors of which are not ignored 2. the propagation change of root uses MS_REC, which should already change the propagation of all mounts recursively Furthermore /proc is not touched if --mount-proc specifies a different mount point. This should not cause too much unexpected behaviour due to point 2 from above in any case. Specifying --mount-proc with a different path also means that unshare(3) is not instructed to touch /proc, thus /proc not being touched should not be unexpected. As a side note, if unshare is called with /proc as an (implicit) parameter to --mount-proc then /proc is a stacked mount, meaning if /proc is unmounted within the namespace the host /proc will be visible again, thus not touching /proc with a different parameter does not constitute more information leakage than the alternative, quite contrary it may even be the desired behaviour. Signed-off-by: benaryorg sys-utils/unshare.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) commit dd956268ba89fc1caf83c45c3c495f34d261e0e2 Author: Ross Burton Date: Thu Jul 1 20:44:31 2021 +0100 test/eject: guard asan LD_PRELOAD with use-system-commands check This test tries to add asan to LD_PRELOAD because the just-built eject will call the host /bin/umount, and apparently asan doesn't like this. However, if ldd isn't present, this fails as the path to asan is the error message saying that ldd isn't present. As the asan workaround is only needed when executing the binaries that have just been built and not the system binaries, only use it if the test is on the built binaries. Closes #1373. Signed-off-by: Ross Burton tests/ts/eject/umount | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) commit 867808590094b03fc9cc45e95798d174231dbedf Author: Karel Zak Date: Thu Jul 1 17:06:34 2021 +0200 fstrim: clean return code on --quiet-unsupported This feature is already supported for -a and -A. Let's support it also when FS specified on command line. Addresses: https://github.com/systemd/mkosi/pull/721 Signed-off-by: Karel Zak sys-utils/fstrim.8.adoc | 2 +- sys-utils/fstrim.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) commit effda97409059a549736fd9f24bae6d912534cc7 Merge: 16a1c8dcd b1c71f19e Author: Karel Zak Date: Wed Jun 30 12:39:13 2021 +0200 Merge branch 'tests' of https://github.com/rossburton/util-linux commit 16a1c8dcdfebd283c02dde2fc3f8355ce6979cdf Author: Karel Zak Date: Wed Jun 30 12:25:18 2021 +0200 lsblk: normalize space in SERIAL and MODEL These strings come from HW and udev does not modify it. It seems good idea to clean up it before we print it. Fixes: https://github.com/karelzak/util-linux/issues/1368 Signed-off-by: Karel Zak misc-utils/lsblk-properties.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit b1c71f19ea404e74d36ca5b8fbb0484043cdaef3 Author: Ross Burton Date: Wed Jun 30 11:25:01 2021 +0100 tests: mark ul/ul as a known failure As with ul/basic, this test produces different output when ran under different terminals, which isn't very useful. Set TS_KNOWN_FAIL so that these problems don't cause the test to fail. Signed-off-by: Ross Burton tests/ts/ul/ul | 3 +++ 1 file changed, 3 insertions(+) commit 9c092ff340a059c8a3ca3a7e39a8ca974e4692e2 Merge: 0c409b7b5 55c58c6fd Author: Karel Zak Date: Wed Jun 30 12:07:50 2021 +0200 Merge branch 'kill' of https://github.com/rossburton/util-linux * 'kill' of https://github.com/rossburton/util-linux: tests: check correct log file for errors in blkdiscard test tests: don't hardcode /bin/kill in the kill tests commit 0c409b7b5457ac7341a4046c63b61d0bbce6b81c Author: Karel Zak Date: Wed Jun 30 11:35:45 2021 +0200 libblkid: remove EVMS support "When you discover you're riding a dead horse, the best strategy is to dismount." EVMS is dead since 2006, LVM is the winner. Signed-off-by: Karel Zak libblkid/src/devname.c | 31 ------------------------------- 1 file changed, 31 deletions(-) commit 81d6de9166be0377458b91c2f636baf9315c56c6 Author: Huang Shijie Date: Thu Jun 17 12:41:16 2021 +0000 lscpu: remove the old code The file "/sys/firmware/dmi/tables/DMI" always exists. The dmi_decode_cputype() can provide more information then arm_smbios_decode(). So remove it to tidy the code. Before this patch, we can get the output from Centos 7.9 who has "/sys/firmware/dmi/entries/4-0/raw" and "/sys/firmware/dmi/tables/DMI": ---------------------------------------------------- BIOS Vendor ID: Ampere(TM) Model name: Neoverse-N1 BIOS Model name: Ampere(TM) Altra(TM) Processor ---------------------------------------------------- After this patch which uses "/sys/firmware/dmi/tables/DMI", in Centos 7.9, we get: ---------------------------------------------------- BIOS Vendor ID: Ampere(TM) Model name: Neoverse-N1 BIOS Model name: Ampere(TM) Altra(TM) Processor Q00-00 CPU @ 2.8GHz BIOS CPU family: 257 ---------------------------------------------------- Signed-off-by: Huang Shijie sys-utils/lscpu-arm.c | 46 +--------------------------------------------- sys-utils/lscpu.h | 1 - 2 files changed, 1 insertion(+), 46 deletions(-) commit 55c58c6fd3c70197c85be87ac46058ce36f1f559 Author: Ross Burton Date: Tue Jun 29 18:10:40 2021 +0100 tests: check correct log file for errors in blkdiscard test When checking if the discard ioctl is supported, look in stderr not stdout as that is where the error appears. Signed-off-by: Ross Burton tests/ts/blkdiscard/offsets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 93ed220b134cbd38be820c7e502a32d8a2cffcbb Author: Ross Burton Date: Tue Jun 29 16:34:20 2021 +0100 tests: don't hardcode /bin/kill in the kill tests If the 'kill' test is executed with --use-system-commands, it calls /bin/kill to avoid the shell's own kill command being invoked. However, this doesn't work if the kill we want to test isn't in fact in /bin. Instead, use $(which kill) to find a kill on the PATH and call that directly. Signed-off-by: Ross Burton tests/ts/kill/all_processes | 2 +- tests/ts/kill/name_to_number | 2 +- tests/ts/kill/options | 2 +- tests/ts/kill/print_pid | 2 +- tests/ts/kill/queue | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) commit 5efc31f9d8c7c95a2895e8d10052be11a66ec569 Author: Karel Zak Date: Fri Jun 25 12:58:51 2021 +0200 cfdisk: optimize mountpoint detection for PARTUUID Don't check fstab (and udev symplinks) for new UUIDs. Fixes: https://github.com/karelzak/util-linux/issues/1331 Signed-off-by: Karel Zak disk-utils/cfdisk.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) commit 35a9b0d5772efb815e3a0ff04f21a7afd0bcdd8f Merge: ccedcc55e da277d4ef Author: Karel Zak Date: Fri Jun 25 11:47:06 2021 +0200 Merge branch 'fix_mount_fscontext' of https://github.com/tweksteen/util-linux * 'fix_mount_fscontext' of https://github.com/tweksteen/util-linux: mount.8.adoc: Remove context options exclusion commit ccedcc55e1fe7b5d6c5b43340fb7f855f8659e56 Author: Karel Zak Date: Fri Jun 25 11:05:21 2021 +0200 hexdump: do not use atoi() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak text-utils/hexdump-parse.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) commit 0461279ab3a1530a77619b700a2d20a6d80169f7 Author: Karel Zak Date: Fri Jun 25 10:24:35 2021 +0200 pg: do not use atoi() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak text-utils/pg.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 1d5c14ae1a6597807f214b2eb50c0eebad75ed24 Author: Karel Zak Date: Thu Jun 24 16:42:53 2021 +0200 misc: improve string to number conversions Signed-off-by: Karel Zak disk-utils/fsck.c | 5 ++--- sys-utils/eject.c | 6 +++--- sys-utils/lscpu-cputype.c | 4 ++-- text-utils/pg.c | 15 +++++++-------- 4 files changed, 14 insertions(+), 16 deletions(-) commit 9fc0f69c255ccd62e5841c6376285e3de8f009b6 Author: Karel Zak Date: Thu Jun 24 16:36:58 2021 +0200 include/strutils: consolidate string to number conversion Signed-off-by: Karel Zak include/strutils.h | 23 ++++--- lib/strutils.c | 171 ++++++++++++++++++++++++----------------------------- 2 files changed, 90 insertions(+), 104 deletions(-) commit 86f05d3946193c447bc8f9120d7046f92da54209 Author: Karel Zak Date: Wed Jun 23 11:37:31 2021 +0200 more: fix null-pointer dereference The command allows executing arbitrary shell commands while viewing a file by entering '!' followed by the command. Entering a command that contains a '%', '!', or '\' causes a segmentation violation. The same more(1) function has a problem when not file is specified (cat /etc/passwd | more) on command line. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1975153 Signed-off-by: Karel Zak text-utils/more.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit b4533177aeac287e0b0563cd1b9ee61bce29ee88 Author: Karel Zak Date: Tue Jun 22 17:26:11 2021 +0200 agetty: do not use atol() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak term-utils/agetty.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 24c17c629484d6efb48e6c38a6ddd5efdc672798 Author: Karel Zak Date: Tue Jun 22 17:06:46 2021 +0200 lscpu: do not use atoi() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak sys-utils/lscpu-cputype.c | 20 ++++++++++++++++++-- sys-utils/lscpu-topology.c | 7 ++++++- 2 files changed, 24 insertions(+), 3 deletions(-) commit 55cbb788f8ff25737f66dc8d40e654e9594341f6 Author: Karel Zak Date: Tue Jun 22 16:50:46 2021 +0200 utmpdump: do not use atoi() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak login-utils/utmpdump.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit cfc0d463b43249eb2e977cf80a3ee333a5d6fb81 Author: Karel Zak Date: Tue Jun 22 16:16:38 2021 +0200 swapon: do not use atoi() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak sys-utils/swapon.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit 70bce9b32f6e1b5f4c46b27553800db0296b341e Author: Karel Zak Date: Tue Jun 22 15:19:22 2021 +0200 ipcs: do not use atoi() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak sys-utils/ipcs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a1b3e2ec9d13070bccc51ccf64c8cd634ae3d172 Author: Karel Zak Date: Tue Jun 22 15:15:46 2021 +0200 eject: do not use atoi() * remove unnecessary strtok() use * remove atoi use() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak sys-utils/eject.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit 2ce856993b5479e0265431eb6ccd576f6681a993 Author: Karel Zak Date: Tue Jun 22 14:42:56 2021 +0200 fsck: do not use atoi() Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak disk-utils/fsck.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 84825b161ba5d18da4142893b9789b3fc71284d9 Author: Karel Zak Date: Tue Jun 22 14:20:42 2021 +0200 include/strutils: cleanup strto..() functions * add ul_strtos64() and ul_strtou64() * add simple test Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak include/strutils.h | 3 + lib/strutils.c | 174 +++++++++++++++++++++++++++++++---------------------- 2 files changed, 105 insertions(+), 72 deletions(-) commit 4077526856e4957235f1c4f7bb73214d6d803872 Author: Karel Zak Date: Tue Jun 22 12:32:58 2021 +0200 blockdev: improve arguments parsing (remove atoi) old version: # blockdev --setfra 4x096 /dev/sdc new version: # blockdev --setfra 4x096 /dev/sdc blockdev: failed to parse command argument: '4x096' Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak disk-utils/blockdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 94a5b2e84fba0545ba5485c04b671185895584ce Author: Karel Zak Date: Tue Jun 22 11:50:06 2021 +0200 cfdisk: do not use atoi() It's unnecessary to use atoi in this case. Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak disk-utils/cfdisk.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 3e5e56eb0ad620adfd1c26e1a9b3a09a59154165 Author: Karel Zak Date: Mon Jun 21 15:37:48 2021 +0200 readprofile: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak sys-utils/Makemodule.am | 1 + sys-utils/readprofile.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) commit 95bfc92361819a4aaba528245f7077944f925087 Author: Karel Zak Date: Mon Jun 21 15:34:06 2021 +0200 wipefs: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak misc-utils/wipefs.c | 3 +++ 1 file changed, 3 insertions(+) commit 93d01a6233ad51d7f97ae6c78d9216f77b97b113 Author: Karel Zak Date: Mon Jun 21 15:33:36 2021 +0200 lslocks: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak misc-utils/lslocks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit f1de6d6526425ced227cead1e4914a59368cf16c Author: Karel Zak Date: Mon Jun 21 15:32:51 2021 +0200 kill: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak misc-utils/kill.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 2fc2bb7ebd30b25403447fea63dd5f7e69652f44 Author: Karel Zak Date: Mon Jun 21 15:31:43 2021 +0200 lslogins: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak login-utils/lslogins.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit d8a42b67c838418952799cd9f7f3a09b1f878a81 Author: Karel Zak Date: Mon Jun 21 15:29:43 2021 +0200 fsck: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak disk-utils/fsck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit fe4e122ab3378dfadaf60c61d0e893be5df1c199 Author: Karel Zak Date: Mon Jun 21 15:29:33 2021 +0200 lsmem: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak sys-utils/chmem.c | 9 ++++++++- sys-utils/lsmem.c | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) commit 35d458708e0b1496e586a9be4d07289577cb46c9 Author: Karel Zak Date: Mon Jun 21 15:00:40 2021 +0200 lscpu: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak sys-utils/lscpu-virt.c | 3 +++ 1 file changed, 3 insertions(+) commit 9bf8088f258a9b213886e3c663b8e57a3b65bfd3 Author: Karel Zak Date: Mon Jun 21 15:00:40 2021 +0200 hwclock: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak sys-utils/hwclock-rtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit c9eea1b354297309c4da8f5c2fee663ef1a6e221 Author: Karel Zak Date: Mon Jun 21 15:00:40 2021 +0200 ipcs: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak sys-utils/ipcmk.c | 7 ++++++- sys-utils/ipcrm.c | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) commit b0cfd4ba3a676b9c8e3ce50659d419c71aba1cc4 Author: Karel Zak Date: Mon Jun 21 15:00:40 2021 +0200 libuuid: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak libuuid/src/parse.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) commit 5aa726461a997044bb9d32ad8e9e2bbccabb79de Author: Karel Zak Date: Mon Jun 21 15:00:40 2021 +0200 libmount: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak libmount/python/pylibmount.c | 3 +++ libmount/src/context_veritydev.c | 3 ++- libmount/src/tab_parse.c | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) commit 0395e8f7d73564eb762b5cef4b1602192891b62b Author: Karel Zak Date: Mon Jun 21 15:00:40 2021 +0200 libblkid: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak libblkid/src/partitions/partitions.c | 3 ++- libblkid/src/probe.c | 4 ++++ libblkid/src/read.c | 17 +++++++++++++---- 3 files changed, 19 insertions(+), 5 deletions(-) commit da277d4eff9899f189a270cf35741087728d2c8c Author: Thiébaud Weksteen Date: Mon Jun 21 14:15:16 2021 +0200 mount.8.adoc: Remove context options exclusion The exclusivity between the {fscontext, defcontext} and context options was removed in kernel 2.6.25[1]. No specific verification on these options is done in mount(8)[2]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9180a57a9ab2d5525faf8815a332364ee9e89b7 [2] https://github.com/karelzak/util-linux/blob/master/libmount/src/context_mount.c#L202 sys-utils/mount.8.adoc | 2 -- 1 file changed, 2 deletions(-) commit 1293b0f65db1f219a6e1671c96eeec1d3957cf81 Author: Karel Zak Date: Mon Jun 21 12:40:41 2021 +0200 misc: consolidate stat() error message Let's use the same error message everywhere to reduce number of strings for translators. Signed-off-by: Karel Zak sys-utils/unshare.c | 2 +- text-utils/more.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit c6f36329057cc676725fdf80414ea7b80dcfaad1 Author: Karel Zak Date: Mon Jun 21 12:39:33 2021 +0200 fsck.cramfs: use open+fstat rather than stat+open Fixes: https://github.com/karelzak/util-linux/issues/1353 Signed-off-by: Karel Zak disk-utils/fsck.cramfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 17fc8693cd60733227204fe31395575778984e3c Author: Karel Zak Date: Mon Jun 21 12:25:31 2021 +0200 include/c: add drop_permissions(), consolidate UID/GID reset Fixes: https://github.com/karelzak/util-linux/issues/1354 Signed-off-by: Karel Zak include/c.h | 24 ++++++++++++++++++++++++ lib/canonicalize.c | 3 +-- libblkid/src/topology/dm.c | 5 +---- libblkid/src/topology/lvm.c | 5 +---- libmount/src/context_mount.c | 5 +---- libmount/src/context_umount.c | 5 +---- sys-utils/eject.c | 8 ++------ sys-utils/mount.c | 9 ++------- sys-utils/swapon.c | 9 ++------- sys-utils/umount.c | 9 ++------- text-utils/more.c | 9 +++------ 11 files changed, 40 insertions(+), 51 deletions(-) commit 0272f2ef98d3e0641cee16dfc9fc30c27636c2e4 Author: Karel Zak Date: Fri Jun 18 17:57:13 2021 +0200 dmesg: remove condition [lgtm scan] Signed-off-by: Karel Zak sys-utils/dmesg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b366e69b8290bb2e588c45a4ee6907b8f4a198d6 Author: Huang Shijie Date: Fri Jun 18 12:46:32 2021 +0000 lscpu: add more sanity checks for dmi_decode_cputype() After tested on different platforms, we found dmi_string() may return NULL in some case. So add more sanity checks for dmi_decode_cputype(). Signed-off-by: Huang Shijie sys-utils/lscpu-dmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 6eb184299eb9fc095e1b34899e71da13e16e3ce2 Author: Karel Zak Date: Fri Jun 18 17:37:38 2021 +0200 tools: report and use LDFLAGS in tools/config-gen Signed-off-by: Karel Zak tools/config-gen | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit 75cba8d5cdb2a0e84c23de26007feac977837a6f Author: Karel Zak Date: Fri Jun 18 17:21:13 2021 +0200 build-sys: use $LIBS rather than LDFLAGS Fixes: https://github.com/karelzak/util-linux/pull/1349 Signed-off-by: Karel Zak configure.ac | 8 ++++---- m4/ul.m4 | 29 +++++++++++------------------ 2 files changed, 15 insertions(+), 22 deletions(-) commit 5a8261020b58ef4c488600d3115e2b0fd2c0f4c8 Author: Karel Zak Date: Fri Jun 18 17:02:38 2021 +0200 lib/path: (test) fix ul_new_path() use lib/path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2f38ae595b61f1d5531f47206aeb7289343b1b08 Author: Karel Zak Date: Fri Jun 18 16:58:38 2021 +0200 more: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak text-utils/more.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 0c753d8d6b6c4342f4ede5e8aba1491d9119d010 Author: Karel Zak Date: Fri Jun 18 16:56:52 2021 +0200 wall: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak term-utils/wall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 94e4a414065e2a9fc0e047953b6edff612e8608d Author: Karel Zak Date: Fri Jun 18 16:55:40 2021 +0200 script: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak term-utils/script.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit c7da26744223f78fe938361b4d2c9eee97b8a1d1 Author: Karel Zak Date: Fri Jun 18 16:52:26 2021 +0200 ldattach: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak sys-utils/ldattach.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 365e006a36da56c7fe562bdbad7049513e21b61c Author: Karel Zak Date: Fri Jun 18 16:50:58 2021 +0200 hwclock: fix ul_path_scanf() use Signed-off-by: Karel Zak sys-utils/hwclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ddadf4748deb677fd06baeb987d358853ec303e9 Author: Karel Zak Date: Fri Jun 18 16:49:28 2021 +0200 eject: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak sys-utils/eject.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit e71d44a4592ba6c4317de5a57a729d6a97955e0b Author: Karel Zak Date: Fri Jun 18 16:42:07 2021 +0200 logger: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak misc-utils/logger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit fbae144212dfd269f7dccf30db3444f00cd0187b Author: Karel Zak Date: Fri Jun 18 16:41:20 2021 +0200 libfdisk: add and fix __format__ attributes Reported-by: Jan Pazdziora Signed-off-by: Karel Zak disk-utils/cfdisk.c | 49 ++++++++++++++++++++++++++++++---------------- disk-utils/fdisk-list.c | 16 +++++++-------- disk-utils/sfdisk.c | 4 ++-- libfdisk/src/dos.c | 22 +++++++++++---------- libfdisk/src/gpt.c | 13 ++++++------ libfdisk/src/libfdisk.h.in | 9 ++++++--- libfdisk/src/sgi.c | 5 +++-- libfdisk/src/sun.c | 8 ++++---- 8 files changed, 74 insertions(+), 52 deletions(-) commit ea75960d6c5cae773d4d990d4ed8f87b48e356c4 Author: Karel Zak Date: Fri Jun 18 16:35:33 2021 +0200 findmnt: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit b77e3e34bf9508b52d1cd3b51dffb94001194fa1 Author: Karel Zak Date: Fri Jun 18 16:34:20 2021 +0200 libmount: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak libmount/src/context.c | 2 +- libmount/src/mountP.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) commit 40b55f5a29343cd477688676f094f10750e3f2de Author: Karel Zak Date: Fri Jun 18 16:33:16 2021 +0200 include/strutils: fix __format__attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak include/strutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f5771a085cc953bb7535570772df0330c95ad683 Author: Karel Zak Date: Fri Jun 18 16:32:37 2021 +0200 include/path: add __format__attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak include/path.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) commit 01085557eb4677ff2348b546ee6aa1ebed0d8e8b Author: Karel Zak Date: Fri Jun 18 16:29:02 2021 +0200 include/c: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak include/c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8c6fb9841c360d883a90879520bfa8eea499167a Author: Anatoly Pugachev Date: Fri Jun 18 14:45:31 2021 +0200 tests: fix lsns test on kernels without USER namespaces Reported-by: Bruce Dubbs Signed-off-by: Karel Zak tests/ts/lsns/ioctl_ns | 3 +++ 1 file changed, 3 insertions(+) commit 0197bdb2d0138a61bd4dba4d39e4ba2097643a2f Author: Karel Zak Date: Fri Jun 18 14:37:28 2021 +0200 mount.8: fix overlayfs nfs_export= indention Signed-off-by: Karel Zak sys-utils/mount.8.adoc | 80 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 29 deletions(-) commit 627fb946d5bfa832562ed5a736d7beabb48f4761 Merge: d1145efd8 9fd75ae75 Author: Karel Zak Date: Fri Jun 18 12:33:10 2021 +0200 Merge branch 'man-mount-overlayfs' of https://github.com/iam-TJ/util-linux * 'man-mount-overlayfs' of https://github.com/iam-TJ/util-linux: mount: man-page; add all overlayfs options commit d1145efd8ad6e09b44839fc167dc47fdb9c9b0cf Merge: 435545340 89456be77 Author: Karel Zak Date: Fri Jun 18 12:30:32 2021 +0200 Merge branch 'sys-utils_doc_brackets' of https://github.com/usev6/util-linux * 'sys-utils_doc_brackets' of https://github.com/usev6/util-linux: Fix some brackets in synopses commit 4355453406b5f2e7382da065988f67e52cd9ad7c Author: Karel Zak Date: Fri Jun 18 12:25:46 2021 +0200 include/strv: fix format attributes Reported-by: Jan Pazdziora Signed-off-by: Karel Zak include/strv.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 89456be77748fc3942848f00d85fb666347f04cd Author: Christian Bartolomäus Date: Thu Jun 17 22:27:17 2021 +0200 Fix some brackets in synopses disk-utils/fsck.8.adoc | 2 +- disk-utils/sfdisk.8.adoc | 2 +- misc-utils/blkid.8.adoc | 2 +- sys-utils/prlimit.1.adoc | 4 ++-- sys-utils/setarch.8.adoc | 2 +- sys-utils/unshare.1.adoc | 2 +- term-utils/scriptreplay.1.adoc | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) commit 9fd75ae758e8e103934d6be6ad650bf99bc228f2 Author: Tj Date: Thu Jun 17 13:13:22 2021 +0100 mount: man-page; add all overlayfs options The section in man (8) mount for overlay is missing nine options which aren't documented elsewhere either and are useful features to be aware of and use. Fixes #1350. sys-utils/mount.8.adoc | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) commit 637cc045ee464909c261d6fa16c71ed15cd455e3 Author: Alex Xu <351006+Hello71@users.noreply.github.com> Date: Wed Jun 16 13:58:25 2021 +0000 build-sys: Update configure.ac 1. the test incorrectly used AC_COMPILE_IFELSE instead of AC_LINK_IFELSE, defeating the purpose of checking -lcrypt. 2. the test did not properly restore LIBS, causing later checks to all fail if libcrypt wasn't found. 3. HAVE_LIBCRYPT only controls whether to use -lcrypt, it is not needed or used in any source files. [kzak@redhat.com: - improve commit message - use UL_{SET,RESTORE}_FLAGS() rather than directly modify $LIBS] Signed-off-by: Karel Zak configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 9dbae34c3da7667319df2191b4b0fee6552dd0e3 Author: Karel Zak Date: Thu Jun 17 13:28:32 2021 +0200 lib/path: improve ul_path_readlink() to be more robust According to POSIX, readlink() makes no effort to null-terminate buffer with the result. It seems better to hide this disadvantage in the ul_path_...() API rather than assume buf[sz] = '\0' everywhere. Reported-by: Reported-by: Jan Pazdziora Signed-off-by: Karel Zak lib/path.c | 21 +++++++++++++-------- lib/sysfs.c | 11 ++++------- 2 files changed, 17 insertions(+), 15 deletions(-) commit 2384fa6e4d086656ea7ae890d2ac2bdce08ca0e6 Author: Karel Zak Date: Thu Jun 17 13:26:50 2021 +0200 mkfs.cramfs: add comment to explain readlink() use Signed-off-by: Karel Zak disk-utils/mkfs.cramfs.c | 2 ++ 1 file changed, 2 insertions(+) commit 538f010c8f9475d228b8312c319b36c09bfaca21 Author: Karel Zak Date: Thu Jun 17 13:25:43 2021 +0200 rename: use readlink() in more robust way Reported-by: Jan Pazdziora Signed-off-by: Karel Zak misc-utils/rename.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 403cd1086eac381399cb887b17524a1b170e3ae5 Author: Karel Zak Date: Thu Jun 17 13:23:53 2021 +0200 namei: simplify code Signed-off-by: Karel Zak misc-utils/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 19f2cebd489786a81f499d45585494ab9f497f14 Author: Karel Zak Date: Thu Jun 17 12:21:04 2021 +0200 more: fix setuid/setgid order The rule is pretty simple, always use setgid() before setuid(). Reported-by: Jan Pazdziora Signed-off-by: Karel Zak text-utils/more.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8ff8b027828b1201b18af6dd2e37b1d72b45d0f3 Author: Karel Zak Date: Wed Jun 16 15:48:09 2021 +0200 hardlink: small regex stuff refactoring Signed-off-by: Karel Zak misc-utils/hardlink.c | 70 ++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 32 deletions(-) commit d3f77b4b8b93228e5f127b93e63a703317c50914 Author: Karel Zak Date: Wed Jun 16 15:44:02 2021 +0200 sulogin: add missing ifdefs Signed-off-by: Karel Zak login-utils/sulogin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 286865bf7e8286e842bd61ee762e7c50d15f1472 Author: Karel Zak Date: Wed Jun 16 15:39:32 2021 +0200 sulogin: use explicit_bzero() for buffer with password Reported-by: Jan Pazdziora Signed-off-by: Karel Zak login-utils/sulogin.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) commit 59e2df8fe82c54563ee41bcc257d5fca860d9167 Author: Karel Zak Date: Wed Jun 16 15:13:50 2021 +0200 login: remove obsolete and confusing comment Reported-by: Jan Pazdziora Signed-off-by: Karel Zak login-utils/login.c | 1 - 1 file changed, 1 deletion(-) commit 4cae2104ec88890e649b950283fe20af91e9c642 Author: Huang Shijie Date: Tue Jun 15 10:06:39 2021 +0000 lscpu: add bios_family In the arm platform, we do not have the "CPU family" as X86. In the linux kernel, it is hardcode to set the "CPU architecuture:8" which should be changed for arm v9 in future. This patch adds "bios_family" field, which we can get from the DMI table. In the ampere Altra platform, we can get the new lscpu output: ---------------------------------------------------------------- Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 160 On-line CPU(s) list: 0-159 Vendor ID: ARM BIOS Vendor ID: Ampere(R) Model name: Neoverse-N1 BIOS Model name: Ampere(R) Altra(R) Processor Q00-00 CPU @ 3.0GHz BIOS CPU family: 257 Model: 1 Thread(s) per core: 1 ---------------------------------------------------------------- [kzak@redhat.com: - s/sprintf/snprintf/] Signed-off-by: Huang Shijie Signed-off-by: Karel Zak sys-utils/lscpu-cputype.c | 1 + sys-utils/lscpu-dmi.c | 10 ++++++++++ sys-utils/lscpu.c | 2 ++ sys-utils/lscpu.h | 2 ++ 4 files changed, 15 insertions(+) commit a772d7c493afcec32f0123fc947013f74db6e45d Author: Huang Shijie Date: Tue Jun 15 10:06:38 2021 +0000 lscpu: get the processor information by DMI The patch :367c85c47286 ("lscpu: use SMBIOS tables on ARM for lscpu") relies on the existence of "/sys/firmware/dmi/entries/4-0/raw", which may not exist in standard linux kernel. But "/sys/firmware/dmi/tables/DMI" should exist and can provide the required processor information. This patch uses "/sys/firmware/dmi/tables/DMI" to get the processor information: Before this patch, in Ampere Altra platform, the lscpu output is: --------------------------------------------- Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 160 On-line CPU(s) list: 0-159 Vendor ID: ARM Model name: Neoverse-N1 Model: 1 Thread(s) per core: 1 Core(s) per socket: 80 Socket(s): 2 ........................................ --------------------------------------------- After this patch, we can use get the lscpu output in Ampere Altra platform: --------------------------------------------- Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 160 On-line CPU(s) list: 0-159 Vendor ID: ARM BIOS Vendor ID: Ampere(R) Model name: Neoverse-N1 BIOS Model name: Ampere(R) Altra(R) Processor Q00-00 CPU @ 3.0GHz Model: 1 Thread(s) per core: 1 Core(s) per socket: 80 Socket(s): 2 ........................................ --------------------------------------------- [kzak@redhat.com: - s/sprintf/snprintf/] Signed-off-by: Huang Shijie Signed-off-by: Karel Zak sys-utils/lscpu-arm.c | 2 ++ sys-utils/lscpu-dmi.c | 40 ++++++++++++++++++++++++++++++++++++++++ sys-utils/lscpu.h | 7 +++++++ 3 files changed, 49 insertions(+) commit 66e259c746e5dc5db7ac6b67c98b0abbc2ab2e6c Author: Karel Zak Date: Wed Jun 16 10:46:40 2021 +0200 libblkid: fix and cleanup blkid_safe_string() * Don't use 'size_t len' variable for utf8_encoded_valid_unichar() return code as it returns negative numbers on invalid utf8 sequence. * Don't rely only on \0, but check the current position against output buffer size. * Accept hex encoding like the original version. * Use else-if to avoid unnecessary 'continue'. Signed-off-by: Karel Zak libblkid/src/encode.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) commit 8a3a74160b96498d672e3652827aa7e6d7f3a120 Author: Karel Zak Date: Tue Jun 15 12:04:43 2021 +0200 mkswap: fix holes detection (infinite loop and/or stack-buffer-underflow) Reported-by: Brian Lane Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1971877 Fix: https://github.com/karelzak/util-linux/issues/1348 Signed-off-by: Karel Zak disk-utils/mkswap.c | 2 ++ 1 file changed, 2 insertions(+) commit 3e03cb680668e4d47286bc7e6ab43e47bb84c989 Author: Karel Zak Date: Tue Jun 15 10:34:46 2021 +0200 lib/loopdev: perform retry on EAGAIN Suggested-by: Ingo Franzki Signed-off-by: Karel Zak sys-utils/losetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6db368598962ea8b0329ae148ab878fd458f2533 Author: Karel Zak Date: Tue Jun 15 10:25:24 2021 +0200 libblkid: Optimize the blkid_safe_string() function Processing whitespace characters. Allows valid ASCII, valid UTF-8. Replace everything else with '_' Co-Author: changlianzhi Signed-off-by: changlianzhi Signed-off-by: Karel Zak libblkid/src/encode.c | 108 +++++++++++++++----------------------------------- 1 file changed, 31 insertions(+), 77 deletions(-) commit f3e5d34cacf332836af4cd12d5caef897aa6112b Author: Karel Zak Date: Tue Jun 15 10:25:06 2021 +0200 lib/strutils: make test_strutils_normalize() more robust Signed-off-by: Karel Zak lib/strutils.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit c862d0e1774bb78354047ab9b14d355c4e5448ba Author: Karel Zak Date: Mon Jun 14 16:24:59 2021 +0200 lib/strutils: improve normalize_whitespace() Let's make it possible to use the function to normalize the string between two buffers (from source to destination). Signed-off-by: Karel Zak include/strutils.h | 27 +++++++++++++++++++-------- lib/strutils.c | 21 +++++++++++++++------ 2 files changed, 34 insertions(+), 14 deletions(-) commit 38b9be784b58292fc02e1176acf0645d411f5196 Merge: 8153ca8ee 9a06cc233 Author: Karel Zak Date: Mon Jun 14 12:48:08 2021 +0200 Merge branch 'document-selinux-nosuid' of https://github.com/topimiettinen/util-linux * 'document-selinux-nosuid' of https://github.com/topimiettinen/util-linux: mount.8.adoc: document SELinux use of nosuid mount flag commit 9a06cc233c876f55d8ee709bb220db8cd99a572e Author: Topi Miettinen Date: Sat Jun 12 11:34:36 2021 +0300 mount.8.adoc: document SELinux use of nosuid mount flag Using mount flag `nosuid` also affects SELinux domain transitions but this has not been documented well. Signed-off-by: Topi Miettinen sys-utils/mount.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8153ca8eeeef6d7ae88a51ea6c18c956ffbe2986 Author: Platon Pronko Date: Fri Jun 11 21:20:58 2021 +0300 dmesg: fix indentation in man page Double-semicolon at the end of the option line results in description being indented extra tab to the right. Replacing them with double-colons allows all options to be displayed at the same indent level. sys-utils/dmesg.1.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 1e881378d6674abaae5a929f7deff39bb3405c3b Author: Karel Zak Date: Fri Jun 11 15:43:36 2021 +0200 lib/path: fix possible leak when use ul_path_read_string() [coverity scan] Signed-off-by: Karel Zak lib/path.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 3fdb178370d7dbff6637fbfe63a1a7043904c3f5 Author: Karel Zak Date: Fri Jun 11 15:17:42 2021 +0200 hwclock: close adjtime on write error [coverity scan] Signed-off-by: Karel Zak sys-utils/hwclock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 777fe9f5121d553042afb0b24d043117d8e5906a Author: Karel Zak Date: Fri Jun 11 15:10:22 2021 +0200 newgrp: fix memory leak [coverity scan] Signed-off-by: Karel Zak login-utils/newgrp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit fb9ed3b409c05752a06619b2a5f02f5a21b3bb62 Author: Karel Zak Date: Thu Jun 10 13:44:25 2021 +0200 dmesg: fix possible memory leak [coverity scan] Signed-off-by: Karel Zak sys-utils/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a71f7f1173c770e6f5af82509fc8a0fdf3065306 Author: Karel Zak Date: Thu Jun 10 13:35:05 2021 +0200 findmnt: (verify) fix memory leak [asan] Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 3c3f7722ae2cf26c91d0a9e9364c106bc3d3c6bd Author: Karel Zak Date: Thu Jun 10 13:28:35 2021 +0200 findmnt: (verify) fix cache related memory leaks on --nocanonicalize [coverity scan] Signed-off-by: Karel Zak misc-utils/findmnt-verify.c | 47 +++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) commit 60d1f1a329922bdbf6ea6e75bcb08131681dbfe4 Author: Karel Zak Date: Wed Jun 9 16:12:13 2021 +0200 libblkid: check for ioctl macro rather than for header file libblkid/src/probe.c:1012:22: error: ‘BLKGETZONESZ’ undeclared (first use in this function) 1012 | if (!ioctl(pr->fd, BLKGETZONESZ, &zone_size_sector)) | ^~~~~~~~~~~~ Signed-off-by: Karel Zak libblkid/src/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 366063645f9af34faf106058b89699cb77f858e5 Author: Karel Zak Date: Wed Jun 9 16:09:16 2021 +0200 build-sys: make autogen.sh output more user friendly Signed-off-by: Karel Zak autogen.sh | 98 ++++++++++++++++++++++++++------------------------------------ 1 file changed, 41 insertions(+), 57 deletions(-) commit 67735475db2e6da5668f4c21a8736bd3539737aa Author: Karel Zak Date: Wed Jun 9 15:54:09 2021 +0200 build-sys: be verbose about missing gettext Reported-by: Qais Yousef Signed-off-by: Karel Zak autogen.sh | 6 ++++++ 1 file changed, 6 insertions(+) commit 98a586f67229f65691ef1840235eda768505ea06 Author: Karel Zak Date: Wed Jun 9 11:09:33 2021 +0200 lsblk: sort list of columns It's better to maintain sorted list and it's also better for --help output. Signed-off-by: Karel Zak misc-utils/lsblk.c | 188 ++++++++++++++++++++++++++--------------------------- 1 file changed, 91 insertions(+), 97 deletions(-) commit 856457bfcfaa64c90f02f250779a3f171535296f Author: Karel Zak Date: Wed Jun 9 10:57:54 2021 +0200 lsblk: add column START for partition start offsets Fix: https://github.com/karelzak/util-linux/issues/1340 Signed-off-by: Karel Zak misc-utils/lsblk.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 0842c842184130d83c2f34b8a87cb11e4e5c2852 Author: John Baublitz Date: Fri Jun 4 07:02:39 2021 -0400 libblkid: Add hyphens to UUID string representation in Stratis superblock parsing [kzak@redhat.com: - small code cleanup] Signed-off-by: Karel Zak libblkid/src/superblocks/stratis.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) commit 20cc7d100a6407037b06732ffbc81f89833fbe76 Merge: 3f347f956 aa6d42f16 Author: Karel Zak Date: Wed Jun 9 10:32:23 2021 +0200 Merge branch 'fix-display-signed-char' of https://github.com/Ram-Z/util-linux * 'fix-display-signed-char' of https://github.com/Ram-Z/util-linux: hexdump: correctly display signed single byte integers commit aa6d42f16f22fbe015485a60fa74222b28e3147e Author: Samir Benmendil Date: Wed Jun 9 01:21:46 2021 +0100 hexdump: correctly display signed single byte integers When using the format string '/1 "%d"', the byte did not display as a signed integer as expected, it was interpreted as unsigned. text-utils/hexdump-display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 3f347f956aa8884ed5f4cc38937f3c28352fbeeb Author: ratijas Date: Tue Jun 8 19:12:19 2021 +0300 lsblk: fix formatting in -e option misc-utils/lsblk.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6da826a521e2bfec5f239ea9229a0e707583271c Author: Qais Yousef Date: Mon Jun 7 17:11:11 2021 +0100 uclampset: Fix left over optind++ The code was changed to use ':' in getopt_long() but these were left over by mistake causing weird random errors when using these options depending on the order they were fed. Signed-off-by: Qais Yousef schedutils/uclampset.c | 3 --- 1 file changed, 3 deletions(-) commit 63e523a151b1cdb135bee9edd402de6d294922f9 Author: Nicolai Dagestad Date: Sun Jun 6 18:28:35 2021 +0200 rfkill: Set scols table name to make the json output valid [kzak@redhat.com: - s/rfkill/rfkilldevices/] Fixes: https://github.com/karelzak/util-linux/issues/1339 Signed-off-by: Nicolai Dagestad Signed-off-by: Karel Zak sys-utils/rfkill.c | 1 + 1 file changed, 1 insertion(+) commit 0d281926a32c6ed6a37459888290a095dc79678f Author: Karel Zak Date: Mon Jun 7 10:32:20 2021 +0200 libsmartcols: fix bare array on JSON output The bare array ({[...]}) for top level list of entries is invalid. It seems better to print empty string than nothing. This is workaround for broken utils, better is to define a table name. Addresses: https://github.com/karelzak/util-linux/issues/1339 Signed-off-by: Karel Zak libsmartcols/src/print-api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1a30b2bd5e02d71284bd3d06e17fb855a1e2d35e Author: Karel Zak Date: Fri Jun 4 11:42:03 2021 +0200 build-sys: make re-use of generated man-pages more robust We need to ignore man-pages at all if not available (not generated yet), but asciidoctor is not installed. Fix: https://github.com/karelzak/util-linux/issues/1334 Signed-off-by: Karel Zak Makefile.am | 8 +++++++- configure.ac | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) commit 780f0f81833e7bec48c3e18a48a214ea47b259f3 Merge: daf9f2e99 45cd3aa4d Author: Karel Zak Date: Thu Jun 3 12:25:35 2021 +0200 Merge branch 'nortas' of https://github.com/gyakovlev/util-linux * 'nortas' of https://github.com/gyakovlev/util-linux: lscpu: fix build on powerpc commit daf9f2e997d5919af0ae58537ca889e882715737 Author: Karel Zak Date: Thu Jun 3 12:17:27 2021 +0200 build-sys: add generated man-pages to distribution tarball Signed-off-by: Karel Zak Makefile.am | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 45cd3aa4ded6df54dde85e6939b48bb273c8b6c3 Author: Georgy Yakovlev Date: Wed Jun 2 13:59:26 2021 -0700 lscpu: fix build on powerpc fails with error: label at end of compound statement and fix typo as bonus. Signed-off-by: Georgy Yakovlev sys-utils/lscpu-cputype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 308a15c71c387f7d0b23389a4f0b185479186a36 Author: Karel Zak Date: Wed Jun 2 15:31:39 2021 +0200 build-sys: add missing header Signed-off-by: Karel Zak include/Makemodule.am | 1 + 1 file changed, 1 insertion(+) commit 1775aaf1d7465102eab2b51c0e9c2797cdf08189 Author: Karel Zak Date: Wed Jun 2 13:32:43 2021 +0200 lsblk: use ID_MODEL_ENC is possible Fix: https://github.com/karelzak/util-linux/issues/1098 Signed-off-by: Karel Zak misc-utils/lsblk-properties.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 0e54ac39804d71c94f59b411df6e833bbd88e030 Author: Karel Zak Date: Wed Jun 2 13:09:28 2021 +0200 lscpu: remove extra blank lines Signed-off-by: Karel Zak sys-utils/lscpu.c | 6 ------ 1 file changed, 6 deletions(-) commit 79884c5dd18588fffcd0644d71172374d598305f Merge: ac55a4130 87579a96b Author: Karel Zak Date: Wed Jun 2 13:06:10 2021 +0200 Merge branch 'lscpu-json-types' of https://github.com/t-8ch/util-linux * 'lscpu-json-types' of https://github.com/t-8ch/util-linux: lscpu: use optional json values libsmartcols: add support for optional boolean values lscpu: use json types commit ac55a4130fcdab12ee6a49f8a8ebd6a17c1890df Merge: 902d21641 684f921ec Author: Karel Zak Date: Wed Jun 2 12:33:07 2021 +0200 Merge branch 'next' * next: (26 commits) build-sys: add script to compare config.h from meson and autotools meson: add missing header files check docs: update TODO tests: update lscpu outputs lscpu: read MHZ from /sys/.../cpufreq/scaling_cur_freq lscpu: use locale-independent strtod() when read from kernel lib/c_strtod; add locale independent strtod() tests: update lscpu output lscpu: use MHZ as number to be locale sensitive lscpu: add SCALMHZ% and "CPU scaling MHz:" sulogin: fix whitespace error sulogin: ignore none-existing console devices lsns: fix old error message lsns: fix copy & past in man page lsns: fill UID and USER columns for interpolated namespaces fixup! lsns: interpolate missing namespaces for converting forests to a tree lsns: interpolate missing namespaces for converting forests to a tree lsns: reorganize members specifying other namespaces in lsns_namespace lsns: make namespace having no process printable libblkid: support zone reset for wipefs ... commit 902d2164124505ee9958c160de5bbda3ab7ab4c5 Author: Karel Zak Date: Wed Jun 2 12:19:06 2021 +0200 mount: use mnt_fs_is_regularfs() Signed-off-by: Karel Zak sys-utils/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 868cd0dc0ad1417d86ced7872d38f9bf453aac56 Author: Karel Zak Date: Wed Jun 2 12:16:14 2021 +0200 fsck: use mnt_fs_is_regularfs() Signed-off-by: Karel Zak disk-utils/fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ac8697d60686b9951fd181a51c026b85ce10f95a Author: Karel Zak Date: Wed Jun 2 12:14:10 2021 +0200 libmount: add mnt_fs_is_regularfs() to public API Fix: https://github.com/karelzak/util-linux/issues/1328 Signed-off-by: Karel Zak libmount/docs/libmount-sections.txt | 1 + libmount/src/context_loopdev.c | 2 +- libmount/src/fs.c | 15 +++++++++++++++ libmount/src/libmount.h.in | 1 + libmount/src/libmount.sym | 5 +++++ libmount/src/mountP.h | 4 ---- 6 files changed, 23 insertions(+), 5 deletions(-) commit 14ae6d5ae0953182f08def657f4b49158a832ea3 Author: Karel Zak Date: Wed Jun 2 11:55:44 2021 +0200 build-sys: fix {release-version} man pages * define {release-version} as $VERSION * do not use {docdir} in adoc; it's built-in ascidoctor variable https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes-reference/#intrinsic-attributes Addresses: https://github.com/karelzak/util-linux/issues/1327 Signed-off-by: Karel Zak Makefile.am | 2 ++ misc-utils/getopt.1.adoc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) commit ab2eea4ac30b81fe29e8d0245e2d2518b71cdc43 Author: Karel Zak Date: Wed Jun 2 11:14:36 2021 +0200 build-sys: install hardlink bash-completion Signed-off-by: Karel Zak bash-completion/Makemodule.am | 3 +++ 1 file changed, 3 insertions(+) commit d79a69c5643cfb903600bc566538170e5c03989c Author: Karel Zak Date: Tue Jun 1 11:45:16 2021 +0200 tools: allow to update specific files on kernel.org Signed-off-by: Karel Zak tools/ko-release-gen | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) commit a057fdb13a97e51f2dc7a78454655d5618d4868f Author: Karel Zak Date: Tue Jun 1 10:37:01 2021 +0200 docs: fix typo in v2.37-ReleaseNotes Signed-off-by: Karel Zak Documentation/releases/v2.37-ReleaseNotes | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 635d382146065dc0c0b8c74e658f2ec2c8d8f060 Author: Karel Zak Date: Tue Jun 1 10:31:49 2021 +0200 docs: add uclampset to AUTHORS file Signed-off-by: Karel Zak AUTHORS | 1 + 1 file changed, 1 insertion(+) commit 87579a96b2914cd33e1db052b07c4cbd66b88642 Author: Thomas Weißschuh Date: Wed May 26 13:31:44 2021 +0200 lscpu: use optional json values Signed-off-by: Thomas Weißschuh sys-utils/lscpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f48554d48b002ac2881569ecb088aeef710f9369 Author: Thomas Weißschuh Date: Wed May 26 13:30:31 2021 +0200 libsmartcols: add support for optional boolean values These default to `null` instead of `false`. Signed-off-by: Thomas Weißschuh include/jsonwrt.h | 2 ++ lib/jsonwrt.c | 8 ++++++++ libsmartcols/src/libsmartcols.h.in | 3 ++- libsmartcols/src/print.c | 15 ++++++++++----- 4 files changed, 22 insertions(+), 6 deletions(-) commit 17353ee0cddb81e0d3eaa143d1163447f36de153 Author: Thomas Weißschuh Date: Wed May 26 13:08:16 2021 +0200 lscpu: use json types Signed-off-by: Thomas Weißschuh sys-utils/lscpu.c | 90 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 35 deletions(-) commit 684f921ec2afd9ae4706e281e3a58b61cc16c23b Author: Karel Zak Date: Wed May 26 13:20:21 2021 +0200 build-sys: add script to compare config.h from meson and autotools Signed-off-by: Karel Zak tools/compare-buildsys.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) commit 647f80e491ab7a7abc3891e6889c70017246e884 Author: Karel Zak Date: Wed May 26 13:12:31 2021 +0200 meson: add missing header files check Fixes: https://github.com/karelzak/util-linux/issues/1318 Signed-off-by: Karel Zak configure.ac | 3 +-- meson.build | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) commit 05cbd5aeedfed9521f6797ff4be1676ab0fae1aa Author: Karel Zak Date: Tue May 25 13:45:24 2021 +0200 docs: update TODO Signed-off-by: Karel Zak Documentation/TODO | 4 ++++ 1 file changed, 4 insertions(+) commit 96476550dba2276466e312870083db85e159d712 Author: Karel Zak Date: Tue May 25 13:29:20 2021 +0200 tests: update lscpu outputs tests/expected/lscpu/lscpu-armv7 | 1 + tests/expected/lscpu/lscpu-vmware_fpe | 2 +- tests/expected/lscpu/lscpu-x86_64-64cpu | 2 +- tests/expected/lscpu/lscpu-x86_64-dell_e4310 | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) commit f2d08d4ddc9bc601107df28dd8e4598cf2e0b420 Author: Karel Zak Date: Tue May 25 13:23:39 2021 +0200 lscpu: read MHZ from /sys/.../cpufreq/scaling_cur_freq This is more portable and provides more stable results than /proc/cpuinfo. Fixes: https://github.com/karelzak/util-linux/pull/1317 Co-Author: Thomas Weißschuh Signed-off-by: Karel Zak sys-utils/lscpu-topology.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 0b538002dad7bb5e178740191961bcc69509a80d Author: Karel Zak Date: Tue May 25 11:32:51 2021 +0200 lscpu: use locale-independent strtod() when read from kernel Reported-by: Thomas Weißschuh Signed-off-by: Karel Zak sys-utils/lscpu-cputype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 670b10ae363d40fbe7dfd3c2e9c3f8044bf630f1 Author: Karel Zak Date: Tue May 25 11:31:08 2021 +0200 lib/c_strtod; add locale independent strtod() Signed-off-by: Karel Zak configure.ac | 3 ++ include/c_strtod.h | 6 +++ lib/Makemodule.am | 7 +++- lib/c_strtod.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/meson.build | 1 + meson.build | 3 ++ 6 files changed, 124 insertions(+), 1 deletion(-) commit afa7e09e4b77a2049fb0086553d255fbb461f011 Author: Karel Zak Date: Mon May 24 13:43:02 2021 +0200 tests: update lscpu output Signed-off-by: Karel Zak tests/expected/lscpu/lscpu-vbox-win | 1 + tests/expected/lscpu/lscpu-vmware_fpe | 1 + tests/expected/lscpu/lscpu-x86_64-64cpu | 1 + tests/expected/lscpu/lscpu-x86_64-dell_e4310 | 1 + tests/expected/lscpu/lscpu-x86_64-epyc_7451 | 1 + 5 files changed, 5 insertions(+) commit ff6513c74e7fc97e2297b12dddb58d9b6513fcaf Author: Karel Zak Date: Mon May 24 13:19:47 2021 +0200 lscpu: use MHZ as number to be locale sensitive Fixes: https://github.com/karelzak/util-linux/issues/1316 Signed-off-by: Karel Zak sys-utils/lscpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9b9e4f5d06be55f4b9e1a52b448055933df92c6b Author: Karel Zak Date: Mon May 24 12:24:33 2021 +0200 lscpu: add SCALMHZ% and "CPU scaling MHz:" $ lscpu ... Model name: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz CPU family: 6 Model: 60 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 Stepping: 3 CPU(s) scaling MHz: 61% CPU max MHz: 4400.0000 CPU min MHz: 800.0000 ... $ lscpu -e=CPU,MAXMHZ,MINMHZ,MHZ,SCALMHZ% CPU MAXMHZ MINMHZ MHZ SCALMHZ% 0 4400.0000 800.0000 2800.000 64% 1 4400.0000 800.0000 4000.146 91% 2 4400.0000 800.0000 2800.000 64% 3 4400.0000 800.0000 2800.000 64% 4 4400.0000 800.0000 2800.000 64% 5 4400.0000 800.0000 4400.000 100% 6 4400.0000 800.0000 800.000 18% 7 4400.0000 800.0000 2800.000 64% Addresses: https://github.com/karelzak/util-linux/issues/1314 Signed-off-by: Karel Zak Documentation/TODO | 1 + sys-utils/lscpu-cputype.c | 6 ++++++ sys-utils/lscpu-topology.c | 21 +++++++++++++++++++++ sys-utils/lscpu.c | 9 +++++++++ sys-utils/lscpu.h | 4 +++- 5 files changed, 40 insertions(+), 1 deletion(-) commit 419861d5bf1704e3d76b1402450fe81a77b08c90 Author: Karel Zak Date: Tue May 18 12:58:45 2021 +0200 sulogin: fix whitespace error Signed-off-by: Karel Zak login-utils/sulogin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0d092db5c40b94e1ea9529f3f1c384a74eca19f8 Author: Werner Fink Date: Mon May 17 17:20:32 2021 +0200 sulogin: ignore none-existing console devices and also none-functional console devices. Redirect the error messages to the appropiate console device. Signed-off-by: Werner Fink login-utils/sulogin-consoles.h | 1 + login-utils/sulogin.c | 95 +++++++++++++++++++++++++++++++++++------- 2 files changed, 81 insertions(+), 15 deletions(-) commit 0f344e24320560792da20567b0128b2faf7d4da0 Author: Karel Zak Date: Mon May 3 10:59:45 2021 +0200 lsns: fix old error message Signed-off-by: Karel Zak sys-utils/lsns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit be1a10bb1f555e6ebb541edfd94ddec68401177f Author: Karel Zak Date: Mon May 3 10:51:06 2021 +0200 lsns: fix copy & past in man page Signed-off-by: Karel Zak sys-utils/lsns.8.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f91ffe44dd4da05878c39f555aae357dc2cb972c Author: Masatake YAMATO Date: Fri Apr 30 22:14:22 2021 +0900 lsns: fill UID and USER columns for interpolated namespaces Signed-off-by: Masatake YAMATO sys-utils/lsns.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 09710a221212a58888c6f50b6a3b09b31778a44e Author: Masatake YAMATO Date: Fri Apr 30 02:44:12 2021 +0900 fixup! lsns: interpolate missing namespaces for converting forests to a tree sys-utils/lsns.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit de72df79d72fa906e71e2ac922d8745ff22deee5 Author: Masatake YAMATO Date: Thu Apr 29 05:49:33 2021 +0900 lsns: interpolate missing namespaces for converting forests to a tree The tree of *parent* and *owner* could be forests because *lsns* cannot track a namespace having no process. This change tries interpolating the missing namespaces by calling ioctl(NS_GET_PARENT) and ioctl(NS_GET_USERNS) recursively. The original output for -Tparent: # ./lsns -Tparent NS TYPE NPROCS PID USER COMMAND 4026531837 user 404 1 root /usr/lib/systemd/sy ├─4026532508 user 1 29376 yamato /usr/lib64/firefox/ ... └─4026533513 user 1 24245 yamato /usr/lib64/firefox/ ... 4026533733 user 1 30839 yamato /opt/google/chrome- 4026533734 user 15 10076 yamato /opt/google/chrome- user namespaces 4026533733 and 4026533734 are orphans. lsns could not find their parents. With this change: # ./lsns-with-changes -Tparent NS TYPE NPROCS PID USER COMMAND 4026531837 user 404 1 root /usr/lib/systemd/ ├─4026532508 user 1 29376 yamato /usr/lib64/firefo ... ├─4026532639 user 0 │ ├─4026532637 user 0 │ │ └─4026533733 user 1 30839 yamato /opt/google/chrom │ └─4026533734 user 14 10076 yamato /opt/google/chrom Now user namespaces 4026533733 and 4026533734 are integrated to the tree. lsns interpolates the missing namespace 4026532639 and 4026532637 for the integration. The original output for -Towner: # ./lsns -Towner NS TYPE NPROCS PID USER COMMAND 4026531837 user 405 1 root /usr/lib/systemd/s ├─4026531835 cgroup 431 1 root /usr/lib/systemd/s ... 4026532638 pid 1 30839 yamato /opt/google/chrome 4026532640 pid 2 30837 yamato /opt/google/chrome ... pid namespaces 4026532638 and 4026532640 are orphans. lsns could not find their owners. With this change: # ./lsns-with-changes -Towner NS TYPE NPROCS PID USER COMMAND 4026531837 user 403 1 root /usr/lib/systemd ├─4026531835 cgroup 429 1 root /usr/lib/systemd ... ├─4026532639 user 0 ... │ ├─4026532637 user 0 │ │ ├─4026532638 pid 1 30839 yamato /opt/google/chro │ │ ├─4026533638 net 1 30839 yamato /opt/google/chro │ │ └─4026533733 user 1 30839 yamato /opt/google/chro │ ├─4026532640 pid 2 30837 yamato /opt/google/chro Now pid namespaces 4026532638 and 4026532640 are integrated to the tree. lsns interpolates the missing namespace 4026532639 and 4026532637 for the integration. Signed-off-by: Masatake YAMATO sys-utils/lsns.8.adoc | 1 - sys-utils/lsns.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 1 deletion(-) commit c67b83c10d6a0aec46c7f14aed4a8f7c5cbf88fc Author: Masatake YAMATO Date: Thu Apr 29 04:39:13 2021 +0900 lsns: reorganize members specifying other namespaces in lsns_namespace This is a preparation change for planed "tree interpolation" patch. parentid, ownerid, parentns, and ownerns were members of lsns_namespace struct. When interpolating missing namespaces for building a unified name space tree, duplicated functions are needed; one is for parentid and parentns members, and another is for ownerid and ownerns members. To avoid the duplication, this change unifies the members as following: parentid and ownerid => related_id [2] parentns and ownerns => related_ns [2] Signed-off-by: Masatake YAMATO sys-utils/lsns.c | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) commit e749d51a9c8b307fcbc78e64167ff8ef2ab9a122 Author: Masatake YAMATO Date: Fri Apr 23 04:24:24 2021 +0900 lsns: make namespace having no process printable This is a preparation change for planed "tree interpolation" patch. Signed-off-by: Masatake YAMATO sys-utils/lsns.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) commit db221158757e93912a36a58a5403201bf82edee5 Author: Naohiro Aota Date: Mon Apr 26 14:50:36 2021 +0900 libblkid: support zone reset for wipefs We cannot overwrite superblock magic in a sequential required zone. So, wipefs cannot work as it is. Instead, this commit implements the wiping by zone resetting. Zone resetting must be done only for a sequential write zone. This is checked by is_conventional(). Signed-off-by: Naohiro Aota libblkid/src/probe.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 6 deletions(-) commit 6be38dccae0c6f8d8246bc60aac177e783eeac43 Author: Naohiro Aota Date: Mon Apr 26 14:50:35 2021 +0900 libblkid: add magic and probing for zoned btrfs This commit adds zone-aware magics and probing functions for zoned btrfs. The superblock (and its copies) are the only data structure in btrfs with a fixed location on a device. Since we cannot do overwrites in a sequential write required zone, we cannot place the superblock in the zone. Thus, zoned btrfs uses superblock log writing to update superblocks on sequential write required zones. It uses two zones as a circular buffer to write updated superblocks. Once the first zone is filled up, start writing into the second buffer. When both zones are filled up, and before starting to write to the first zone again, it reset the first zone. We can determine the position of the latest superblock by reading the write pointer information from a device. One corner case is when both zones are full. For this situation, we read out the last superblock of each zone and compare them to determine which zone is older. The magics can detect a superblock magic ("_BHRfs_M") at the beginning of zone #0 or zone #1 to see if it is zoned btrfs. When both zones are filled up, zoned btrfs resets the first zone to write a new superblock. If btrfs crashes at the moment, we do not see a superblock at zone #0. Thus, we need to check not only zone #0 but also zone #1. It also supports the temporary magic ("!BHRfS_M") in zone #0. Mkfs.btrfs first writes the temporary superblock to the zone during the mkfs process. It will survive there until the zones are filled up and reset. So, we also need to detect this temporary magic. Finally, this commit extends probe_btrfs() to load the latest superblock determined by the write pointers. Signed-off-by: Naohiro Aota include/blkdev.h | 9 +++ lib/blkdev.c | 29 +++++++ libblkid/src/superblocks/btrfs.c | 159 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 196 insertions(+), 1 deletion(-) commit b250fbbf5666d0b7289c223c276edd301cd8c653 Author: Naohiro Aota Date: Mon Apr 26 14:50:34 2021 +0900 libblkid: implement zone-aware probing This patch makes libblkid zone-aware. It can probe the magic located at some offset from the beginning of some specific zone of a device. This patch introduces some new fields to struct blkid_idmag. They indicate the magic location is placed related to a zone and the offset in the zone. Also, this commit introduces `zone_size` to struct blkid_struct_probe. It stores the size of zones of a device. Signed-off-by: Naohiro Aota libblkid/src/blkidP.h | 5 +++++ libblkid/src/probe.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) commit 3387ad72a621334527c3a75c6a924cac03e7a992 Author: Karel Zak Date: Wed Apr 28 13:04:16 2021 +0200 lsns: make --tree default, update man-page * make --tree=process default for 'lsns' and 'lsns ' * remove 'list' from struct lsns * update man page Addresses: https://github.com/karelzak/util-linux/pull/1281 Signed-off-by: Karel Zak sys-utils/lsns.8.adoc | 6 +++--- sys-utils/lsns.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) commit 179dd17a6aa5a698e0f425eb014c53d191f9eb8c Author: Masatake YAMATO Date: Fri Apr 23 19:55:46 2021 +0900 lsns: fix passing wrong process lists when showing ownerns and parentns Signed-off-by: Masatake YAMATO sys-utils/lsns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 8d27b60530d96c35bce534c24a395c3264f1f9e8 Author: Masatake YAMATO Date: Tue Apr 20 17:09:02 2021 +0900 lsns: unify the code and option for printing process based tree and namespace based trees Suggested by Karel Zak. `--tree` option is introduced as replacement for `--nstree`. In addition to `parent` and `owner`, `--tree` take `process` as the option argument. Signed-off-by: Masatake YAMATO sys-utils/lsns.8.adoc | 9 ++++++--- sys-utils/lsns.c | 47 +++++++++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 23 deletions(-) commit e8c56ae2d77e27b444d35d29b168e2212077e71c Author: Masatake YAMATO Date: Thu Apr 15 18:03:57 2021 +0900 lsns: print namespace tree based on the relationship (parent/child or owner/owned) Introduce new option -T[parent|owner]|--nstree[=parent|=owner]. With this change, lsns prints parent/child relationship tree if "-T parent" is given and owner/owned relationship tree if "-T owner is given. Passing only "-T" is same as passing "-Towner." Example sessions: # ./lsns -Tparent -ons,type,pns| head -20 NS TYPE PNS 4026531837 user 0 ├─4026532508 user 4026531837 ├─4026532609 user 4026531837 ├─4026532610 user 4026531837 ├─4026532629 user 4026531837 ├─4026532705 user 4026531837 ├─4026532901 user 4026531837 ├─4026533090 user 4026531837 ├─4026533185 user 4026531837 ├─4026533280 user 4026531837 └─4026533468 user 4026531837 4026531835 cgroup 0 4026531836 pid 0 └─4026533038 pid 4026531836 ├─4026532934 pid 4026533038 ├─4026533715 pid 4026533038 ├─4026533716 pid 4026533038 ... # ./lsns -Towner -ons,type,ons| head -20 NS TYPE ONS 4026531837 user 0 ├─4026531835 cgroup 4026531837 ├─4026531836 pid 4026531837 ├─4026531838 uts 4026531837 ├─4026531839 ipc 4026531837 ├─4026531840 mnt 4026531837 ├─4026531861 mnt 4026531837 ├─4026532001 net 4026531837 ├─4026532219 mnt 4026531837 ├─4026532357 mnt 4026531837 ├─4026532383 net 4026531837 ├─4026532475 mnt 4026531837 ├─4026532476 mnt 4026531837 ├─4026532504 mnt 4026531837 ├─4026532508 user 4026531837 │ ├─4026532509 ipc 4026532508 │ └─4026532511 net 4026532508 ├─4026532573 mnt 4026531837 ├─4026532574 mnt 4026531837 Signed-off-by: Masatake YAMATO sys-utils/lsns.8.adoc | 6 ++++ sys-utils/lsns.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 90 insertions(+), 5 deletions(-)