]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
13 months agoagetty: (man) fix typos
Jakub Wilk [Sat, 25 Mar 2023 08:20:06 +0000 (09:20 +0100)] 
agetty: (man) fix typos

13 months agohexdump-parse: handle truncated format pattern
Ronan Pigott [Thu, 23 Mar 2023 22:18:00 +0000 (15:18 -0700)] 
hexdump-parse: handle truncated format pattern

If the fmt being parsed by block_size is exactly '%', *++fmt is the
terminator and strchr will return a valid pointer to the terminator of
spec rather than NULL, the while condition will pass and subsequent
strchr will read past the end of fmt until a spec character is found
again

ASAN aborts with the following error on the first buffer overread:

AddressSanitizer: heap-buffer-overflow on address 0x602000000212 at pc 0x55bf1c4b2d78 bp 0x7ffe33c8cff0 sp 0x7ffe33c8cfe0
READ of size 1 at 0x602000000212 thread T0
    #0 0x55bf1c4b2d77 in block_size ../text-utils/hexdump-parse.c:207
    #1 0x55bf1c4ad36f in main ../text-utils/hexdump.c:214
    #2 0x7f15f063c78f  (/usr/lib/libc.so.6+0x2378f)
    #3 0x7f15f063c849 in __libc_start_main (/usr/lib/libc.so.6+0x23849)
    #4 0x55bf1c4ac6c4 in _start (../build/hexdump+0x86c4)

13 months agoMerge branch 'fixes' of https://github.com/brauner/util-linux
Karel Zak [Thu, 23 Mar 2023 20:20:33 +0000 (21:20 +0100)] 
Merge branch 'fixes' of https://github.com/brauner/util-linux

* 'fixes' of https://github.com/brauner/util-linux:
  idmap: kill child when writing the idmap fails

13 months agoMerge branch 'xry111/lscpu-loongarch' of https://github.com/xry111/util-linux
Karel Zak [Thu, 23 Mar 2023 20:19:11 +0000 (21:19 +0100)] 
Merge branch 'xry111/lscpu-loongarch' of https://github.com/xry111/util-linux

* 'xry111/lscpu-loongarch' of https://github.com/xry111/util-linux:
  lscpu: Add loongarch testcase
  lscpu: Add "ISA" field into lscpu_cputype and determine loongarch op-mode from its value
  lscpu: Parse loongarch specific lines

13 months agoMerge branch 'lsfd/typo' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 23 Mar 2023 20:14:59 +0000 (21:14 +0100)] 
Merge branch 'lsfd/typo' of https://github.com/t-8ch/util-linux

* 'lsfd/typo' of https://github.com/t-8ch/util-linux:
  lsfd: (man) fix typo

13 months agoMerge branch 'nasal_daemon_part1_fclose' of https://github.com/crrodriguez/util-linux
Karel Zak [Thu, 23 Mar 2023 20:14:28 +0000 (21:14 +0100)] 
Merge branch 'nasal_daemon_part1_fclose' of https://github.com/crrodriguez/util-linux

* 'nasal_daemon_part1_fclose' of https://github.com/crrodriguez/util-linux:
  tests: fclose(stdin) UB

13 months agolibmount: fix user/users for superuser
Karel Zak [Thu, 23 Mar 2023 19:59:46 +0000 (20:59 +0100)] 
libmount: fix user/users for superuser

Always use MS_SECURE and MS_OWNERSECURE to mount fstab entries where
is specified "user" or "users", although the current user is root.

This bug has never been released (v2.39-rc1 only).

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agomount: (man) add notes about remount behavior
Karel Zak [Thu, 23 Mar 2023 15:10:22 +0000 (16:10 +0100)] 
mount: (man) add notes about remount behavior

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolibmount: fix MS_REMOUNT emulation by mount_setattr()
Karel Zak [Thu, 23 Mar 2023 14:25:00 +0000 (15:25 +0100)] 
libmount: fix MS_REMOUNT emulation by mount_setattr()

The classic mount(MS_REMOUNT) means that all unspecified MS_NOxxx
flags are remove (except MS_NOATIME). We need to follow this semantic
when emulate remount by mount_setattr(), because "mount -o remount /"
is the way how (for example) systemd resets root filesystem to default
(e.g. ro->rw, etc.)

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2180593
Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolibmount: fix and cleanup relatime use
Karel Zak [Thu, 23 Mar 2023 13:22:37 +0000 (14:22 +0100)] 
libmount: fix and cleanup relatime use

* move atime logic to optlist

* MOUNT_ATTR_RELATIME is zero, so we cannot use use "if (!attr)" to skip mount_setattr()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolibmount: add missing MOUNT_ATTR_NODEV
Karel Zak [Thu, 23 Mar 2023 11:37:18 +0000 (12:37 +0100)] 
libmount: add missing MOUNT_ATTR_NODEV

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agoidmap: kill child when writing the idmap fails
Christian Brauner [Thu, 23 Mar 2023 10:09:28 +0000 (11:09 +0100)] 
idmap: kill child when writing the idmap fails

This fixes the second issues reported in [1] where calling
mount -o 'X-mount.idmap=[...]' just hangs.

Fixes: https://github.com/util-linux/util-linux/issues/2130 [1]
Signed-off-by: Christian Brauner <brauner@kernel.org>
13 months agolibmount: fix typo, improve debug
Karel Zak [Wed, 22 Mar 2023 17:02:31 +0000 (18:02 +0100)] 
libmount: fix typo, improve debug

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolscpu: Add loongarch testcase
Xi Ruoyao [Wed, 22 Mar 2023 13:16:30 +0000 (21:16 +0800)] 
lscpu: Add loongarch testcase

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
13 months agolscpu: Add "ISA" field into lscpu_cputype and determine loongarch op-mode from its...
Xi Ruoyao [Wed, 22 Mar 2023 12:57:34 +0000 (20:57 +0800)] 
lscpu: Add "ISA" field into lscpu_cputype and determine loongarch op-mode from its value

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
13 months agolscpu: Parse loongarch specific lines
Xi Ruoyao [Wed, 22 Mar 2023 12:44:19 +0000 (20:44 +0800)] 
lscpu: Parse loongarch specific lines

/proc/cpuinfo on loongarch uses UPPERCASE letters in some field names.
Add the patterns for them.

"Address Sizes", "CPU Family", "CPU Revision" (aka "Model"), and
"Model Name" are correctly outputed, but "CPU MHz" not (because we
don't have a CPUFreq driver yet).

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
13 months agolsfd: (man) fix typo
Thomas Weißschuh [Wed, 22 Mar 2023 01:30:00 +0000 (01:30 +0000)] 
lsfd: (man) fix typo

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agotests: fclose(stdin) UB
Cristian Rodríguez [Tue, 21 Mar 2023 19:55:15 +0000 (19:55 +0000)] 
tests: fclose(stdin) UB

The standard streams must not be closed unless it is
the very last thing a program does before termination.

A warning about this was added to POSIX.1-2008 and later standards.

One must redirect stdin to /dev/null using freopen instead.

14 months agobuild-sys: fix libblkid fuzz sample test if-endif
Karel Zak [Fri, 17 Mar 2023 12:11:50 +0000 (13:11 +0100)] 
build-sys: fix libblkid fuzz sample test if-endif

All tests have to be covered by BUILD_LIBBLKID_TESTS otherwise
proper CFLAGS ($blkid_tests_cflags) are undefined.

Fixes: https://github.com/util-linux/util-linux/issues/2119
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agobuild-sys: report fuzzing support status
Karel Zak [Fri, 17 Mar 2023 12:04:41 +0000 (13:04 +0100)] 
build-sys: report fuzzing support status

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoMerge branch 'patch-9' of https://github.com/mariobl/util-linux
Karel Zak [Fri, 17 Mar 2023 11:26:55 +0000 (12:26 +0100)] 
Merge branch 'patch-9' of https://github.com/mariobl/util-linux

* 'patch-9' of https://github.com/mariobl/util-linux:
  Fix typo in lsfd.c

14 months agolsfd; (man) add hint about default output
Karel Zak [Fri, 17 Mar 2023 11:25:30 +0000 (12:25 +0100)] 
lsfd; (man) add hint about default output

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolsblk: (man) add hint about --merge
Karel Zak [Fri, 17 Mar 2023 11:16:31 +0000 (12:16 +0100)] 
lsblk: (man) add hint about --merge

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agofindmnt: (man) add hint about the default output
Karel Zak [Fri, 17 Mar 2023 11:03:06 +0000 (12:03 +0100)] 
findmnt: (man) add hint about the default output

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agowall: use fputs_careful()
наб [Wed, 15 Mar 2023 15:16:48 +0000 (16:16 +0100)] 
wall: use fputs_careful()

LINE_MAX only applies to teletypes in canonical mode: when stdin is a
file, it could still very much tear; start off at 512 for the sprintf(),
then use getline() like in write.

The line wrapping has one suboptimal edge-case:
  $ wall < all

  Broadcast message from nabijaczleweli@tarta (pts/4) (Tue Mar 14 22:31:25
  2023):

  ^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_
  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ
  KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^?\200\201\202\203\204\205\206
  \207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232
  \233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256
  \257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302
  \303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326
  \327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352
  \353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376
  \377
but that's a pathological input, and the result is still infinitely
better than it was before, so fixing that is more trouble than it's
worth.

Bug-Debian: https://bugs.debian.org/826596

14 months agowall: convert homebrew buffering to open_memstream()
наб [Wed, 15 Mar 2023 15:16:43 +0000 (16:16 +0100)] 
wall: convert homebrew buffering to open_memstream()

The struct buffer system duplicates a plethora of standard I/O
functions (including a fork of fputc_careful())
and adds a lot of complexity ‒ open_memstream() is standard,
and fits perfectly into this niche

14 months agowrite: correctly handle wide characters
наб [Wed, 15 Mar 2023 15:16:31 +0000 (16:16 +0100)] 
write: correctly handle wide characters

Do this by replacing fputc_careful() (notice that the description said
it's locale-aware ‒ it very much is /not/), with a fputs_careful() which
does the same thing, but if it were to output a byte in the \123 format,
first it checks whether this byte starts a valid multibyte character.

If it does, and that character is printable, write it verbatim.
This means that
  echo 'foo åäö ąęćźżń bar' | write nabijaczleweli pts/4
instead of
  foo \303\245\303\244\303\266
  \304\205\304\231\304\207\305\272\305\274\305\204 bar
yields
  foo åäö ąęćźżń bar
or, more realistically, from a message I got earlier today,
  Filip powiedzia\305\202 \305\274e zap\305\202aci jutro
becomes
  Filip powiedział że zapłaci jutro

Invalid/non-printable sequences get processed as before.

Line reading in write must become getline() to avoid dealing with
partial characters: for example on input consisting solely of
ąęćźżń, where every {1} is an instance, the output would be
  {42}ąęć\305\272żń{84}ąęćź\305\274ń{84}ąęćźż\305\204{39}
with just fixed-512 fgets()

Bug-Debian: https://bugs.debian.org/826596

14 months agolsfd: error if extraneous argument given
наб [Thu, 16 Mar 2023 16:08:59 +0000 (17:08 +0100)] 
lsfd: error if extraneous argument given

The manual and help string both spec lsfd [options];
actually stick to that instead of ignoring subsequent arguments.

This is particularly a weird thing to allow given that lsof path
is legal and does something (either same as
lsfd -Q "MAJ:MIN == \"$(stat -c %Hd:%Ld path)\"" if it's a mountpoint or
lsfd -Q "NAME ~= '$path'" (sans the regex and escaping) otherwise).

This mirrors ec96a89ed9551ffacfc58b3056c8070444e3a2f3 for largely the
same reason.

Signed-off-by: Karel Zak <kzak@redhat.com>
Tested-by: Masatake YAMATO <yamato@redhat.com>
14 months agoFix typo in lsfd.c
Mario Blättermann [Thu, 16 Mar 2023 18:24:14 +0000 (19:24 +0100)] 
Fix typo in lsfd.c

14 months agoFix markup in mkfs.cramfs.8.adoc (again)
Mario Blättermann [Thu, 16 Mar 2023 12:35:37 +0000 (13:35 +0100)] 
Fix markup in mkfs.cramfs.8.adoc (again)

There was one more *roff markup left in this file.

14 months agoMerge branch 'patch-7' of https://github.com/mariobl/util-linux
Karel Zak [Thu, 16 Mar 2023 11:33:31 +0000 (12:33 +0100)] 
Merge branch 'patch-7' of https://github.com/mariobl/util-linux

* 'patch-7' of https://github.com/mariobl/util-linux:
  Add fadvise.1.adoc to po4a.cfg

14 months agomkfs.cramfs: (man) Fix markup in makefs.cramfs.8.adoc
Mario Blättermann [Wed, 15 Mar 2023 20:48:57 +0000 (21:48 +0100)] 
mkfs.cramfs: (man) Fix markup in makefs.cramfs.8.adoc

[kzak@redhat.com: - improve optional argument formatting]

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoAdd fadvise.1.adoc to po4a.cfg
Mario Blättermann [Wed, 15 Mar 2023 20:57:28 +0000 (21:57 +0100)] 
Add fadvise.1.adoc to po4a.cfg

14 months agomount: ignore autofs entries in mount listing
Ian Kent [Mon, 13 Mar 2023 01:43:02 +0000 (09:43 +0800)] 
mount: ignore autofs entries in mount listing

Since we can't enable use of ignoring autofs mounts that have the
"ignore" option present by default (systemd could get confused) it's
necessary to enable it for individual applications.

The mount utility is one applcation we need it for so enable it.

Signed-off-by: Ian Kent <raven@themaw.net>
Cc: John Westerdale <jwesterd@redhat.com>
Cc: Frank Hertz <fhirtz@redhat.com>
Cc: Frank Sorenson <fsorenso@redhat.com>
14 months agolibmount: dont ignore autofs mounts by default
Ian Kent [Mon, 13 Mar 2023 01:42:56 +0000 (09:42 +0800)] 
libmount: dont ignore autofs mounts by default

Making libmount ingore autofs mounts by default can be a problem for
systemd, I remember now what the problem was.

autofs multi-mounts can be nested (and often are, think of a tree of
NFS exports) where there are autofs file system mounts within NFS
mounts and together with autofs mount triggers.

In this case systemd needs to see all the mounts at shutdown when it
is umounting the tree of mounts. We don't want to have to rely on
modifications having been made to systemd for this to work properly
so we can't make this the default behaviour in libmount.

Fixes: 22147e08c987 (libmount: use autofs mount hint to ignore autofs mount entries)
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: John Westerdale <jwesterd@redhat.com>
Cc: Frank Hertz <fhirtz@redhat.com>
Cc: Frank Sorenson <fsorenso@redhat.com>
14 months agoMerge branch 'lsfd--fix-wrong-format-specifier' of https://github.com/masatake/util...
Karel Zak [Wed, 15 Mar 2023 13:55:04 +0000 (14:55 +0100)] 
Merge branch 'lsfd--fix-wrong-format-specifier' of https://github.com/masatake/util-linux

* 'lsfd--fix-wrong-format-specifier' of https://github.com/masatake/util-linux:
  lsfd: fix wrong format specifiers in snptinrf()

14 months agolsfd: fix wrong format specifiers in snptinrf()
Masatake YAMATO [Tue, 14 Mar 2023 18:32:26 +0000 (03:32 +0900)] 
lsfd: fix wrong format specifiers in snptinrf()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agounshare: (man) fix example formatting
Jakub Wilk [Mon, 13 Mar 2023 15:34:09 +0000 (16:34 +0100)] 
unshare: (man) fix example formatting

14 months agoMerge branch 'lsfd-man-fix' of https://github.com/masatake/util-linux
Karel Zak [Mon, 13 Mar 2023 12:00:04 +0000 (13:00 +0100)] 
Merge branch 'lsfd-man-fix' of https://github.com/masatake/util-linux

* 'lsfd-man-fix' of https://github.com/masatake/util-linux:
  lsfd.1.adoc: fix text formats

14 months agolsfd.1.adoc: fix text formats
Masatake YAMATO [Fri, 10 Mar 2023 20:25:22 +0000 (05:25 +0900)] 
lsfd.1.adoc: fix text formats

14 months agobuild-sys: release++ (v2.39-rc1) v2.39-rc1
Karel Zak [Fri, 10 Mar 2023 12:26:06 +0000 (13:26 +0100)] 
build-sys: release++ (v2.39-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agodocs: update v2.39-rc1-ReleaseNotes
Karel Zak [Fri, 10 Mar 2023 12:24:06 +0000 (13:24 +0100)] 
docs: update v2.39-rc1-ReleaseNotes

Addresses: https://github.com/util-linux/util-linux/issues/2109
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agodocs: update v2.39-ReleaseNotes
Karel Zak [Thu, 9 Mar 2023 14:03:45 +0000 (15:03 +0100)] 
docs: update v2.39-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agodocs: update AUTHORS file
Karel Zak [Thu, 9 Mar 2023 12:46:24 +0000 (13:46 +0100)] 
docs: update AUTHORS file

* add new contributors
* remove "noreply", localhost, etc. addresses

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agopo-man: merge changes
Karel Zak [Thu, 9 Mar 2023 12:40:25 +0000 (13:40 +0100)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agopo: merge changes
Karel Zak [Thu, 9 Mar 2023 12:38:53 +0000 (13:38 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibuuid: fix lib internal cache size
Michael Trapp [Mon, 6 Mar 2023 10:40:20 +0000 (10:40 +0000)] 
libuuid: fix lib internal cache size

The lib internal cache improves throughput in high load
scenarios but for applications with a low request rate,
the cache size must be adapted to this situation.
Therefore the cache size should be changed to the current
requirements of the application during runtime.

14 months agolib/env: fix memory leak [coverity scan]
Karel Zak [Thu, 9 Mar 2023 12:10:41 +0000 (13:10 +0100)] 
lib/env: fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoMerge branch 'warning' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 9 Mar 2023 11:21:10 +0000 (12:21 +0100)] 
Merge branch 'warning' of https://github.com/t-8ch/util-linux

* 'warning' of https://github.com/t-8ch/util-linux:
  libmount: inhibit warning about mask being unused

14 months agoMerge branch 'libtool-workaround' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 9 Mar 2023 11:20:19 +0000 (12:20 +0100)] 
Merge branch 'libtool-workaround' of https://github.com/t-8ch/util-linux

* 'libtool-workaround' of https://github.com/t-8ch/util-linux:
  build-sys: work around broken cross-compiles on Debian

14 months agoMerge branch 'unshare' of https://github.com/jwilk-forks/util-linux
Karel Zak [Thu, 9 Mar 2023 11:19:10 +0000 (12:19 +0100)] 
Merge branch 'unshare' of https://github.com/jwilk-forks/util-linux

* 'unshare' of https://github.com/jwilk-forks/util-linux:
  mount: (man) add missing commas

14 months agoMerge branch 'waitpid/exclusive' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 9 Mar 2023 11:18:23 +0000 (12:18 +0100)] 
Merge branch 'waitpid/exclusive' of https://github.com/t-8ch/util-linux

* 'waitpid/exclusive' of https://github.com/t-8ch/util-linux:
  waitpid: detect exlusive options with standard mechanism

14 months agoMerge branch 'lsfd-packet' of https://github.com/masatake/util-linux
Karel Zak [Thu, 9 Mar 2023 11:17:46 +0000 (12:17 +0100)] 
Merge branch 'lsfd-packet' of https://github.com/masatake/util-linux

* 'lsfd-packet' of https://github.com/masatake/util-linux:
  tests: (lsfd) add more cases for packet sockets
  tests: (mkfds) don't specify a protocol in connect(2) for AF_PACKET socket
  lsfd: (man) write more about NAME column
  lsfd: use extra information loaded from /proc/net/packet
  lsfd: add a helper function decoding interface indexes
  lsfd: make items in netns_tree extensible
  lsfd: simplify functions for comparing items
  lsfd: (style) reformat colinfo array

14 months agoMerge branch 'fix_cal_num_months' of https://github.com/JadingTsunami/util-linux
Karel Zak [Thu, 9 Mar 2023 11:15:51 +0000 (12:15 +0100)] 
Merge branch 'fix_cal_num_months' of https://github.com/JadingTsunami/util-linux

* 'fix_cal_num_months' of https://github.com/JadingTsunami/util-linux:
  cal: Update column test to show full year output in 5-column mode.
  cal: fix multi-month printing.

14 months agolibfdisk: Fix randomly generated GPT UUID's
Toomas Losin [Sun, 5 Mar 2023 23:57:55 +0000 (15:57 -0800)] 
libfdisk: Fix randomly generated GPT UUID's

Fdisk commands that create random GPT UUID's result in values that are
not UEFI-compliant being written to disk: The "g" command creates a
new GPT whose in-core DiskGUID value is entirely big-endian; the "n"
command creates a GPT partition whose in-core UniquePartitionGUID
value is entirely big-endian.  Those big-endian values are written to
disk by the "w" command rather than the mix of little- and big-endian
spec'd by UEFI.

This was caused by a libfdisk patch in 2017 that was addressing
warnings about "taking address of packed member".  Reading gpt.c finds
two instances of dead code which suggests that perhaps there was some
confusion between a struct and a pointer to a struct.  The intent must
have been to convert the randomly generated big-endian RFC 4122 UUID
values to UEFI's mixed-endian but the confusion(?) resulted in some
dead code and non-conversion of the UUID's.

This patch corrects the breakage while still avoiding "taking address
of packed member" warnings.  The "w" command will once again write
UEFI-compliant values to disk.

Fixes: 92e486f80ef8 ("libfdisk: fix guid usage of packed struct gpt_entry")
Signed-off-by: Toomas Losin <tlo@lenrek.net>
14 months agobuild-sys: work around broken cross-compiles on Debian
Thomas Weißschuh [Tue, 7 Mar 2023 22:10:42 +0000 (22:10 +0000)] 
build-sys: work around broken cross-compiles on Debian

See #2102

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agomount: (man) add missing commas
Jakub Wilk [Mon, 6 Mar 2023 09:20:38 +0000 (10:20 +0100)] 
mount: (man) add missing commas

14 months agotests: (lsfd) add more cases for packet sockets
Masatake YAMATO [Fri, 3 Mar 2023 06:58:18 +0000 (15:58 +0900)] 
tests: (lsfd) add more cases for packet sockets

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agotests: (mkfds) don't specify a protocol in connect(2) for AF_PACKET socket
Masatake YAMATO [Fri, 3 Mar 2023 06:48:44 +0000 (15:48 +0900)] 
tests: (mkfds) don't specify a protocol in connect(2) for AF_PACKET socket

The protocol is specified in socket(2) stage already.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agolsfd: (man) write more about NAME column
Masatake YAMATO [Sun, 5 Mar 2023 07:26:40 +0000 (16:26 +0900)] 
lsfd: (man) write more about NAME column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agolsfd: use extra information loaded from /proc/net/packet
Masatake YAMATO [Thu, 2 Mar 2023 07:45:59 +0000 (16:45 +0900)] 
lsfd: use extra information loaded from /proc/net/packet

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agolsfd: add a helper function decoding interface indexes
Masatake YAMATO [Wed, 1 Mar 2023 14:34:09 +0000 (23:34 +0900)] 
lsfd: add a helper function decoding interface indexes

Thomas Weißschuh <thomas@t-8ch.de> suggested using arrays instead
of tree.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agolsfd: make items in netns_tree extensible
Masatake YAMATO [Wed, 1 Mar 2023 13:42:49 +0000 (22:42 +0900)] 
lsfd: make items in netns_tree extensible

14 months agolsfd: simplify functions for comparing items
Masatake YAMATO [Sun, 5 Mar 2023 03:44:37 +0000 (12:44 +0900)] 
lsfd: simplify functions for comparing items

Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agolsfd: (style) reformat colinfo array
Masatake YAMATO [Sun, 5 Mar 2023 00:50:51 +0000 (09:50 +0900)] 
lsfd: (style) reformat colinfo array

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agolibmount: inhibit warning about mask being unused
Thomas Weißschuh [Sun, 5 Mar 2023 14:08:45 +0000 (14:08 +0000)] 
libmount: inhibit warning about mask being unused

14 months agocal: Update column test to show full year output in 5-column mode.
JadingTsunami [Fri, 3 Mar 2023 17:55:08 +0000 (09:55 -0800)] 
cal: Update column test to show full year output in 5-column mode.

14 months agowaitpid: detect exlusive options with standard mechanism
Thomas Weißschuh [Fri, 3 Mar 2023 15:54:26 +0000 (15:54 +0000)] 
waitpid: detect exlusive options with standard mechanism

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agoMerge branch 'lsfd--inet-optimize' of https://github.com/masatake/util-linux
Karel Zak [Fri, 3 Mar 2023 12:03:33 +0000 (13:03 +0100)] 
Merge branch 'lsfd--inet-optimize' of https://github.com/masatake/util-linux

* 'lsfd--inet-optimize' of https://github.com/masatake/util-linux:
  lsfd: optimize -i/--inet option

14 months agoMerge branch 'waitpid/count' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 3 Mar 2023 12:01:18 +0000 (13:01 +0100)] 
Merge branch 'waitpid/count' of https://github.com/t-8ch/util-linux

* 'waitpid/count' of https://github.com/t-8ch/util-linux:
  waitpid: allow to only wait for a specific number of process exits

14 months agoMerge branch 'agetty/plain' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 3 Mar 2023 11:50:06 +0000 (12:50 +0100)] 
Merge branch 'agetty/plain' of https://github.com/t-8ch/util-linux

* 'agetty/plain' of https://github.com/t-8ch/util-linux:
  TODO: drop agetty LOGIN_PLAIN_PROMPT todo

14 months agoMerge branch 'libblkid/nvidia-raid' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 3 Mar 2023 11:49:40 +0000 (12:49 +0100)] 
Merge branch 'libblkid/nvidia-raid' of https://github.com/t-8ch/util-linux

* 'libblkid/nvidia-raid' of https://github.com/t-8ch/util-linux:
  libblkid: nvidia_raid: validate full signature
  libblkid: nvidia_raid: validate checksum
  libblkid: nvidia_raid: verify superblock size

14 months agoMerge branch 'nsenter/target-uid-gid' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 3 Mar 2023 11:45:57 +0000 (12:45 +0100)] 
Merge branch 'nsenter/target-uid-gid' of https://github.com/t-8ch/util-linux

[kzak@redhat.com: - resolve conflict with 4e9ec856a1b91fb3ff10de10f2dac94f711705e1
                  - fix --help output]

* 'nsenter/target-uid-gid' of https://github.com/t-8ch/util-linux:
  nsenter: read default UID and GID from target process

14 months agocal: fix multi-month printing.
JadingTsunami [Fri, 3 Mar 2023 06:13:45 +0000 (22:13 -0800)] 
cal: fix multi-month printing.

14 months agolsfd: optimize -i/--inet option
Masatake YAMATO [Fri, 3 Mar 2023 05:58:06 +0000 (14:58 +0900)] 
lsfd: optimize -i/--inet option

The original code filters sockets in convert() stage.
This code adds weak-filtering in collect_processes() stage to improve
the performe.

Without this optimization:

    # time ./lsfd --json -i > /tmp/lsfd.txt
    0.43user 0.57system 0:01.02elapsed 99%CPU (0avgtext+0avgdata 52724maxresident)k
    0inputs+0outputs (0major+14263minor)pagefaults 0swaps

With this optimization:

    # time ./lsfd --json -i > /tmp/lsfd-i.txt
    0.08user 0.27system 0:00.36elapsed 98%CPU (0avgtext+0avgdata 7060maxresident)k
    0inputs+0outputs (0major+2831minor)pagefaults 0swaps

About three times faster.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
14 months agonsenter: read default UID and GID from target process
Thomas Weißschuh [Fri, 3 Mar 2023 01:39:27 +0000 (01:39 +0000)] 
nsenter: read default UID and GID from target process

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agoTODO: drop agetty LOGIN_PLAIN_PROMPT todo
Thomas Weißschuh [Fri, 3 Mar 2023 01:19:52 +0000 (01:19 +0000)] 
TODO: drop agetty LOGIN_PLAIN_PROMPT todo

It was implemented in 556925fe.

14 months agowaitpid: allow to only wait for a specific number of process exits
Thomas Weißschuh [Thu, 2 Mar 2023 21:06:31 +0000 (21:06 +0000)] 
waitpid: allow to only wait for a specific number of process exits

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibblkid: nvidia_raid: validate full signature
Thomas Weißschuh [Thu, 2 Mar 2023 21:27:12 +0000 (21:27 +0000)] 
libblkid: nvidia_raid: validate full signature

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibblkid: nvidia_raid: validate checksum
Thomas Weißschuh [Thu, 2 Mar 2023 15:54:39 +0000 (15:54 +0000)] 
libblkid: nvidia_raid: validate checksum

See #1843

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agolibblkid: nvidia_raid: verify superblock size
Thomas Weißschuh [Thu, 2 Mar 2023 15:27:58 +0000 (15:27 +0000)] 
libblkid: nvidia_raid: verify superblock size

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
14 months agonsenter: add --env for allowing environment variables inheritance
u2386 [Mon, 27 Feb 2023 02:18:31 +0000 (02:18 +0000)] 
nsenter: add --env for allowing environment variables inheritance

This commit adds support for the -e or --env option in nsenter, allowing a new process to inherit the environment va

If the option is not given, the environment variables will stay the same as in the current namespace.

Example:
    Setup the namespace:
        $ docker run -d -e PROJECT='util linux' --rm alpine sleep 10000
        cb0b69aa7aec
        $ docker inspect --format '{{ .State.Pid }}' cb0b69aa7aec
        470012

    Enter the namespace:
        $ nsenter --all -t 470012 --env env
        PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        HOSTNAME=cb0b69aa7aec
        PROJECT=util linux
        HOME=/root

Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: u2386 <hugo.cavan2386@gmail.com>
14 months agoMerge branch 'wdctl/sysfs-firmware_version' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 2 Mar 2023 13:42:29 +0000 (14:42 +0100)] 
Merge branch 'wdctl/sysfs-firmware_version' of https://github.com/t-8ch/util-linux

* 'wdctl/sysfs-firmware_version' of https://github.com/t-8ch/util-linux:
  wdctl: read options from sysfs
  wdctl: read firmware version from sysfs

14 months agopo-man: update uk.po (from translationproject.org)
Yuri Chornoivan [Thu, 2 Mar 2023 13:38:22 +0000 (14:38 +0100)] 
po-man: update uk.po (from translationproject.org)

14 months agopo-man: update sr.po (from translationproject.org)
Мирослав Николић [Thu, 2 Mar 2023 13:38:22 +0000 (14:38 +0100)] 
po-man: update sr.po (from translationproject.org)

14 months agopo-man: update fr.po (from translationproject.org)
Frédéric Marchal [Thu, 2 Mar 2023 13:38:22 +0000 (14:38 +0100)] 
po-man: update fr.po (from translationproject.org)

14 months agopo: add ka.po (from translationproject.org)
Temuri Doghonadze [Thu, 2 Mar 2023 13:37:33 +0000 (14:37 +0100)] 
po: add ka.po (from translationproject.org)

14 months agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Thu, 2 Mar 2023 13:37:33 +0000 (14:37 +0100)] 
po: update uk.po (from translationproject.org)

14 months agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Thu, 2 Mar 2023 13:37:33 +0000 (14:37 +0100)] 
po: update ja.po (from translationproject.org)

14 months agopo: update hr.po (from translationproject.org)
Božidar Putanec [Thu, 2 Mar 2023 13:37:33 +0000 (14:37 +0100)] 
po: update hr.po (from translationproject.org)

14 months agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Thu, 2 Mar 2023 13:37:33 +0000 (14:37 +0100)] 
po: update es.po (from translationproject.org)

14 months agopo: update de.po (from translationproject.org)
Mario Blättermann [Thu, 2 Mar 2023 13:37:32 +0000 (14:37 +0100)] 
po: update de.po (from translationproject.org)

14 months agopo: update ca.po (from translationproject.org)
Jordi Mas i Hernàndez [Thu, 2 Mar 2023 13:37:32 +0000 (14:37 +0100)] 
po: update ca.po (from translationproject.org)

14 months agogithub: call checklibdoc and checkxalloc
Karel Zak [Thu, 2 Mar 2023 13:33:18 +0000 (14:33 +0100)] 
github: call checklibdoc and checkxalloc

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolsfd: use xstrdup() if included xalloc.h
Karel Zak [Thu, 2 Mar 2023 13:16:33 +0000 (14:16 +0100)] 
lsfd: use xstrdup() if included xalloc.h

This commit improves code consistence.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibmount: (optstr) do not use xalloc.h in test
Karel Zak [Thu, 2 Mar 2023 13:08:38 +0000 (14:08 +0100)] 
libmount: (optstr) do not use xalloc.h in test

It's technically valid to use xalloc.h in the tests, but then we mix
regular malloc and xalloc in the same source file, and it makes
"make checkxalloc" using difficult.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoinclude/c: make err_oom() usable everywhere
Karel Zak [Thu, 2 Mar 2023 13:07:38 +0000 (14:07 +0100)] 
include/c: make err_oom() usable everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoinclude/fileutils: remove duplicated include
Karel Zak [Thu, 2 Mar 2023 12:48:21 +0000 (13:48 +0100)] 
include/fileutils: remove duplicated include

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoinclude/c: remove duplicate include, improve readablity
Karel Zak [Thu, 2 Mar 2023 12:47:14 +0000 (13:47 +0100)] 
include/c: remove duplicate include, improve readablity

Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agolibmount: add missing symbols to docs
Karel Zak [Thu, 2 Mar 2023 12:38:15 +0000 (13:38 +0100)] 
libmount: add missing symbols to docs

Signed-off-by: Karel Zak <kzak@redhat.com>