| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| |
| | |
* 'nsenter-keep-caps' of https://github.com/dgibson/util-linux:
Add --keep-caps option to nsenter, similar to the one in unshare
unshare: Move implementation of --keep-caps option to library function
|
| | |
| |
| |
| |
| |
| |
| |
| | |
unshare.c open codes some logic to copy the permitted capability set to the
ambient set in order to implement the --keep-caps option. Move this logic
to lib/caputils.c so that we can reuse it in nsenter.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
| | |
| |
| |
| | |
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
|
| | |
| |
| |
| |
| | |
Addresses: https://github.com/util-linux/util-linux/issues/2186
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |/
|
|
|
|
|
|
|
|
| |
XFS, and possibly other filesystems expect that the CRC field
is excluded (or rather RAZ) during the CRC operation. Lets
create a generic helper that is similar to the CRC32 version
ul_crc32_exclude_offset() which computes the CRC while replacing
exclude_len bytes of exclude_off with zeros.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* let's make simplified sequences (e.g. "35;4") used without
lib/colors.c (without color schemes)
* add function to detect already usable esc sequence
* support this new feature in "test_colors --color <name|seq|...>"
./test_colors --color "red"
./test_colors --color "35;5"
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
|
| |
|
|
|
| |
Addresses: https://github.com/util-linux/util-linux/pull/2065
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
| |
* let's use && operator rather than if-if
* define HAVE_CLOSE_RANGE only if callback is really avalable
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
| |
Fixes: https://github.com/util-linux/util-linux/pull/2065
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
| |
This file has been originally imported from gnulib with GPL header,
but it's now available with LGPLv2+ now (since gnulib commit https://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/c-ctype.h?id=5ffa144085078c72e7d60759ab2d6100b04cd2c2).
Fixes: https://github.com/util-linux/util-linux/issues/2050
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |\
| |
| |
| |
| |
| |
| |
| |
| | |
* 'dmesg-subsecond' of https://github.com/t-8ch/util-linux:
dmesg: use subsecond granularity in iso format
dmesg: add subsecond granularity for --since and --until
lib/monotonic: get_suspended_time: use usec_t
timeutils: add utilities for usec_t conversions
dmesg: add test for --since and --until
|
| | |
| |
| |
| | |
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
|
| | |
| |
| |
| | |
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
|
| | |
| |
| |
| |
| |
| |
| | |
This exactly represents the kernels notion of a "removable" blockdevice.
That is, the device itself is persistent but can contain some sort of
medium that can be changed at runtime.
Specifically it is *not* hotpluggable.
|
| |/
|
|
|
| |
Addresses: https://github.com/util-linux/util-linux/pull/2019
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
| |
This macro returns size of struct member.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
|
| |
It's probably typo in the original path (too many brackets:-)). Let's
be explicit about the types used in the calculation. '1 << n' means
the left shift is on 'int', but we need '(t)1 << n'.
Addresses: e53463ea40c58a6f84a597966ac69be9be72cd7d
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous fix in #2013 still invoked undefined behavior by shifting
into the sign-bit.
Now we have a correct, albeit unwieldy solution that avoids undefined
behavior.
Instead of bit fiddling it uses plain addition and substraction.
We are looking for (in LaTeX notation):
2^(n - 1) - 1
= 2 * 2^(n - 2) - 1
= 2^(n - 2) + 2^(n - 2) - 1
= 2^(n - 2) - 1 + 2^(n - 2)
|
| |
|
|
|
|
|
|
|
|
| |
The header files are usually based on code from lib/. This commit
copies relevant license headers from lib/ to include/ to keep
things consistent. The very generic things (e.g. MBR definitions)
are always public domain.
Fixes: https://github.com/util-linux/util-linux/issues/2010
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
|
| |
The previous implementation relied on signed-integer overflow.
This is undefined behavior.
Instead use an implementation that only requires twos-complement
representation. This is what everybody uses anyways and it will be
required by C23.
|
| |
|
|
|
| |
Addresses: https://github.com/torvalds/linux/commit/9ffb14ef61bab83fa818736bf3e7e6b6e182e8e2
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| | |
* 'waitpid' of https://github.com/t-8ch/util-linux:
waitpid: add new command
tests: add ts_skip_exitcode_not_supported
exitcodes: add EXIT_NOTSUPP
pidfd-utils: include wait.h for siginfo_t
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This command implements waiting for the exit of multiple processes.
Especially it allows to wait for process that are not children of the
current process.
In contrast to wait(1P) it does not allow to retrieve the processes exit
codes.
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
|
| |
Sometimes, we need to compare ASCII-only strings independently on the
current locales. Let's follow our cctype.h to implement such functions.
Addresses: https://github.com/util-linux/util-linux/issues/1991
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
|
|
| |
We need to disable support for new kernel API in libmount to test the
old code on new kernels (or maybe also for conservative users).
The new configure option disable only mount(2)-like operations, the
another stuff (like IDs mapping) is not affected.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* use SYS_* macros
* check for the syscalls in configure.ac
* use SYS_* macros for #ifdefs
* add "idmapping" to the list if libmount features
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
|
| |
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
| |\
| |
| |
| |
| | |
* 'blockdev' of https://github.com/t-8ch/util-linux:
blockdev: add support for ioctl BLKGETDISKSEQ
|
| | | |
|
| |/ |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 'fssize' of https://github.com/t-8ch/util-linux:
libblkid: iso9660: read block size from superblock
iso9660.h: avoid undefined signed integer shift
iso9660.h: use more correct function types
libblkid: ntfs: report fssize
libblkid: ubifs: report fssize
libblkid: f2fs: report fssize
libblkid: erofs: report fssize
libblkid: vfat: report fssize
|
| | |
| |
| |
| |
| |
| | |
When the high bit in p[3] is set we would overflow our signed 4-byte
integer result value.
Force an unsigned type instead.
|
| | | |
|