Karel Zak [Mon, 23 Oct 2023 12:47:35 +0000 (14:47 +0200)]
libsmartcols: add wrap-zero test
* modify samples/fromfile.c to use scols_wrapzero_nextchunk() callback
if "wrapzero" specified for the test colum
* add col-wrapzero and data-string-zero to define the column and zero
separated data
Karel Zak [Mon, 23 Oct 2023 12:35:21 +0000 (14:35 +0200)]
libsmartcols: support \x?? for data by samples/fromfile.c
The test (sample) binary already supports \n in strings to covert it
to the real line-break. It seem more generic to use \x?? (hex) to
support arbitrary byte in the column data.
Karel Zak [Thu, 12 Oct 2023 20:38:43 +0000 (22:38 +0200)]
libsmartcols: multi-line cells refactoring
* move data wrapping code to column.c
* do data wrapping on one place when copy cell data to buffer
* use table cursor in affected functions
* calculate tree ASCII-art to wrapped data
* mark wrap_chunksize() callback as deprecated; library calculates
the size itself from real data
Karel Zak [Thu, 12 Oct 2023 09:57:10 +0000 (11:57 +0200)]
libsmartcols: add table cursor
The cursor makes it simple for callbacks to access information about
the current cell, line and column. It will reduce number of necessary
arguments for callbacks.
Karel Zak [Mon, 23 Oct 2023 10:29:50 +0000 (12:29 +0200)]
Merge branch 'misc/fixes' of https://github.com/t-8ch/util-linux
* 'misc/fixes' of https://github.com/t-8ch/util-linux:
meson: don't try to build test_ca without libcap-ng
blkpr: store return value of getopt_long in int
Karel Zak [Mon, 23 Oct 2023 10:26:45 +0000 (12:26 +0200)]
Merge branch 'path' of https://github.com/stoeckmann/util-linux
* 'path' of https://github.com/stoeckmann/util-linux:
sys-utils/lscpu: Use ul_path_scanf where possible
lib/path: Set errno in case of fgets failure
lib/path: fix typos
lib/path: remove ul_prefix_fopen
lib/path: set errno in case of error
lib/path: fix possible out of boundary access
Thomas Weißschuh [Sat, 14 Oct 2023 10:14:42 +0000 (12:14 +0200)]
libblkid: (vxfs) add test files
The test files have been constructed manually from the prober.
While not providing a real test at least they make sure that the
existing logic stays stable.
Yuezhang Mo [Wed, 11 Oct 2023 10:42:11 +0000 (18:42 +0800)]
libblkid: exfat: fix fail to find volume label
Commit f98b56326 set the maximum number of iterations to 10000.
If the volume label is after the 10000th entry, the volume label
will not be found. So this commit sets the maximum number of
iterations to correct value 256×1024×1024/32.
Fixes: f98b56326 ("libblkid: [exfat] Limit maximum number of iterations in find_label") Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Reviewed-by: Andy Wu <Andy.Wu@sony.com> Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com>
Karel Zak [Mon, 9 Oct 2023 11:04:07 +0000 (13:04 +0200)]
Merge branch 'libmount/errormsg' of https://github.com/t-8ch/util-linux
* 'libmount/errormsg' of https://github.com/t-8ch/util-linux:
libmount: report all kernel messages for fd-based mount API
libmount: add helper to log mount messages as emitted by kernel
libmount: change syscall status macros to be functions
Karel Zak [Mon, 9 Oct 2023 10:26:37 +0000 (12:26 +0200)]
Merge branch 'lsfs--sockdiag-RW' of https://github.com/masatake/util-linux
* 'lsfs--sockdiag-RW' of https://github.com/masatake/util-linux:
lsfd: (man) update the description of ENDPOINTS column of UNIX-Stream sockets
tests: (lsfd) extend the mkfds-socketpair case to test ENDPOINTS with SOCK.SHUTDOWN info
lsfd: append SOCK.SHUTDOWN value to ENDPOINTS column of UNIX-STREAM sockets
tests: (lsfd) add a case for testing SOCK.SHUTDOWN column
tests: (test_mkfds::socketpair) add "halfclose" parameter
lsfd: don't capitalize the help strings for the columns
lsfd: (man) write about SOCK.SHUTDOWN column
lsfd: add SOCK.SHUTDOWN column
lsfd: call xinfo backend method before calling socket generic method when filling columns
tests: (lsfd) add a case for testing ENDPOINTS column of UNIX-STREAM sockets
tests: (lsfd::mkfds-socketpair) make a case for testing DGRAM a subtest and add a subtest for STREAM
lsfd: (man) document the ENDPOINT column for UNIX socket
lsfd: fill ENDPOINTS column of unix socket using UNIX_DIAG_PEER information
lsfd: make the sock_xinfo layer be able to prepare an ipc_class for a given socket
lsfd: initialize the ipc table before loading lists of unix socket peers via netlink diag
`conf` as configuration_data() object can contain any datatype.
For `HAVE_FOO` variables this will be a `1` int to generate
`#define HAVE_FOO 1` or a `false` bool to generate `#undef HAVE_FOO`
in `conf.h`.
When retrieving and testing `HAVE_FOO` from `conf` it can be both types.
Newer versions of meson are unhappy about comparisions of int with
non-int
../meson.build:734: DEPRECATION: Project uses feature that was always broken, and is now deprecated since '1.2.0': int operations with non-int. It is not commutative and only worked because of leaky Python abstractions.
WARNING: Broken features used:
* 1.2.0: {'int operations with non-int'}
As both `int` and `bool` support a `.to_string()` method, we can use
that to convert them into a well-known type and compare that.
Unfortunately meson does not implement a way to determine the type of a
value.
A method `int.to_int()` would also have worked but does not exist.
This broken feature was actually first recognized in util-linux.
See #2312 and https://github.com/mesonbuild/meson/pull/11879.
The function ul_prefix_fopen does not properly check for paths which are
too long. Since the only caller of ul_prefix_fopen can be easily
converted to ul_path_fopen, remove the function.
libmount: add helper to log mount messages as emitted by kernel
The kernel helpfully provides feedback about failed operations via the
filesystem descriptor. Read that information and expose it via libmounts
debug facilities.
Karel Zak [Wed, 4 Oct 2023 18:08:06 +0000 (20:08 +0200)]
Merge branch 'libblkid/align' of https://github.com/t-8ch/util-linux
* 'libblkid/align' of https://github.com/t-8ch/util-linux:
libblkid: (probe) remove chunking from blkid_probe_get_idmag()
libblkid: (probe) read data in chunks
swapon: (tests) abort test on failing commands
libblkid: reset errno before calling probefuncs
libfdisk: reset errno before calling read()
Karel Zak [Wed, 4 Oct 2023 17:35:26 +0000 (19:35 +0200)]
Merge branch 'ci/musl' of https://github.com/t-8ch/util-linux
* 'ci/musl' of https://github.com/t-8ch/util-linux:
ci: run full testsuite under musl libc
build-sys: only build col on glibc
lib/timeutils: don't use glibc strptime extension
Karel Zak [Mon, 2 Oct 2023 10:40:55 +0000 (12:40 +0200)]
Merge branch 'libblkid/drbd-simplify' of https://github.com/t-8ch/util-linux
* 'libblkid/drbd-simplify' of https://github.com/t-8ch/util-linux:
libblkid: (drbd) avoid unaligned accesses
include/c.h: add helpers for unaligned structure access
libblkid: (drbd) use magics
libblkid: (probe) allow superblock offset from end of device
libblkid: (cramfs) use magic hint
libblkid: (probe) add magic hint
libblkid: (drbd) validate size in standard minsz predicate
libblkid: (via_raid) validate size in standard minsz predicate
libblkid: (silicon_raid) validate size in standard minsz predicate
libblkid: (promise_raid) validate size in standard minsz predicate
libblkid: (nvidia_raid) validate size in standard minsz predicate
libblkid: (lsi_raid) validate size in standard minsz predicate
libblkid: (jmicron_raid) validate size in standard minsz predicate
libblkid: (isw_raid) validate size in standard minsz predicate
libblkid: (highpoint_raid) validate size in standard minsz predicate
libblkid: (ddf_raid) validate size in standard minsz predicate
libblkid: (adapted_raid) validate size in standard minsz predicate
libblkid: (probe) remove duplicate log
Karel Zak [Mon, 2 Oct 2023 10:40:38 +0000 (12:40 +0200)]
Merge branch 'analyzer2' of https://github.com/t-8ch/util-linux
* 'analyzer2' of https://github.com/t-8ch/util-linux:
libblkid: (probe) handle probe without chain gracefully
libsmartcols: (cell) consistently handle NULL argument
lib/idcache: always gracefully handle null cache
script-playutils: close filestream in case ignore_line() fails
lib/colors: correct documentation of colors_add_scheme()
treewide: use reallocarray to allocated memory that will be reallocated