]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 months agoukify: avoid treating invalid option as an argument 36389/head
Zbigniew Jędrzejewski-Szmek [Fri, 14 Feb 2025 10:16:03 +0000 (11:16 +0100)] 
ukify: avoid treating invalid option as an argument

For some reason, argparse treats undefined options as positional args in
certain scenarios:

$ src/ukify/ukify.py --badopt='11'
ukify.py: error: unrecognized arguments: --badopt=11
$ src/ukify/ukify.py --badopt '11'
ukify.py: error: unrecognized arguments: --badopt
$ src/ukify/ukify.py --badopt '11 12'
Assuming obsolete command line syntax with no verb. Please use 'build'.
Traceback (most recent call last):
  File "/home/zbyszek/src/systemd/src/ukify/ukify.py", line 2497, in <module>
    main()
    ~~~~^^
  File "/home/zbyszek/src/systemd/src/ukify/ukify.py", line 2485, in main
    check_inputs(opts)
    ~~~~~~~~~~~~^^^^^^
  File "/home/zbyszek/src/systemd/src/ukify/ukify.py", line 671, in check_inputs
    value.open().close()
    ~~~~~~~~~~^^
  File "/usr/lib64/python3.13/pathlib/_local.py", line 537, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '--badopt=11 12'

I suspect that this is some crap compat for Windows, where option parsing is
an even bigger mess than here.

Being told about positional args, when no positional args were specified is
confusing, so add a check for this.

8 months agoukify: drop dots from exception messages
Zbigniew Jędrzejewski-Szmek [Mon, 3 Feb 2025 09:38:01 +0000 (10:38 +0100)] 
ukify: drop dots from exception messages

In Python, exception messages are often embedded in surrounding text, so in
general they should not contain punctuation.

Also, no need to instantiate the exception object if no arguments are used.

8 months agotest/ukify: deduplicate path specification
Zbigniew Jędrzejewski-Szmek [Mon, 3 Feb 2025 09:34:50 +0000 (10:34 +0100)] 
test/ukify: deduplicate path specification

8 months agoukify: fixes with kernel compression (#36381)
Zbigniew Jędrzejewski-Szmek [Fri, 14 Feb 2025 15:47:49 +0000 (16:47 +0100)] 
ukify: fixes with kernel compression (#36381)

8 months agohwdb.d: add support for Akoya P15645
fishears [Fri, 14 Feb 2025 13:45:36 +0000 (13:45 +0000)] 
hwdb.d: add support for Akoya P15645

8 months agoresolve: fix use-after-free (#36353)
Yu Watanabe [Fri, 14 Feb 2025 15:03:21 +0000 (00:03 +0900)] 
resolve: fix use-after-free (#36353)

Fixes a bug introduced by 81ae2237c1792943a1ec712ae2e630bcc592175b.
Fixes #36351.

8 months agoTEST-75-RESOLVED: skip a testcase when running on sanitizer 36353/head
Yu Watanabe [Wed, 12 Feb 2025 16:01:28 +0000 (01:01 +0900)] 
TEST-75-RESOLVED: skip a testcase when running on sanitizer

8 months agoTEST-75-RESOLVED: keep IPv6 stack enabled
Yu Watanabe [Wed, 12 Feb 2025 11:25:28 +0000 (20:25 +0900)] 
TEST-75-RESOLVED: keep IPv6 stack enabled

To make the issue #36351 easily reproduced.

8 months agoTEST-75-RESOLVED: assume knot 3.0 or newer is installed
Yu Watanabe [Wed, 12 Feb 2025 10:56:25 +0000 (19:56 +0900)] 
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.

8 months agomkosi: wrap several more commands when running on sanitizers
Yu Watanabe [Wed, 12 Feb 2025 10:58:10 +0000 (19:58 +0900)] 
mkosi: wrap several more commands when running on sanitizers

They are used in TEST-75-RESOLVED.

8 months agoresolve: clear previous assignments of RefuseRecordTypes= on reload
Muhammad Nuzaihan Bin Kamal Luddin [Wed, 12 Feb 2025 05:40:04 +0000 (13:40 +0800)] 
resolve: clear previous assignments of RefuseRecordTypes= on reload

Follow-up for 81ae2237c1792943a1ec712ae2e630bcc592175b.

8 months agoresolve: fix use-after-free
Yu Watanabe [Tue, 11 Feb 2025 14:17:05 +0000 (23:17 +0900)] 
resolve: fix use-after-free

Fixes a bug introduced by 81ae2237c1792943a1ec712ae2e630bcc592175b.
Fixes #36351.

8 months agoREADME: new mount API was introduced in v5.2
Mike Yuan [Fri, 14 Feb 2025 11:52:25 +0000 (12:52 +0100)] 
README: new mount API was introduced in v5.2

Follow-up for d75c74e7bf2b6c786bd68ff81cbba712f97a7417

8 months agoukify: do not insist on a stub being available when joining pcrsigs 36381/head
Luca Boccassi [Fri, 14 Feb 2025 02:05:48 +0000 (02:05 +0000)] 
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 9876e88e23ad1ecbffd7c69b2e0a4cbff283f681

8 months agoukify: if the specified kernel is not a valid PE file try to decompress it
Luca Boccassi [Thu, 13 Feb 2025 19:44:12 +0000 (19:44 +0000)] 
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.

8 months agoukify: fix zboot parsing with zstd
Luca Boccassi [Thu, 13 Feb 2025 19:43:00 +0000 (19:43 +0000)] 
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'

8 months agoukify: switch from zstd to zstandard
Luca Boccassi [Thu, 13 Feb 2025 19:38:45 +0000 (19:38 +0000)] 
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.

8 months agojournal-remote: fix typo
Yu Watanabe [Fri, 14 Feb 2025 04:22:28 +0000 (13:22 +0900)] 
journal-remote: fix typo

Follow-ups for cfaf78001c3451d549bcb1ee4adca3e85b934e56.

8 months agoTODO: fix typo
Yu Watanabe [Fri, 14 Feb 2025 04:20:17 +0000 (13:20 +0900)] 
TODO: fix typo

Follow-ups for 0eeeb36bd5361ed43cf7bc27132ac0aaad562376 and
3fd11dbcd94880541d1a8856b1881ac24aea448e.

8 months agoREADME: mention fsopen() is since kernel v5.2
Yu Watanabe [Fri, 14 Feb 2025 04:05:39 +0000 (13:05 +0900)] 
README: mention fsopen() is since kernel v5.2

It is introduced by the following commit.
https://github.com/torvalds/linux/commit/24dcb3d90a1f67fe08c68a004af37df059d74005

8 months agocore/mount: rework GracefulOptions= as x-systemd.graceful-option= (#36356)
Yu Watanabe [Fri, 14 Feb 2025 04:01:14 +0000 (13:01 +0900)] 
core/mount: rework GracefulOptions= as x-systemd.graceful-option= (#36356)

Prompted by #36337

8 months agocore/service: drop unneeded unit_add_to_gc_queue() (#36368)
Yu Watanabe [Fri, 14 Feb 2025 03:51:48 +0000 (12:51 +0900)] 
core/service: drop unneeded unit_add_to_gc_queue() (#36368)

8 months agomkosi: Update to latest
Daan De Meyer [Thu, 13 Feb 2025 18:56:34 +0000 (19:56 +0100)] 
mkosi: Update to latest

8 months agovarlink idl fixes (#36376)
Luca Boccassi [Thu, 13 Feb 2025 21:16:04 +0000 (21:16 +0000)] 
varlink idl fixes (#36376)

8 months agofmf: Don't fail if we can't modify sysctl values
Daan De Meyer [Thu, 13 Feb 2025 13:41:21 +0000 (14:41 +0100)] 
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.

8 months agocore/condition: fix segfault when key not found in os-release
Zbigniew Jędrzejewski-Szmek [Thu, 13 Feb 2025 14:49:50 +0000 (15:49 +0100)] 
core/condition: fix segfault when key not found in os-release

'ConditionOSRelease=|ID_LIKE$=*rhel*' results in a segfault.
The key 'ID_LIKE' is not present in Fedora's os-release file.

I think the most reasonable behaviour is to treat missing keys as empty.
This matches the "shell-like" sprit, since in a shell empty keys would
by default be treated as empty too. Thus, "ID_LIKE=" would match, if
ID_LIKE is not present in the file, and ID_LIKE=!$foo" would also match.
The other option would be to make those matches fail, but I think that'd
make the feature harder to use, esp. with negative matches.

Documentation is updated to clarify the new behaviour.

https://bugzilla.redhat.com/show_bug.cgi?id=2345544

8 months agologind: map enum strings to underscores in logind 36376/head
Lennart Poettering [Thu, 13 Feb 2025 17:16:18 +0000 (18:16 +0100)] 
logind: map enum strings to underscores in logind

Varlink doesn't know dashes in enums, we use them all the time. Convert
dashes to underscores hence before we pass them through varlink.

8 months agovarlink: fix IDL for errno error
Lennart Poettering [Thu, 13 Feb 2025 17:15:52 +0000 (18:15 +0100)] 
varlink: fix IDL for errno error

8 months agoupdate TODO
Lennart Poettering [Thu, 13 Feb 2025 16:38:54 +0000 (17:38 +0100)] 
update TODO

8 months agoupdate TODO
Lennart Poettering [Thu, 13 Feb 2025 16:35:59 +0000 (17:35 +0100)] 
update TODO

8 months agosysupdate: Don't use compression extension for UKIs in manpage
Daan De Meyer [Thu, 13 Feb 2025 12:03:39 +0000 (13:03 +0100)] 
sysupdate: Don't use compression extension for UKIs in manpage

UKIs should generally not be compressed since the kernel image and
initrd in them will already be compressed so let's remove the compression
suffix from the examples in the sysupdate manpage.

8 months agoptyfwd: Forward various signals to forked process (#36345)
Daan De Meyer [Thu, 13 Feb 2025 10:30:34 +0000 (11:30 +0100)] 
ptyfwd: Forward various signals to forked process (#36345)

8 months agoUpdate TODO 36345/head
Daan De Meyer [Thu, 13 Feb 2025 08:42:36 +0000 (09:42 +0100)] 
Update TODO

8 months agoptyfwd: Forward various signals to forked process
Daan De Meyer [Mon, 10 Feb 2025 22:59:04 +0000 (23:59 +0100)] 
ptyfwd: Forward various signals to forked process

We want systemd-pty-forward to be something that can be dropped in
somewhere without too much thought. To enable this, let's make sure
we forward various signals to the forked process. This makes sure that
any signals are delivered to the actual child process regardless of whether
it's running within systemd-pty-forward or not.

8 months agologin: Queue session for garbage collection on leader death (#36364)
Lennart Poettering [Thu, 13 Feb 2025 08:10:06 +0000 (09:10 +0100)] 
login: Queue session for garbage collection on leader death (#36364)

This ensures sessions are cleaned up properly in case the user service
manager was manually stopped.

How to reproduce:
- Install Fedora 41
- Log in
- Run `systemctl --user exit`
- Log in again
- Run `loginctl`

Expected results:
- Only 1 `manager` session

Actual results:
- More than 1 `manager` session

8 months agologin: Queue session for garbage collection on leader death 36364/head
msizanoen [Wed, 12 Feb 2025 14:27:25 +0000 (21:27 +0700)] 
login: Queue session for garbage collection on leader death

This ensures sessions are cleaned up properly in case the user service
manager was manually stopped.

8 months agologin: Continue watching leader pidfd after stop
msizanoen [Wed, 12 Feb 2025 15:09:01 +0000 (22:09 +0700)] 
login: Continue watching leader pidfd after stop

This ensures that garbage collection will be triggered when the leader
process dies.

8 months agoupdate TODO
Lennart Poettering [Wed, 12 Feb 2025 21:02:04 +0000 (22:02 +0100)] 
update TODO

8 months agoupdate TODO
Lennart Poettering [Wed, 12 Feb 2025 20:55:57 +0000 (21:55 +0100)] 
update TODO

8 months agomkosi: Update to latest
Daan De Meyer [Wed, 12 Feb 2025 10:09:36 +0000 (11:09 +0100)] 
mkosi: Update to latest

In https://github.com/systemd/mkosi/pull/3497, mkosi has started parsing
options passed after the verb as regular mkosi options instead of options
for the invoked command. We adapt to this change by adding '--' as a delimiter
everywhere where required.

8 months agocore/mount: log only once about fs not supporting new mount API 36356/head
Mike Yuan [Tue, 11 Feb 2025 18:44:59 +0000 (19:44 +0100)] 
core/mount: log only once about fs not supporting new mount API

8 months agomountpoint-util: assume fsopen() works in mount_option_supported()
Mike Yuan [Wed, 12 Feb 2025 14:44:13 +0000 (15:44 +0100)] 
mountpoint-util: assume fsopen() works in mount_option_supported()

Our baseline includes it now.

8 months agocore/mount: rework GracefulOptions= to be just x-systemd.graceful-option=
Mike Yuan [Tue, 11 Feb 2025 17:43:25 +0000 (18:43 +0100)] 
core/mount: rework GracefulOptions= to be just x-systemd.graceful-option=

09fbff57fcde47782a73f23b3d5cfdcd0e8f699b introduced new knob
for such functionality. However, that seems unnecessary.

The mount option string is ubiquitous in that all of fstab,
kernel cmdline, credentials, systemd-mount, ... speak it.
And we already have x-systemd.device-bound= that's parsed
by pid1 instead of fstab-generator. It feels hence more natural
for graceful options to be an extension of that, rather than
its own property.

There's also one nice side effect that the setting itself
is now more graceful for systemd versions not supporting
such feature.

8 months agocore/service: drop unneeded unit_add_to_gc_queue() 36368/head
Mike Yuan [Wed, 12 Feb 2025 16:38:47 +0000 (17:38 +0100)] 
core/service: drop unneeded unit_add_to_gc_queue()

Follow-up for a1d315730ffddf283d4bb9d73878fbcd97a4d244
and 6ac62d61db737b01ad3776a7688d8a4c57b3f7d9

With the aforementioned commits, unit_release_resources()
is dispatched in a dedicated queue, and Service.n_keep_fd_store
has been dropped, hence the comment is outdated. Moreover,
the unit is added to GC queue in unit_notify() already.
No other unit types do this in corresponding _enter_dead()
functions, nor does Service need it anymore.

8 months agocore/unit: use UNIT_IS_INACTIVE_OR_FAILED at one more place
Mike Yuan [Wed, 12 Feb 2025 16:48:59 +0000 (17:48 +0100)] 
core/unit: use UNIT_IS_INACTIVE_OR_FAILED at one more place

8 months agobus-unit-util: add missing assertions
Mike Yuan [Tue, 11 Feb 2025 17:13:01 +0000 (18:13 +0100)] 
bus-unit-util: add missing assertions

8 months agocore/dbus-mount: add missing ReloadResult and CleanResult properties
Mike Yuan [Mon, 10 Feb 2025 19:24:22 +0000 (20:24 +0100)] 
core/dbus-mount: add missing ReloadResult and CleanResult properties

8 months agocore/mount: trivial coding style cleanups
Mike Yuan [Wed, 12 Feb 2025 13:56:34 +0000 (14:56 +0100)] 
core/mount: trivial coding style cleanups

8 months agocore/mount: report accurate can_start and can_reload
Mike Yuan [Mon, 10 Feb 2025 19:22:09 +0000 (20:22 +0100)] 
core/mount: report accurate can_start and can_reload

8 months agocore/mount: check parameters_fragment first in mount_enter_(re)mounting()
Mike Yuan [Sun, 9 Feb 2025 19:41:20 +0000 (20:41 +0100)] 
core/mount: check parameters_fragment first in mount_enter_(re)mounting()

I.e. don't perform any action if we can't spawn mount task anyway.
Later the same check would be added to mount_can_start/reload(),
so this makes things more coherent too.

8 months agocore/mount: filter out "fail" option as well
Mike Yuan [Sun, 9 Feb 2025 19:25:21 +0000 (20:25 +0100)] 
core/mount: filter out "fail" option as well

8 months agocore/dbus-service: fix alignment
Mike Yuan [Sun, 9 Feb 2025 18:59:13 +0000 (19:59 +0100)] 
core/dbus-service: fix alignment

8 months agoudev: several improvements for debugging logs (#36357)
Daan De Meyer [Wed, 12 Feb 2025 13:35:46 +0000 (14:35 +0100)] 
udev: several improvements for debugging logs (#36357)

8 months agosocket: resolve unit specifiers in BindToDevice
Paul Fertser [Tue, 11 Feb 2025 13:33:15 +0000 (13:33 +0000)] 
socket: resolve unit specifiers in BindToDevice

There are cases where templated Socket unit files are used for network services
with interface name used as an instance. This patch allows using %i for
BindToDevice setting to limit the scope automatically.

8 months agoudev-watch: do not try to remove invalid watch handle 36357/head
Yu Watanabe [Wed, 12 Feb 2025 00:23:33 +0000 (09:23 +0900)] 
udev-watch: do not try to remove invalid watch handle

When a new device is processed, there should be no watch handle for
the device, hence udev_watch_clear() provides -1. Let's not try to call
inotify_rm_watch() in that case.

This should not change any behavior. Just for suppressing spurious
debugging log:
=====
(udev-worker)[3626140]: zram1: Removing watch handle -1.
=====

8 months agoudev-watch: mention that the failure is ignored
Yu Watanabe [Wed, 12 Feb 2025 00:22:49 +0000 (09:22 +0900)] 
udev-watch: mention that the failure is ignored

8 months agoudev-worker: add debugging log about success of flock() for whole block device
Yu Watanabe [Wed, 12 Feb 2025 00:20:51 +0000 (09:20 +0900)] 
udev-worker: add debugging log about success of flock() for whole block device

8 months agonspawn: add @keyring to default syscall allow_list
Anthony Messina [Tue, 11 Feb 2025 00:38:11 +0000 (18:38 -0600)] 
nspawn: add @keyring to default syscall allow_list

Keyring namespacing introduced in kernel version v5.3-rc1 https://github.com/torvalds/linux/commit/c84ca912b07901be528e5184fd254fca1dddf2ac

Fixes #17606

8 months agoFollow-ups for xattr-util (#36335)
Yu Watanabe [Tue, 11 Feb 2025 22:59:24 +0000 (07:59 +0900)] 
Follow-ups for xattr-util (#36335)

8 months agoman: Fix a minor typo in the org.freedesktop.login1 man page
Philip Withnall [Tue, 11 Feb 2025 16:38:14 +0000 (16:38 +0000)] 
man: Fix a minor typo in the org.freedesktop.login1 man page

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
8 months agotest-xattr-util: return early if not privileged enough to set trusted.* 36335/head
Mike Yuan [Mon, 10 Feb 2025 12:33:43 +0000 (13:33 +0100)] 
test-xattr-util: return early if not privileged enough to set trusted.*

8 months agotest-xattr-util: relax listxattr() retval check
Mike Yuan [Sun, 9 Feb 2025 22:18:05 +0000 (23:18 +0100)] 
test-xattr-util: relax listxattr() retval check

Follow-up for d228afd792d713a754e4368c014c1f43f10cf5b7

Apparently security.selinux might get set on the file too,
behind our back.

8 months agoxattr-util: drop unnecessary nofollow normalization
Mike Yuan [Sun, 9 Feb 2025 21:56:00 +0000 (22:56 +0100)] 
xattr-util: drop unnecessary nofollow normalization

Follow-up for b8df25dcfe674e37ceb3d54e00a31e1d33e96057

This is some leftover from get/listxattrat() usage which
got dropped later.

8 months agoresolve: add an option to explicitly disable query AAAA, SRV, MX, etc... (#34165)
Muhammad Nuzaihan Bin Kamal Luddin [Tue, 11 Feb 2025 09:29:39 +0000 (17:29 +0800)] 
resolve: add an option to explicitly disable query AAAA, SRV, MX, etc... (#34165)

Based on this patch i had submitted to RedHat
(https://issues.redhat.com/browse/RHEL-56280), i am submitting this
patch to this upstream systemd.

There is no way to explicitly enable/disable IPv6 AAAA queries.

Problem was that i am using RHEL9 and some applications does not use a
newer glibc that supports `no-aaaa` option in `/etc/resolv.conf`. So
some applications will still resolve IPv6 AAAA even with `no-aaaa`
option and it is inconsistent across the system where some work and some
don't.

So this systemd-resolved patch catch-all queries and disable IPv6 AAAA
queries for all applications in the OS by having an option
`RefuseRecordTypes=AAAA` to disable IPv6 AAAA queries.

Although https://github.com/systemd/systemd/pull/28136 tries to fix this
automatically but it still does not work with
`net.ipv6.conf.all.disable_ipv6 = 1`. Also tried with explicitly
removing the conditional and force set `family = AF_INET` and still
resolves AAAA records.

The issue is that i want to explicitly disable IPv6 AAAA queries instead
of systemd-resolved to figure out itself which address family it is
using, which always have problems.

8 months agostring-util: introduce strprepend(), drop effectively unused strnappend() (#36343)
Yu Watanabe [Tue, 11 Feb 2025 09:09:03 +0000 (18:09 +0900)] 
string-util: introduce strprepend(), drop effectively unused strnappend() (#36343)

Split out from #36337

8 months agopo: Translated using Weblate (Bulgarian)
Alexander Shopov [Tue, 11 Feb 2025 01:17:15 +0000 (02:17 +0100)] 
po: Translated using Weblate (Bulgarian)

Currently translated at 100.0% (259 of 259 strings)

Co-authored-by: Alexander Shopov <ash@kambanaria.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/bg/
Translation: systemd/main

8 months agostring-util: modernize strextendn() a bit 36343/head
Mike Yuan [Mon, 10 Feb 2025 18:14:49 +0000 (19:14 +0100)] 
string-util: modernize strextendn() a bit

l == SIZE_MAX requires no special handling, since we assert
on (s || l == 0) above.

8 months agostring-util: drop now unused strnappend()
Mike Yuan [Mon, 10 Feb 2025 18:05:17 +0000 (19:05 +0100)] 
string-util: drop now unused strnappend()

8 months agoenv-util: use strextendn() instead of strnappend() where appropriate
Mike Yuan [Mon, 10 Feb 2025 18:04:29 +0000 (19:04 +0100)] 
env-util: use strextendn() instead of strnappend() where appropriate

8 months agocryptsetup: port to strprepend()
Mike Yuan [Mon, 10 Feb 2025 18:04:08 +0000 (19:04 +0100)] 
cryptsetup: port to strprepend()

8 months agostring-util: introduce strprepend() helper
Mike Yuan [Mon, 10 Feb 2025 18:03:08 +0000 (19:03 +0100)] 
string-util: introduce strprepend() helper

8 months agobootctl: fix potential uninitialized memory access (#36329)
Lennart Poettering [Mon, 10 Feb 2025 14:34:38 +0000 (15:34 +0100)] 
bootctl: fix potential uninitialized memory access (#36329)

8 months agoescape: apply the minimal ansi highlighting on --help we usually do (#36339)
Lennart Poettering [Mon, 10 Feb 2025 14:33:59 +0000 (15:33 +0100)] 
escape: apply the minimal ansi highlighting on --help we usually do (#36339)

8 months agoupdate TODO
Lennart Poettering [Mon, 10 Feb 2025 08:26:49 +0000 (09:26 +0100)] 
update TODO

8 months agopo: Translated using Weblate (Czech)
Jan Kalabza [Mon, 10 Feb 2025 02:01:27 +0000 (03:01 +0100)] 
po: Translated using Weblate (Czech)

Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Jan Kalabza <jan.kalabza@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/cs/
Translation: systemd/main

8 months agobootctl,kernel-install: suffix some paths referring to dirs in log messages with /
Lennart Poettering [Sun, 9 Feb 2025 08:54:04 +0000 (09:54 +0100)] 
bootctl,kernel-install: suffix some paths referring to dirs in log messages with /

8 months agoupdate TODO
Lennart Poettering [Sun, 9 Feb 2025 08:53:25 +0000 (09:53 +0100)] 
update TODO

8 months agobootctl: minor reordering of fields in output 36329/head
Lennart Poettering [Sun, 9 Feb 2025 22:34:29 +0000 (23:34 +0100)] 
bootctl: minor reordering of fields in output

Let's move the currently used/default/oneshot entry output after the
basic info about the boot loader itself, since conceptually these are
objects kinda "one level down" from the boot loader perspective. Hence,
let's *first* show all info about the boot loader itself before we
display the objects it manages.

This is just a trivial change in output, just swaps th elines for these
fields with the ones showing where the boot loader is installed.

8 months agoukify: add --pcr-certificate= parameter
Luca Boccassi [Sat, 8 Feb 2025 13:17:22 +0000 (13:17 +0000)] 
ukify: add --pcr-certificate= parameter

Public keys and certificates are not the same, as the latter embeds more
information that the former, and other tools like sd-measure have distinct
parameters for each of them.
Add a new --pcr-certificate= parameter to ukify, and use it to pass certs
down to sd-measure, as an alternative to --pcr-public-key=. Do not allow
specifying both.

8 months agobootctl: suppress output of empty partition info if we also have no idea about EFI...
Lennart Poettering [Sun, 9 Feb 2025 22:23:38 +0000 (23:23 +0100)] 
bootctl: suppress output of empty partition info if we also have no idea about EFI binary path

So far we'd output both the partition and the binary path always, even
if we didn't know either (but in that case show empty information).
Let's address this, and show partition info only if we know it, or if we
know the EFI binary path, but suppress both if we know neither.

Note that we'll show the partition info if we don't know it still if we
know the EFI binary path used for boot, since it is relative to the
partition of course, and hence it's really strange to know one but not
the other, hence it deserves some mentioning in the output.

8 months agobootctl: also shown whether stub loader partition data was passed
Lennart Poettering [Sun, 9 Feb 2025 22:21:08 +0000 (23:21 +0100)] 
bootctl: also shown whether stub loader partition data was passed

Let's make the stub and loader output sections more alike, and say in
both cases whether we recieved that data from the boot phase or not the
same way.

8 months agobootctl: fix potential uninitialized memory access
Lennart Poettering [Sun, 9 Feb 2025 08:53:39 +0000 (09:53 +0100)] 
bootctl: fix potential uninitialized memory access

And while we are at it, let' get rid of have_xyz_partition_uuid
variables, to simplify things.

8 months agotmpfiles: 3 trivial cleanups (#36332)
Yu Watanabe [Sun, 9 Feb 2025 17:33:33 +0000 (02:33 +0900)] 
tmpfiles: 3 trivial cleanups (#36332)

8 months agocore: remove path to transient unit file from unit name maps on stop (#36186)
Yu Watanabe [Sun, 9 Feb 2025 15:48:01 +0000 (00:48 +0900)] 
core: remove path to transient unit file from unit name maps on stop (#36186)

Fixes #35190.

8 months agomissing_sched: add CLONE_PIDFD
Michael Olbrich [Sun, 9 Feb 2025 12:32:36 +0000 (13:32 +0100)] 
missing_sched: add CLONE_PIDFD

CLONE_PIDFD was introduced in v5.2 and in sched.h in glibc-2.31 so
without this, building with older version fails with:

src/basic/raw-clone.h:41:108: error: 'CLONE_PIDFD' undeclared (first use in this function); did you mean 'CLONE_FILES'?

8 months agoxattr-util: try new *xattrat() family syscalls first (#36228)
Yu Watanabe [Sun, 9 Feb 2025 15:41:38 +0000 (00:41 +0900)] 
xattr-util: try new *xattrat() family syscalls first (#36228)

While killing cgroup v1 I want to turn all cg_* helpers to take
cgroupfs_fd + cg path, which means all relevant path operations must
support openat() semantics. `removexattrat()` is currently missing. I
took the chance to do a bigger refactor for xattr-util.

8 months agostoragetm: Check if /sys/kernel/config is a mountpoint
Daan De Meyer [Sat, 8 Feb 2025 11:44:19 +0000 (12:44 +0100)] 
storagetm: Check if /sys/kernel/config is a mountpoint

Otherwise we'll fail with an unclear error later on so let's check
this first before continuing.

8 months agotmpfiles: drop redundant proc_mounted() check 36332/head
Mike Yuan [Sun, 9 Feb 2025 14:25:05 +0000 (15:25 +0100)] 
tmpfiles: drop redundant proc_mounted() check

Follow-up for 01131684ac66e82faae18e40e110089003d7c536

After the mentioned commit, the execution of tmpfiles
is aborted without /proc/. No need to check for individual
operations.

8 months agotmpfiles: use prefix_roota() where appropriate
Mike Yuan [Sun, 9 Feb 2025 14:38:40 +0000 (15:38 +0100)] 
tmpfiles: use prefix_roota() where appropriate

8 months agotmpfiles: fix copypasta in create_symlink() (FIFO -> symlink)
Mike Yuan [Sun, 9 Feb 2025 14:38:05 +0000 (15:38 +0100)] 
tmpfiles: fix copypasta in create_symlink() (FIFO -> symlink)

8 months agohwdb: add accel orientation and location for the BMAX Y14
Enrico Tagliavini [Sun, 9 Feb 2025 13:44:46 +0000 (14:44 +0100)] 
hwdb: add accel orientation and location for the BMAX Y14

The BMAX MaxBook Y14 has 2 acceleromenter sensors, one seems to be in
the display, the other in the base. With the default ACCEL_MOUNT_MATRIX
monitor-sensor would report the display to be rotate of 180 degrees
compared to its real position, i.e. upside down when normal and vice
versa. Left up and right up are also swapped.

Correcting the ACCEL_MOUNT_MATRIX for the display sensor solves the
issue and monitor-sensor reports the correct values.

For the Y13 model the Z axis value was also inverted. For the Y14 to
work correctly, this is not necessary, but I'm not sure how to double
check this.

Sensors info:

P: /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-KIOX010A:00/iio:device0
M: iio:device0
R: 0
U: iio
T: iio_device
D: c 237:0
N: iio:device0
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-KIOX010A:00/iio:device0
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=237
E: MINOR=0
E: USEC_INITIALIZED=25931869
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:

P: /devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-3/i2c-KIOX020A:00/iio:device1
M: iio:device1
R: 1
U: iio
T: iio_device
D: c 237:1
N: iio:device1
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-3/i2c-KIOX020A:00/iio:device1
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device1
E: DEVTYPE=iio_device
E: MAJOR=237
E: MINOR=1
E: USEC_INITIALIZED=26000295
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:

accel-display
acpi:KIOX010A:KIOX010A:
dmi:bvnAmericanMegatrendsInternational,LLC.:bvr5.00_002:bd05/13/2024:br5.27:efr1.1:svnAMI:pnIntel:pvrDefaultstring:rvnAMI:rnIntel:rvrDefaultstring:cvnDefaultstring:ct31:cvrDefaultstring:skuH8Y6:

accel-base
acpi:KIOX020A:KIOX020A:

8 months agosmack-util: several cleanups 36228/head
Mike Yuan [Thu, 30 Jan 2025 14:33:13 +0000 (15:33 +0100)] 
smack-util: several cleanups

- Make _read_at and _apply_at variants the "canonical" functions
  (which leverage xsetxattr()/xremovexattr()), turn others
  into static inline helpers
- Unexport string table lookup (not used anywhere else)
- Define nop functions as static inline if !ENABLE_SMACK

8 months agotmpfiles,chown-recursive: port to xsetxattr()/xremovexattr()
Mike Yuan [Thu, 30 Jan 2025 16:30:45 +0000 (17:30 +0100)] 
tmpfiles,chown-recursive: port to xsetxattr()/xremovexattr()

8 months agotest-xattr-util: add test cases for symlinks
Mike Yuan [Sun, 9 Feb 2025 12:23:27 +0000 (13:23 +0100)] 
test-xattr-util: add test cases for symlinks

8 months agoxattr-util: try new *xattrat() family syscalls first
Mike Yuan [Mon, 20 Jan 2025 19:43:02 +0000 (20:43 +0100)] 
xattr-util: try new *xattrat() family syscalls first

Added in https://github.com/torvalds/linux/commit/6140be90ec70c39fa844741ca3cc807dd0866394

However, when O_PATH fds are encountered we'd have to go by
/proc/self/fd/ still, since the kernel people are reluctant
to make the new syscalls work with them
(https://lore.kernel.org/linux-fsdevel/20250206-steril-raumplanung-733224062432@brauner/)
Hence getxattrat() and listxattrat() are not employed.

While at it, remove the discrepancy between path being NULL
and empty - I don't grok the "security issue" claimed earlier,
but nowadays even the kernel treats the two as identical:
https://github.com/torvalds/linux/commit/e896474fe4851ffc4dd860c92daa906783090346

8 months agoxattr-util: modernize getcrtime_at() and friends
Mike Yuan [Sun, 26 Jan 2025 16:46:30 +0000 (17:46 +0100)] 
xattr-util: modernize getcrtime_at() and friends

- Drop fd_ prefix for openat()-like function
- Make fd_setcrtime() accept O_PATH fds too
- Use statx_timestamp_load()

8 months agomissing_syscall: add {set,remove}xattrat()
Mike Yuan [Mon, 20 Jan 2025 18:43:00 +0000 (19:43 +0100)] 
missing_syscall: add {set,remove}xattrat()

8 months agomissing_syscall: drop more defs below our kernel baseline
Mike Yuan [Thu, 30 Jan 2025 15:18:21 +0000 (16:18 +0100)] 
missing_syscall: drop more defs below our kernel baseline

8 months agomissing_ioprio: remove outdated comment now that linux/ioprio.h exists
Mike Yuan [Thu, 30 Jan 2025 16:51:51 +0000 (17:51 +0100)] 
missing_ioprio: remove outdated comment now that linux/ioprio.h exists

8 months agomeson: glibc now provides wrapper for sched_setattr()
Mike Yuan [Sun, 9 Feb 2025 13:49:15 +0000 (14:49 +0100)] 
meson: glibc now provides wrapper for sched_setattr()

C.f. https://github.com/bminor/glibc/commit/21571ca0d70302909cf72707b2a7736cf12190a0