Commit Graph

79591 Commits

Author SHA1 Message Date
Yu Watanabe
d13b5fdc01 TEST-75-RESOLVED: check TXT field 2025-02-16 23:10:16 +09:00
Yu Watanabe
5a07bb2c55 TEST-75-RESOLVED: revert changes done in each test case 2025-02-16 22:55:22 +09:00
Yu Watanabe
6ad252c1a5 TEST-75-RESOLVED: drop unnecessary symlink creation
It is always done in setup().
2025-02-16 22:55:22 +09:00
Yu Watanabe
0592f3f413 resolve: refuse ResolveService method if SRV is filtered
Follow-up for 81ae2237c1.
2025-02-16 22:54:56 +09:00
Yu Watanabe
9ec25fba5a resolve: if both A and AAAA are refused, do not resolve address when resolving service
Similarly, set NO_TXT flag if TXT is filtered.

Follow-up for 81ae2237c1.
Fixes https://github.com/systemd/systemd/pull/36353#issuecomment-2659558382.
2025-02-16 22:54:00 +09:00
Yu Watanabe
3c31cc3981 resolve: allow to specify SD_RESOLVED_NO_SEARCH flag in ResolveRecord
The varlink method io.systemd.Resolve.ResolveRecord already accepts the
flag. Let's also the bus method accept the flag, for consistency.
2025-02-16 22:41:10 +09:00
Yu Watanabe
7cf95470f3 resolve: unify two validate_and_mangle_flags()
The argument `Manager *manager`, is currently unused, but will be used
later.
2025-02-16 22:39:52 +09:00
Yu Watanabe
5f494e8fa6 macro-fundamental: add _nonnull_if_nonzero_ and use it in basic/ (#36395) 2025-02-16 20:21:08 +09:00
Yu Watanabe
56ab3ae170 journal-upload: several follow-ups for Accept-Encoding header handling
This makes,
- When a wildcard value '*' is specified, use the first supported
  compression algorithm,
- disable compression if Accept-Encoding header is unspecified or
  no supported compression algorithm specified in the header,
- ignore all errors in parsing the header.
2025-02-16 20:10:27 +09:00
Yu Watanabe
04b096400b journal-upload: split-out update_content_encoding_header()
No functional change, just refactoring and preparation for later commit.
2025-02-16 20:08:39 +09:00
Yu Watanabe
c259c9e253 journal-remote: several follow-ups for Compression= option handling
Follow-ups for cfaf78001c.

- use OrderedHashmap to manage configured compression algorithms, then
  drop CompressionArgs,
- rename CompressionOpts -> CompressionConfig,
- refuse 'none' in Compression= setting, but accept boolean false, which
  disables compression,
- when Compression= option is unspecified, enable all supported compression
  algorithms by default,
- do not set 'none' to the Accept-Encoding header.
2025-02-16 20:08:39 +09:00
Yu Watanabe
8c7e4e0d5e journal-remote: replace extract_first_word() with simple strchr() 2025-02-16 20:08:39 +09:00
Yu Watanabe
c272c06b9e journal-remote: assume received data is not compressed when Content-Encoding header is not set
Also, refuse spurious header `Content-Encoding: none`.
2025-02-16 20:08:39 +09:00
Yu Watanabe
fc1cf91aa8 journal-remote: copy positional arguments
This also fixes several memory leaks.
2025-02-16 20:08:39 +09:00
Yu Watanabe
a8516216d2 journal-remote: trivial coding style fix 2025-02-16 20:08:39 +09:00
Daan De Meyer
eba51a9dbd repart: Delay private key and certificate check until actual use
For many reasons, we might not actually sign a verity signature
partition, even if ope is specified in the partition definition files.
It might already exist, it might be deferred, it might be excluded, ...

Since we cannot check if partition already exists when reading the
configuration, let's delay the check for whether a certificate and
key have been provided until we're actually about to sign a roothash.
2025-02-16 10:43:56 +01:00
Mike Yuan
6da2ea9fa9 basic: use _nonnull_if_nonzero_ where appropriate 2025-02-16 12:37:10 +09:00
Mike Yuan
6bdbfb7eb6 basic/escape: swap 'bad' and 'len' params for decescape()
To follow our usual coding style.
2025-02-16 12:37:10 +09:00
Mike Yuan
7de7c7b6dc basic/escape: accept SIZE_MAX and perform overflow check in cescape_length() and decescape() too
While at it, make cescape() static inline.
2025-02-16 12:37:10 +09:00
Mike Yuan
c7a097d7e1 basic/escape: octescape() doesn't really take 'bad' param 2025-02-16 12:37:10 +09:00
Mike Yuan
3aa0cf23b4 macro-fundamental: add _nonnull_if_nonzero_
Introduced in gcc 15:
19fe55c480
2025-02-16 12:37:10 +09:00
Daan De Meyer
034f027be4 mkosi: Install systemd in Fedora build image
rpm pulls in systemd-standalone-sysusers now by default to get
systemd-sysusers which causes a conflict later on during the prepare
script when systemd is pulled in as a dependency of device-mapper so
let's install systemd in the initial transaction so systemd provides
systemd-sysusers and systemd-standalone-sysusers is never installed
in the first place.
2025-02-15 23:37:50 +00:00
Louis Sautier
24af6a0d0a man/networkd.conf: add missing whitespace between words
Signed-off-by: Louis Sautier <sautier.louis@gmail.com>
2025-02-16 00:27:43 +01:00
Luca Boccassi
05e0c43a0b README: fix broken link in OBS badge
The badge link was updated, but the URL link was not

Follow-up for 13871aa656
2025-02-15 01:32:51 +00:00
Volodymyr Shkriabets
f6209ca4d7 hwdb.d: add ANP09 Intel n100 tablet sensor configuration (#36390)
I propose fix for ACCEL_MOUNT_MATRIX for popular on China markets Intel
n100 7" tablet. I can't find any information about manufacturer.

P:
/devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-14/i2c-BOSC0200:00
M: i2c-BOSC0200:00
R: 00
J: +i2c:i2c-BOSC0200:00
U: i2c
V: bmc150_accel_i2c
E:
DEVPATH=/devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-14/i2c-BOSC0200:00
E: SUBSYSTEM=i2c
E: DRIVER=bmc150_accel_i2c
E: MODALIAS=acpi:BOSC0200:BOSC0200:
E: USEC_INITIALIZED=3546649
E: ID_VENDOR_FROM_DATABASE=BOS

P:
/devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-14/i2c-BOSC0200:00/iio:device0
M: iio:device0
R: 0
J: c238:0
U: iio
T: iio_device
D: c 238:0
N: iio:device0
L: 0
E:
DEVPATH=/devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-14/i2c-BOSC0200:00/iio:device0
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=238
E: MINOR=0
E: USEC_INITIALIZED=3556556
E: ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, -1
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:


DMI tablet string


dmi:bvnAmericanMegatrendsInternational,LLC.:bvrANP09_INTEL001:bd08/16/2024:br5.27:efr0.0:svn:pn:pvrDefaultstring:rvn:rn:rvrDefaultstring:cvnDefaultstring:ct10:cvrDefaultstring:sku:
2025-02-15 00:39:50 +00:00
Luca Boccassi
21d36ef770 mkosi: Fix mkosi.clangd (#36387)
- Add missing '--' delimiter
- Use the new BuildSubdirectory JSON field to figure out the build
  subdirectory.
- Remove the /usr/include path mapping for now. This means we can't
  jump into system headers anymore if they don't exist on the host,
  we can find a way to add this back later if it turns out to be
  crucial.
2025-02-14 20:02:45 +00:00
Daan De Meyer
531750e9b0 mkosi: Fix mkosi.clangd
- Add missing '--' delimiter
- Use the new BuildSubdirectory JSON field to figure out the build
  subdirectory.
- Remove the /usr/include path mapping for now. This means we can't
  jump into system headers anymore if they don't exist on the host,
  we can find a way to add this back later if it turns out to be
  crucial.
2025-02-14 17:13:10 +01:00
Daan De Meyer
487ec6aa3f mkosi: Update to latest 2025-02-14 17:13:08 +01:00
Zbigniew Jędrzejewski-Szmek
8c81f9a3cf ukify: fixes with kernel compression (#36381) 2025-02-14 16:47:49 +01:00
fishears
8ac7e25aab hwdb.d: add support for Akoya P15645 2025-02-15 00:10:00 +09:00
Yu Watanabe
5a83fd5a2a resolve: fix use-after-free (#36353)
Fixes a bug introduced by 81ae2237c1.
Fixes #36351.
2025-02-15 00:03:21 +09:00
Yu Watanabe
03d8b9dfab TEST-75-RESOLVED: skip a testcase when running on sanitizer 2025-02-14 11:54:56 +00:00
Yu Watanabe
2c9d6986d8 TEST-75-RESOLVED: keep IPv6 stack enabled
To make the issue #36351 easily reproduced.
2025-02-14 11:54:56 +00:00
Yu Watanabe
39da9b894f TEST-75-RESOLVED: assume knot 3.0 or newer is installed
And make the test failed if knot is installed but older than 3.0.
2025-02-14 11:54:56 +00:00
Yu Watanabe
bf4b254d70 mkosi: wrap several more commands when running on sanitizers
They are used in TEST-75-RESOLVED.
2025-02-14 11:54:56 +00:00
Muhammad Nuzaihan Bin Kamal Luddin
e644b332d0 resolve: clear previous assignments of RefuseRecordTypes= on reload
Follow-up for 81ae2237c1.
2025-02-14 11:54:56 +00:00
Yu Watanabe
225dbd6108 resolve: fix use-after-free
Fixes a bug introduced by 81ae2237c1.
Fixes #36351.
2025-02-14 11:54:56 +00:00
Mike Yuan
d08848b906 README: new mount API was introduced in v5.2
Follow-up for d75c74e7bf
2025-02-14 12:53:22 +01:00
Luca Boccassi
cdedc90caf ukify: do not insist on a stub being available when joining pcrsigs
It is not used in this case, so skip it, otherwise it will need to be
installed even if it is not used

Follow-up for 9876e88e23
2025-02-14 10:57:03 +00:00
Luca Boccassi
0dd03215f1 ukify: if the specified kernel is not a valid PE file try to decompress it
On some distros on some architectures (e.g.: Ubuntu arm64) the kernel is shipped as
a gzipped file, which the UEFI firmware does not understand.
If pefile fails to parse it, try to decompress it.
2025-02-14 10:57:03 +00:00
Luca Boccassi
a6d51ae582 ukify: fix zboot parsing with zstd
The header starts with 'zstd', not 'zstd22':

$ ukify build --linux vmlinuz-6.13+unreleased-cloud-arm64 --initrd /boot/initrd.img-6.12.12-amd64 --output uki
Kernel version not specified, starting autodetection 😖.
Real-Mode Kernel Header magic not found
+ readelf --notes vmlinuz-6.13+unreleased-cloud-arm64
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
Traceback (most recent call last):
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2510, in <module>
    main()
    ~~~~^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2499, in main
    make_uki(opts)
    ~~~~~~~~^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 1328, in make_uki
    opts.uname = Uname.scrape(linux, opts=opts)
                 ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 384, in scrape
    version = func(filename, opts=opts)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 374, in scrape_generic
    text = maybe_decompress(filename)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 221, in maybe_decompress
    return get_zboot_kernel(f)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 201, in get_zboot_kernel
    raise NotImplementedError(f'unknown compressed type: {comp_type!r}')
NotImplementedError: unknown compressed type: b'zstd\x00\x00'
2025-02-14 10:28:41 +00:00
Luca Boccassi
fbc6fecf1a ukify: switch from zstd to zstandard
The zstd library does not support stream decompression, and it
requires the zstd header to contain extra metadata, that the kernel
build does not append:

$ file -k vmlinuz-6.13+unreleased-cloud-arm64
vmlinuz-6.13+unreleased-cloud-arm64: PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows, 2 sections\012- data
$ ukify build --linux vmlinuz-6.13+unreleased-cloud-arm64 --initrd /boot/initrd.img-6.12.12-amd64 --output uki
Kernel version not specified, starting autodetection 😖.
Real-Mode Kernel Header magic not found
+ readelf --notes vmlinuz-6.13+unreleased-cloud-arm64
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
Traceback (most recent call last):
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2508, in <module>
    main()
    ~~~~^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2497, in main
    make_uki(opts)
    ~~~~~~~~^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 1326, in make_uki
    opts.uname = Uname.scrape(linux, opts=opts)
                 ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 382, in scrape
    version = func(filename, opts=opts)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 372, in scrape_generic
    text = maybe_decompress(filename)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 219, in maybe_decompress
    return get_zboot_kernel(f)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 199, in get_zboot_kernel
    return cast(bytes, zstd.uncompress(f.read(size)))
                       ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
zstd.Error: Input data invalid or missing content size in frame header.

This appears to be by design:

https://github.com/sergey-dryabzhinsky/python-zstd/issues/53

Switch to python3-zstandard, which works.
2025-02-14 10:28:41 +00:00
Yu Watanabe
dd0d821a33 journal-remote: fix typo
Follow-ups for cfaf78001c.
2025-02-14 13:23:27 +09:00
Yu Watanabe
530ee01c60 TODO: fix typo
Follow-ups for 0eeeb36bd5 and
3fd11dbcd9.
2025-02-14 13:23:11 +09:00
Yu Watanabe
d75c74e7bf README: mention fsopen() is since kernel v5.2
It is introduced by the following commit.
24dcb3d90a
2025-02-14 13:06:33 +09:00
Yu Watanabe
4053af87bb core/mount: rework GracefulOptions= as x-systemd.graceful-option= (#36356)
Prompted by #36337
2025-02-14 13:01:14 +09:00
Yu Watanabe
daae625140 core/service: drop unneeded unit_add_to_gc_queue() (#36368) 2025-02-14 12:51:48 +09:00
Daan De Meyer
ebcd568aa3 mkosi: Update to latest 2025-02-14 02:05:03 +00:00
Luca Boccassi
1585237b6a varlink idl fixes (#36376) 2025-02-13 21:16:04 +00:00
Daan De Meyer
1e6514d6d0 fmf: Don't fail if we can't modify sysctl values
If the script is running unprivileged we might not be able to modify
these so let's skip in that case.
2025-02-13 20:35:56 +00:00