]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 months agoMerge pull request #31590 from YHNdnzj/install-cleanup
Luca Boccassi [Thu, 7 Mar 2024 11:28:04 +0000 (11:28 +0000)] 
Merge pull request #31590 from YHNdnzj/install-cleanup

shared/install: several cleanups

3 months agoMerge pull request #31628 from YHNdnzj/tmpfiles-acl
Luca Boccassi [Thu, 7 Mar 2024 11:27:15 +0000 (11:27 +0000)] 
Merge pull request #31628 from YHNdnzj/tmpfiles-acl

tmpfiles: fix for 'X' bit handling and use it where appropriate

3 months agoloongarch64: disable simd when build efi
Xiaotian Wu [Wed, 27 Dec 2023 08:25:22 +0000 (16:25 +0800)] 
loongarch64: disable simd when build efi

LoongArch does not yet support the `-mgeneral-regs-only` option, so when
compiling for EFI, we need to use the `-mno-lsx` and `-mno-lasx` options
to disable SIMD instructions.

3 months agoMerge pull request #31345 from DaanDeMeyer/mkosi-packages
Daan De Meyer [Thu, 7 Mar 2024 10:12:14 +0000 (11:12 +0100)] 
Merge pull request #31345 from DaanDeMeyer/mkosi-packages

Build distribution packages in mkosi

3 months agoBuild distribution packages in mkosi 31345/head
Daan De Meyer [Thu, 25 Jan 2024 21:48:55 +0000 (22:48 +0100)] 
Build distribution packages in mkosi

Instead of running meson install and hoping for the best, let's build
distribution packages from the downstream packaging specs. This gets
us the following:

- Vastly simplified mkosi scripts since we don't need a separate initrd
  image anymore but can just reuse the default mkosi initrd.
- Almost everything can move to the base image as its not the basis
  anymore for the initrd and as such we don't need to care about the
  size anymore.
- The systemd packages that get pulled in as dependencies of other
  packages get properly uninstalled and replaced with our packages that
  we built instead of just installing on top of an existing systemd
  installation with no guarantee that everything from that previous
  installation was removed.
- Much better testing coverage as what we're testing is much closer
  to what will actually be deployed in distributions.
- Immediate feedback if something we change breaks distribution packaging
- We get integration with the distribution for free as we'll automatically
  use the proper directories and such instead of having to hack this
  into a mkosi build script.
- ...

3 months agomkosi: Update to v21
Daan De Meyer [Sun, 18 Feb 2024 17:51:58 +0000 (18:51 +0100)] 
mkosi: Update to v21

3 months agoMerge pull request #31664 from bluca/coverity
Mike Yuan [Thu, 7 Mar 2024 08:02:57 +0000 (16:02 +0800)] 
Merge pull request #31664 from bluca/coverity

Coverity fixes

3 months agoUpdate catalog.c - Removing sanity check as there is no need of checking non null...
SidhuRupinder [Thu, 7 Mar 2024 01:31:59 +0000 (07:01 +0530)] 
Update catalog.c - Removing sanity check as there is no need of checking non null pointer (#31653)

There is no need to check the pointer as the pointer will never be NULL.

Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
3 months agoMerge pull request #31616 from poettering/resolved-varlink-resolve-record
Luca Boccassi [Thu, 7 Mar 2024 01:00:27 +0000 (01:00 +0000)] 
Merge pull request #31616 from poettering/resolved-varlink-resolve-record

resolved: add varlink API for resolving raw RRs

3 months agoresolve: disambiguate return statement 31664/head
Luca Boccassi [Thu, 7 Mar 2024 00:51:43 +0000 (00:51 +0000)] 
resolve: disambiguate return statement

This works as expected, but coverity warns that it could be ambiguous and context
suggests the other way around. Add brackets to disambiguate.

CID#1535101

Follow-up for 6399be223b73ce520654242ad08de387b08b738a

3 months agoescape: fix operator precedence in overflow check
Luca Boccassi [Thu, 7 Mar 2024 00:46:19 +0000 (00:46 +0000)] 
escape: fix operator precedence in overflow check

CID#1535100

Follow-up for c6342e35b07f750771f0fdb3c80a27d3272e8001

3 months agoman: fix systemd-timedated man page wrt ntp-units.d
Michael Biebl [Wed, 6 Mar 2024 18:19:41 +0000 (19:19 +0100)] 
man: fix systemd-timedated man page wrt ntp-units.d

The service parsing/using this directory is systemd-timedated, not
systemd-timesyncd.

3 months agotmpfiles.d/systemd: use ACL 'X' bit where appropriate 31628/head
Mike Yuan [Tue, 5 Mar 2024 09:16:49 +0000 (17:16 +0800)] 
tmpfiles.d/systemd: use ACL 'X' bit where appropriate

3 months agotmpfiles: do 'X' bit check in an ACL-aware manner
Mike Yuan [Tue, 5 Mar 2024 14:25:44 +0000 (22:25 +0800)] 
tmpfiles: do 'X' bit check in an ACL-aware manner

Follow-up for 26d98cdd78cb5283f5771bd5866997acc494b067

I.e. stat() cannot be used here.

Also, before this commit, the 'X' is only applied if
the owner has execute bit set. Now it takes group and
other into consideration too. setfacl(1) also has
the same behavior.

3 months agotmpfiles: remove one more use of goto and modernization
Mike Yuan [Tue, 5 Mar 2024 14:41:54 +0000 (22:41 +0800)] 
tmpfiles: remove one more use of goto and modernization

3 months agocore,install: generalize install error handling 31590/head
Mike Yuan [Thu, 29 Feb 2024 12:58:17 +0000 (20:58 +0800)] 
core,install: generalize install error handling

3 months agoshared/install: use FOREACH_ARRAY at one more place
Mike Yuan [Thu, 29 Feb 2024 13:04:02 +0000 (21:04 +0800)] 
shared/install: use FOREACH_ARRAY at one more place

3 months agoshared/install: use RET_GATHER more
Mike Yuan [Thu, 29 Feb 2024 10:53:26 +0000 (18:53 +0800)] 
shared/install: use RET_GATHER more

3 months agopath-lookup: rename lookup_paths_free -> _done
Mike Yuan [Sat, 2 Mar 2024 08:38:17 +0000 (16:38 +0800)] 
path-lookup: rename lookup_paths_free -> _done

This is stack-allocated, so update to match our usual rules.

3 months agoresolved: expose raw RR resolver via Varlink too 31616/head
Lennart Poettering [Mon, 4 Mar 2024 10:22:41 +0000 (11:22 +0100)] 
resolved: expose raw RR resolver via Varlink too

Now that we have an address, hostname, and service resolve, at the last
kind of resovler we expose over D-Bus also to Varlink.

3 months agoresolved: move ResourceKey/ResourceRecord varlink types to generic Resolve interface
Lennart Poettering [Mon, 4 Mar 2024 09:18:36 +0000 (10:18 +0100)] 
resolved: move ResourceKey/ResourceRecord varlink types to generic Resolve interface

Let's define this in the generic interface and then import it into the
Monitor interface too.

This is preparation for adding an interface to resolve arbitrary RRs via
Varlink, which means we want the type in both interfaces.

3 months agoresolved: decrease mdns/llmnr priority for the reverse mapping domains
Ronan Pigott [Wed, 6 Mar 2024 01:05:57 +0000 (18:05 -0700)] 
resolved: decrease mdns/llmnr priority for the reverse mapping domains

Previously all queries to the reverse mapping domains (in-addr.arpa and
ip6.arpa) were considered to be in-scope for mdns and llmnr at the same
priority as DNS. This caused sd-resolved to ignore NXDOMAIN responses
from dns in favor of lengthy timeouts.

This narrows the scope of mdns and llmnr so they are not invariably
considered as fallbacks for these domains. Now, mdns/llmnr on a link
will only be used as a fallback when there is no suitable DNS scope, and
when that link is DefaultRoute.

3 months agoMerge pull request #30612 from AdrianVovk/sleep-freeze-user-seesions
Lennart Poettering [Wed, 6 Mar 2024 17:52:57 +0000 (18:52 +0100)] 
Merge pull request #30612 from AdrianVovk/sleep-freeze-user-seesions

Freeze user sessions for all types of sleep

3 months agoMerge pull request #31592 from YHNdnzj/exit-cgroup-notify
Lennart Poettering [Wed, 6 Mar 2024 17:38:51 +0000 (18:38 +0100)] 
Merge pull request #31592 from YHNdnzj/exit-cgroup-notify

core/service: two fixes for ExitType=cgroup

3 months agomeson: add missing dependency to libdl
Yu Watanabe [Wed, 6 Mar 2024 09:44:43 +0000 (18:44 +0900)] 
meson: add missing dependency to libdl

Follow-up for 1c20c9f4fce3b2eb501a776fb6025d6b5567fc00.

Fixes https://github.com/systemd/systemd/pull/31550#issuecomment-1980458377.

3 months agoMerge pull request #31657 from mrc0mmand/test-execute-shenanigans
Luca Boccassi [Wed, 6 Mar 2024 17:22:39 +0000 (17:22 +0000)] 
Merge pull request #31657 from mrc0mmand/test-execute-shenanigans

A couple of tweaks for test-execute

3 months agoMerge pull request #31656 from DaanDeMeyer/meson
Daan De Meyer [Wed, 6 Mar 2024 15:20:13 +0000 (16:20 +0100)] 
Merge pull request #31656 from DaanDeMeyer/meson

meson: Remove version_h dependency from jinja2_cmdline

3 months agoci: explicitly change oom-{score}-adj before running tests 31657/head
Frantisek Sumsal [Wed, 6 Mar 2024 14:21:10 +0000 (15:21 +0100)] 
ci: explicitly change oom-{score}-adj before running tests

For some reason root in GH actions is able to _decrease_ its oom score
even after dropping all capabilities (including CAP_SYS_RESOURCE), until
the oom score is changed explicitly after sudo:

$ systemd-detect-virt
microsoft
$ sudo su -
~# capsh --drop=all -- -c 'capsh --print; grep -H . /proc/self/oom*; choom -p $$ -n -101'
Current: =
Bounding set =
Ambient set =
Current IAB: !cap_chown,!cap_dac_override,!cap_dac_read_search,...,!cap_sys_resource,...,!cap_checkpoint_restore
Securebits: 00/0x0/1'b0
 secure-noroot: no (unlocked)
 secure-no-suid-fixup: no (unlocked)
 secure-keep-caps: no (unlocked)
 secure-no-ambient-raise: no (unlocked)
uid=0(root) euid=0(root)
gid=0(root)
groups=0(root)
Guessed mode: UNCERTAIN (0)
/proc/self/oom_adj:8
/proc/self/oom_score:1000
/proc/self/oom_score_adj:500
pid 22180's OOM score adjust value changed from 500 to -101
~# choom -p $$ -n 500
pid 22027's OOM score adjust value changed from 500 to 500
~# capsh --drop=all -- -c 'capsh --print; grep -H . /proc/self/oom*; choom -p $$ -n -101'
Current: =
Bounding set =
Ambient set =
...
uid=0(root) euid=0(root)
gid=0(root)
groups=0(root)
Guessed mode: UNCERTAIN (0)
/proc/self/oom_adj:8
/proc/self/oom_score:1000
/proc/self/oom_score_adj:500
choom: failed to set score adjust value: Permission denied

I have no idea what's going on, but it breaks
exec-oomscoreadjust-negative.service from test-execute when running
unprivileged.

3 months agoci: make the build dir accessible when running w/o privileges
Frantisek Sumsal [Wed, 6 Mar 2024 14:04:22 +0000 (15:04 +0100)] 
ci: make the build dir accessible when running w/o privileges

Otherwise the unprivileged part of test-execute gets silently skipped:

/* test_run_tests_unprivileged */
Successfully forked off '(test-execute-unprivileged)' as PID 20998.
...
pin_callout_binary: build dir binary: /home/runner/work/systemd/systemd/build/systemd-executor
pin_callout_binary: open(/home/runner/work/systemd/systemd/build/systemd-executor)=-13
Failed to pin executor binary: No such file or directory
(test-execute-unprivileged): manager_new, skipping tests: No such file or directory
(test-execute-unprivileged) succeeded.

3 months agoboot: replace manual string manipulation with xasprintf
TobiPeterG [Wed, 28 Feb 2024 14:53:34 +0000 (15:53 +0100)] 
boot: replace manual string manipulation with xasprintf

3 months agoImprove the formatting by adding AlignArrayOfStructures and setting it to Right(right...
Unique-Usman [Wed, 6 Mar 2024 13:30:36 +0000 (19:00 +0530)] 
Improve the formatting by adding AlignArrayOfStructures and setting it to Right(right justify)

3 months agomeson: Remove version_h dependency from jinja2_cmdline 31656/head
Daan De Meyer [Wed, 6 Mar 2024 14:16:52 +0000 (15:16 +0100)] 
meson: Remove version_h dependency from jinja2_cmdline

version_h includes GIT_VERSION which only makes sense for C files
which aren't preprocessed by jinja2 so remove the argument.

The end result of this change is that the man pages are not recompiled
anymore every time GIT_VERSION changes.

3 months agoUse VERSION_TAG instead of GIT_VERSION in kernel-install scripts
Daan De Meyer [Wed, 6 Mar 2024 14:15:55 +0000 (15:15 +0100)] 
Use VERSION_TAG instead of GIT_VERSION in kernel-install scripts

GIT_VERSION only makes sense for C files as it depends on C preprocessor
macro expansion now so let's use VERSION_TAG instead of GIT_VERSION
for the two remaining usages of GIT_VERSION that are not in C files.

3 months agoMerge pull request #31580 from poettering/resolved-naptr
Luca Boccassi [Wed, 6 Mar 2024 14:14:11 +0000 (14:14 +0000)] 
Merge pull request #31580 from poettering/resolved-naptr

resolved: properly decode NAPTR RRs

3 months agoMerge pull request #31621 from poettering/resolved-proxy-do
Luca Boccassi [Wed, 6 Mar 2024 13:55:14 +0000 (13:55 +0000)] 
Merge pull request #31621 from poettering/resolved-proxy-do

resolved: proxy upstream local requests to our stub with DO bit set

3 months agostring-util: allow taking SIZE_MAX as size to shorten to
Lennart Poettering [Wed, 6 Mar 2024 08:43:09 +0000 (09:43 +0100)] 
string-util: allow taking SIZE_MAX as size to shorten to

This is useful for two reasons:

1. it addresses a potential overflow in a graceful way

2. Gives callers the ability to just pass SIZE_MAX for a NOP

Prompted by: #31341

3 months agoudev: use strndupa_safe() rather than strndupa()
Lennart Poettering [Wed, 6 Mar 2024 08:45:55 +0000 (09:45 +0100)] 
udev: use strndupa_safe() rather than strndupa()

As per coding style, we don't use strndupa(), but strndupa_safe() only.

As a side-effect, this means musl folks can just drop this mess:

https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch

3 months agoPORTABLE_SERVICES.md: Improve grammar
Christian Wesselhoeft [Tue, 5 Mar 2024 22:26:01 +0000 (15:26 -0700)] 
PORTABLE_SERVICES.md: Improve grammar

3 months agomeson/man: allow man pages to use multiple conditions
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2024 13:41:17 +0000 (17:41 +0400)] 
meson/man: allow man pages to use multiple conditions

This way the man pages are installed only when the corresponding binary is
installed. The conditions in man pages and man/rules/meson.build are adjusted to
match the conditions for units in units/meson.build.

3 months agoukify: convert certificate to public key before embedding in .pcrpkey
Luca Boccassi [Mon, 4 Mar 2024 23:12:26 +0000 (23:12 +0000)] 
ukify: convert certificate to public key before embedding in .pcrpkey

Follow-up for 419b25ddcac39cf967555c7a2eaa274fbf1ad03c

3 months agoMerge pull request #31642 from weblate/weblate-systemd-main
Frantisek Sumsal [Wed, 6 Mar 2024 09:40:41 +0000 (10:40 +0100)] 
Merge pull request #31642 from weblate/weblate-systemd-main

Translations update from Fedora Weblate

3 months agotest: use 'ahost' instead of 'hosts' where applicable
Frantisek Sumsal [Tue, 5 Mar 2024 17:19:17 +0000 (18:19 +0100)] 
test: use 'ahost' instead of 'hosts' where applicable

As explained in [0] the 'hosts' database uses deprecated
gethostbyname2() which uses AF_INET6 instead of AF_UNSPEC for IPv6
lookups which is broken and makes the test fail with disabled IPv6.

[0] https://github.com/systemd/systemd/pull/28136#issuecomment-1974901039

3 months agopo: Translated using Weblate (Georgian) 31642/head
Temuri Doghonadze [Tue, 5 Mar 2024 21:36:03 +0000 (22:36 +0100)] 
po: Translated using Weblate (Georgian)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ka/
Translation: systemd/main

3 months agopo: Translated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 5 Mar 2024 21:36:02 +0000 (22:36 +0100)] 
po: Translated using Weblate (Ukrainian)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/uk/
Translation: systemd/main

3 months agopo: Translated using Weblate (Swedish)
Göran Uddeborg [Tue, 5 Mar 2024 21:36:02 +0000 (22:36 +0100)] 
po: Translated using Weblate (Swedish)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sv/
Translation: systemd/main

3 months agohwdb: Add touchpad toggle mapping for Kvadra LE14U/LE15U
Vasiliy Kovalev [Tue, 5 Mar 2024 07:01:04 +0000 (10:01 +0300)] 
hwdb: Add touchpad toggle mapping for Kvadra LE14U/LE15U

Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
3 months agobasic: remove spuriously doubled newline and leftover separator
Mike Yuan [Tue, 5 Mar 2024 19:29:12 +0000 (03:29 +0800)] 
basic: remove spuriously doubled newline and leftover separator

Follow-up for 3fc72d54132151c131301fc7954e0b44cdd3c860

3 months agoMerge pull request #31550 from teknoraver/dlopen_compress
Daan De Meyer [Tue, 5 Mar 2024 19:16:19 +0000 (20:16 +0100)] 
Merge pull request #31550 from teknoraver/dlopen_compress

Dynamically load compression libraries

3 months agoMerge pull request #31640 from DaanDeMeyer/mkosi
Daan De Meyer [Tue, 5 Mar 2024 19:13:00 +0000 (20:13 +0100)] 
Merge pull request #31640 from DaanDeMeyer/mkosi

Mkosi fixes

3 months agotest: bump the timeout for test-execute subtests if running w/ QEMU
Frantisek Sumsal [Tue, 5 Mar 2024 12:24:18 +0000 (13:24 +0100)] 
test: bump the timeout for test-execute subtests if running w/ QEMU

Bump the timeout for test-execute subtests if running with plain QEMU
(as part of TEST-02-UNITTESTS), since we might start hitting the default
2m timeout with some more involved subtests, especially when the AWS
region we're running in is under heavy load. I see this regularly in the
CentOS Stream 9 nightly cron job with exec-dynamicuser-statedir.service
which has a lot of ExecStart's.

3 months agomkosi: Use specifier to refer to the output directory 31640/head
Daan De Meyer [Tue, 5 Mar 2024 18:42:18 +0000 (19:42 +0100)] 
mkosi: Use specifier to refer to the output directory

Otherwise the output directory cannot be configured by users.

3 months agomkosi: Allow users to configure the build and cache directory
Daan De Meyer [Tue, 5 Mar 2024 18:41:50 +0000 (19:41 +0100)] 
mkosi: Allow users to configure the build and cache directory

3 months agomkosi: Set minimum version
Daan De Meyer [Tue, 5 Mar 2024 18:41:06 +0000 (19:41 +0100)] 
mkosi: Set minimum version

This will only be taken into account by newer mkosi versions but it'll
at least save some pain from running on a too old version.

3 months agoresolved: remove entry from cache when goodbye packet received
Vishal Chillara Srinivas [Mon, 20 Nov 2023 06:33:28 +0000 (12:03 +0530)] 
resolved: remove entry from cache when goodbye packet received

RFC6762 10.1 says that queriers receiving a Multicast DNS response with a TTL
of zero SHOULD record a TTL of 1 and then delete the record one second later.

Added a timer event to trigger a callback to clean-up the cache one second after
a goodbye packet is received. The callback also checks for any cache entries
expiring within the next one second and schedules follow-up cleanup callbacks
accordingly.

3 months agoNEWS: Add note about freezing user session changes 30612/head
Adrian Vovk [Thu, 4 Jan 2024 19:08:35 +0000 (14:08 -0500)] 
NEWS: Add note about freezing user session changes

These changes have the potential to break suspend on systems with
proprietary NVIDIA drivers, so we should make a big NEWS entry about it

3 months agohomework: Lock/Unlock: Freeze/Thaw user session
Adrian Vovk [Sat, 23 Dec 2023 23:00:48 +0000 (18:00 -0500)] 
homework: Lock/Unlock: Freeze/Thaw user session

Whenever a home directory is in a locked state, accessing the files of
the home directory is extremely likely to cause the thread to hang. This
will put the session in a strange state, where some threads are hanging
due to file access and others are not hanging because they are not
trying to access any of the user's files.

This can lead to a whole slew of consequences. For example, imagine a
likely situation where the Wayland compositor is not hanging, but the
user's open apps are. Eventually, the compositor will detect that none
of the apps are responding to its pings, assume that they're frozen
(which they are), and kill them. The systemd user instance can end up in
a similarly confused state and start killing user services. In the worst
case, killing an app at an unexpected moment can lead to data loss.

The solution is to suspend execution of the whole user session by
freezing the user's slice.

3 months agosleep: Always freeze user.slice
Adrian Vovk [Sat, 23 Dec 2023 22:03:42 +0000 (17:03 -0500)] 
sleep: Always freeze user.slice

Previously, we'd only freeze user.slice in the case of s2h, because we
didn't want the user session to resume while systemd was transitioning
from suspend to hibernate.

This commit extends this freezing behavior to all sleep modes.

We also have an environment variable to disable the freezing behavior
outright. This is a necessary workaround for someone that has hooks
in /usr/lib/systemd/system-sleep/ which communicate with some
process running under user.slice, or if someone is using the proprietary
NVIDIA driver which breaks when user.slice is frozen (issue #27559)

Fixes #27559

3 months agobus-unit-util: Add utility to freeze/thaw units
Adrian Vovk [Sat, 23 Dec 2023 21:57:47 +0000 (16:57 -0500)] 
bus-unit-util: Add utility to freeze/thaw units

This utility lets us freeze units, and then automatically thaw them
when via a _cleanup_ handler. For example, you can now write something
like:

```
_cleanup_(unit_freezer_thaw) UnitFreezer freezer = UNIT_FREEZER_NULL;
r = unit_freezer_freeze("myunit.service", &freezer);
if (r < 0)
    return r;
// Freeze is thawed once this scope ends
```

Aside from the basic _freeze and _thaw methods, there's also
_cancel and _restore. Cancel destroys the UnitFreezer without
thawing the unit. Restore creates a UnitFreezer without freezing it.
The idea of these two methods is that it allows the freeze/thaw to
be separated from each other (i.e. done in response to two separate
DBus method calls). For example:

```
_cleanup_(unit_freezer_thaw) UnitFreezer freezer = UNIT_FREEZER_NULL;
r = unit_freezer_freeze("myunit.service", &freezer);
if (r < 0)
    return r;
// Freeze is thawed once this scope ends

r = do_something()
if (r < 0)
    return r; // Freeze is thawed

unit_freezer_cancel(&freezer); // Thaw is canceled.
```

Then in another scope:
```
// Bring back a UnitFreezer object for the already-frozen service
_cleanup_(unit_freezer_thaw) UnitFreezer freezer = UNIT_FREEZER_NULL;
r = unit_freezer_restore("myunit.service", &freezer);
if (r < 0)
    return r;
// Freeze is thawed once this scope ends
```

3 months agoresolved: properly decode NAPTR RRs 31580/head
Lennart Poettering [Fri, 1 Mar 2024 22:36:51 +0000 (23:36 +0100)] 
resolved: properly decode NAPTR RRs

Fixes: #18126
3 months agoescape: teach octescape() to work with NUL terminated strings
Lennart Poettering [Fri, 1 Mar 2024 22:36:15 +0000 (23:36 +0100)] 
escape: teach octescape() to work with NUL terminated strings

3 months agoresolved: make resolved authoritative in resolveing our local host name 31621/head
Lennart Poettering [Tue, 5 Mar 2024 12:48:59 +0000 (13:48 +0100)] 
resolved: make resolved authoritative in resolveing our local host name

This is a kinda a follow-up for ce266330fc3bd6767451ac3400336cd9acebe9c1: it
makes resolved authoritative on our local hostname, and never contacts
DNS anymore for it.

We effectively already were authoritative for it, except if the user
queried for other RR types than just A/AAAA. This closes the gap and
refuses routing other RR type queries to DNS.

Fixes: #23662
3 months agoresolved: make outselves authoritative for /etc/hosts entries in full
Lennart Poettering [Tue, 5 Mar 2024 09:35:40 +0000 (10:35 +0100)] 
resolved: make outselves authoritative for /etc/hosts entries in full

If you query for an MX RR of a host listed in /etc/hosts, let's return
an empty reply rather than NXDOMAIN, i.e. indicate that the name exists
but has no MX RR assigned, thus making ourselves authoritative.

The venerable "host" tool by default sends requests for A + AAAA + MX
and ensures we never propagate queries further on.

Fixes: #31223
3 months agoresolved: rename variable found_{a|aaaa} → question_for_{a|aaaa}
Lennart Poettering [Tue, 5 Mar 2024 09:34:47 +0000 (10:34 +0100)] 
resolved: rename variable found_{a|aaaa} → question_for_{a|aaaa}

Te variables indicate what kind of RRs we are looking for, but the name
so far suggests it was about what we already found. Let's rename the
variables to make the purpose clearer.

3 months agoresolved: do DNS RR type based routing
Lennart Poettering [Tue, 5 Mar 2024 08:48:35 +0000 (09:48 +0100)] 
resolved: do DNS RR type based routing

So far we only looked at the domain name when routing requests to
specific scopes. With this we'll also take the DNS RR type into account.
This takes benefit of the fact that lookups for RRs such as SOA or NS or
the various DNSSEC RR types never really make sense to be routed to
LLMNR or mDNS, since they don't have concepts there.

This hence refuses to route requests for those RR types to the
LLMNR/mDNS scopes, which hence means they'll likely be routed to classic
DNS instead.

This should improve behaviour of tools that assumes it speaks to classic
DNS only via 127.0.0.53, since it will now usually do that.

3 months agoci: disable test that is now answered by knot
Lennart Poettering [Tue, 5 Mar 2024 14:26:37 +0000 (15:26 +0100)] 
ci: disable test that is now answered by knot

dig question with DNSSEC on will now be proxied upstream, i.e. to the
test knot server. This leads to different results, but the result isn't
tha tinteresting since we don't want to test knot, but resolved. Hence
comment this test.

There seems to be something wrong with the test though, as the upstream
server refused recursion, but if so it is not suitable as an upstream
server really, as resolved can only be client to a recursive resolver.

3 months agoresolved: enable DNS proxy mode if client wants DNSSEC
Lennart Poettering [Mon, 4 Mar 2024 17:49:49 +0000 (18:49 +0100)] 
resolved: enable DNS proxy mode if client wants DNSSEC

So far we disabled DNSSEC if local clients asked for it via DO flag if
DNSSEC=no is set. Let's instead switch to proxy mode in this case, and
thus treat client requested DO mode as a way to force proxy mode.

This means DNSSEC=no just controls whether resolved will do validation
for regular looups, but it has no effect anymore on lookups from clients
that indicated they want to do their own DNSSEC anyway.

Fixes: #19227 #23737 #25105
3 months agoresolved: use relaxed single label rules when proxying DNS queries
Lennart Poettering [Mon, 4 Mar 2024 17:48:16 +0000 (18:48 +0100)] 
resolved: use relaxed single label rules when proxying DNS queries

When we use proxy mode when propagating DNS queries to upstream DNS
servers, let's use the relaxed single label rules. This has the benefit
that tools such "delv" work on the proxy stub 127.0.0.54.

3 months agoresolvectl: expose new SD_RESOLVED_RELAX_SINGLE_LABEL flag in resolvectl
Lennart Poettering [Mon, 4 Mar 2024 17:47:45 +0000 (18:47 +0100)] 
resolvectl: expose new SD_RESOLVED_RELAX_SINGLE_LABEL flag in resolvectl

3 months agoresolved: add new SD_RESOLVED_RELAX_SINGLE_LABEL resolver flag
Lennart Poettering [Mon, 4 Mar 2024 17:46:52 +0000 (18:46 +0100)] 
resolved: add new SD_RESOLVED_RELAX_SINGLE_LABEL resolver flag

This new flag allows resolving single label names via public DNS. By
default this is turned off, and this option allows excepting a lookup
for this.

3 months agoMerge pull request #31631 from mrc0mmand/mkosi-addons
Luca Boccassi [Tue, 5 Mar 2024 14:16:49 +0000 (14:16 +0000)] 
Merge pull request #31631 from mrc0mmand/mkosi-addons

mkosi: fix UKI addons test

3 months agoextract-word: update remaining calls to `extract_many_words`
Antonio Alvarez Feijoo [Tue, 5 Mar 2024 07:50:07 +0000 (08:50 +0100)] 
extract-word: update remaining calls to `extract_many_words`

Follow-up to 4f49512695f8214c55c206b3c2f583dc7b309e1b

3 months agosd-netlink: allow to call rtnl_get_link_info() without iftype and flags
Yu Watanabe [Tue, 5 Mar 2024 07:22:09 +0000 (16:22 +0900)] 
sd-netlink: allow to call rtnl_get_link_info() without iftype and flags

3 months agomkosi: make shellcheck happy 31631/head
Frantisek Sumsal [Tue, 5 Mar 2024 11:41:30 +0000 (12:41 +0100)] 
mkosi: make shellcheck happy

3 months agoUpdate TODO file 31550/head
Matteo Croce [Fri, 1 Mar 2024 17:25:07 +0000 (18:25 +0100)] 
Update TODO file

Update the line about dynamically load compression libraries.

3 months agodynamically load compression libraries
Matteo Croce [Tue, 27 Feb 2024 20:28:14 +0000 (21:28 +0100)] 
dynamically load compression libraries

Dynamically load liblz4, libzstd and liblzma with dlopen().
This helps to reduce the size of the initrd image when these libraries
are not really needed.

3 months agomove dlfcn-util into basic
Matteo Croce [Tue, 27 Feb 2024 06:36:46 +0000 (07:36 +0100)] 
move dlfcn-util into basic

I'm going to dlopen_many_sym_or_warn() in src/basic/compress.c, this
will introduce a circular dependency because libshared already depends
from libbasic.
To avoid this, move dlfcn-util.c from libshared to libbasic.

3 months agoRevert "mkosi: Don't fail on systemd-vconsole-setup.service failure for now"
Frantisek Sumsal [Tue, 5 Mar 2024 11:18:40 +0000 (12:18 +0100)] 
Revert "mkosi: Don't fail on systemd-vconsole-setup.service failure for now"

This doesn't seem to fail anymore.

This reverts commit 84c7929cd461f6f1cc2c44c69877b9fd0676c794.

3 months agoRevert "mkosi: Disable cmdline addon test for now"
Frantisek Sumsal [Tue, 5 Mar 2024 10:51:52 +0000 (11:51 +0100)] 
Revert "mkosi: Disable cmdline addon test for now"

Let's see if this finally works.

This reverts commit e167a8283d5964ca0f903b3e362ab7e48a1ed2ab.

3 months agomkosi: fix UKI addons test
Frantisek Sumsal [Tue, 5 Mar 2024 10:49:30 +0000 (11:49 +0100)] 
mkosi: fix UKI addons test

The test hasn't been working for a while, since there's no /efi or /boot
in $DESTDIR.

Resolves: #31618

3 months agotest: check for kernel.apparmor_restrict_unprivileged_userns
Nick Rosbrook [Mon, 4 Mar 2024 20:43:57 +0000 (15:43 -0500)] 
test: check for kernel.apparmor_restrict_unprivileged_userns

Some tests in test-execute are already skipped if we do not have
unprivileged user namespaces. Extend this check to look for an apparmor
specific sysctl indicating that unprivileged userns creation is
restricted.

3 months agoFixing bad link to Debian packages tests
Max Gautier [Tue, 5 Mar 2024 09:58:29 +0000 (10:58 +0100)] 
Fixing bad link to Debian packages tests

3 months agoMerge pull request #31597 from keszybz/option-P-for-machinectl-and-timedatectl
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2024 06:11:40 +0000 (10:11 +0400)] 
Merge pull request #31597 from keszybz/option-P-for-machinectl-and-timedatectl

Option -P for machinectl and timedatectl

3 months agofuzz: dump LLDP neighbors JSON too
Evgeny Vereshchagin [Sun, 3 Mar 2024 21:04:39 +0000 (21:04 +0000)] 
fuzz: dump LLDP neighbors JSON too

to make sure all the fields are in more or less good shape.

It's a follow-up to https://github.com/systemd/systemd/pull/31583

3 months agocore/service: don't transition to start-post on cgroup empty event 31592/head
Mike Yuan [Sat, 2 Mar 2024 13:22:51 +0000 (21:22 +0800)] 
core/service: don't transition to start-post on cgroup empty event
with ExitType=cgroup

It's not clear to me what the rationale of the logic was
when ExitType=cgroup got introduced. But similar to
the previous commit, I think we should not transition to
'start-post' on cgroup empty event. This is especially
important for Type=dbus/notify services.

3 months agocore/service: Type=notify/dbus services shouldn't be considered active
Mike Yuan [Sat, 2 Mar 2024 13:03:22 +0000 (21:03 +0800)] 
core/service: Type=notify/dbus services shouldn't be considered active
when ExitType=cgroup and main process exits

Follow-up for ef4300654e70e76ed74f7d544e0f44c5d92fb698

3 months agoMerge pull request #31582 from bluca/fix_hostnamed_ci
Luca Boccassi [Mon, 4 Mar 2024 20:37:52 +0000 (20:37 +0000)] 
Merge pull request #31582 from bluca/fix_hostnamed_ci

test: fix test-loopback and test-resolved-stream on Ubuntu 24.04

3 months agostat-util: generalize is_* and verify_* handling
Mike Yuan [Sat, 2 Mar 2024 09:41:29 +0000 (17:41 +0800)] 
stat-util: generalize is_* and verify_* handling

3 months agoresolved,pcrlock: make a bunch of varlink introspection structures static
Lennart Poettering [Mon, 4 Mar 2024 09:11:53 +0000 (10:11 +0100)] 
resolved,pcrlock: make a bunch of varlink introspection structures static

Not sure why gcc doesn't warn that these have no "extern" definition,
but also aren't static...

3 months agoresolved: mention the Varlink interface of resolved
Lennart Poettering [Mon, 4 Mar 2024 10:34:09 +0000 (11:34 +0100)] 
resolved: mention the Varlink interface of resolved

This is ready from prime-time, hence mention it.

3 months agoresolvectl: output nice error message if we can't JSONify RR
Lennart Poettering [Mon, 4 Mar 2024 09:00:05 +0000 (10:00 +0100)] 
resolvectl: output nice error message if we can't JSONify RR

Some RR types we don't have a mapping to JSON for. Handle this
reasonably.

3 months agovarlink: allow strings for integer varlink IDL fields
Lennart Poettering [Mon, 4 Mar 2024 10:23:38 +0000 (11:23 +0100)] 
varlink: allow strings for integer varlink IDL fields

This is a follow-up for 67a3028555c58cea152cd8b8e863a643eb147a97: also
allow strings as integer during IDL validation of JSON records.

3 months agoMerge pull request #31619 from weblate/weblate-systemd-main
Frantisek Sumsal [Mon, 4 Mar 2024 19:29:34 +0000 (20:29 +0100)] 
Merge pull request #31619 from weblate/weblate-systemd-main

Translations update from Fedora Weblate

3 months agoman/systemd-debug-generator: be consistent on '=' for boolean options
Mike Yuan [Mon, 4 Mar 2024 18:19:58 +0000 (02:19 +0800)] 
man/systemd-debug-generator: be consistent on '=' for boolean options

3 months agopo: Translated using Weblate (Turkish) 31619/head
Oğuz Ersen [Mon, 4 Mar 2024 16:32:52 +0000 (17:32 +0100)] 
po: Translated using Weblate (Turkish)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/tr/
Translation: systemd/main

3 months agopo: Translated using Weblate (Polish)
Piotr Drąg [Mon, 4 Mar 2024 16:32:52 +0000 (17:32 +0100)] 
po: Translated using Weblate (Polish)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Piotr Drąg <piotrdrag@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pl/
Translation: systemd/main

3 months agopo: Translated using Weblate (Korean)
김인수 [Mon, 4 Mar 2024 16:32:52 +0000 (17:32 +0100)] 
po: Translated using Weblate (Korean)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ko/
Translation: systemd/main

3 months agoupdate TODO
Lennart Poettering [Mon, 4 Mar 2024 16:30:15 +0000 (17:30 +0100)] 
update TODO

3 months agotest: fix test-resolved-stream unit test failure 31582/head
Luca Boccassi [Sun, 3 Mar 2024 18:14:31 +0000 (18:14 +0000)] 
test: fix test-resolved-stream unit test failure

On Noble setting this ioctl fails:

1570s  819/1330 systemd:resolve / test-resolved-stream  FAIL 0.14s   killed by signal 6 SIGABRT
1570s Successfully forked off '(usernstest)' as PID 27737.
1570s Skipping PR_SET_MM, as we don't have privileges.
1570s (usernstest) succeeded.
1570s Assertion 'ioctl(socket_fd, SIOCSIFFLAGS, &req) >= 0' failed at src/resolve/test-resolved-stream.c:372, function try_isolate_network(). Aborting.

Ignore the result.

3 months agotest: fix test-loopback failure when lacking privileges
Luca Boccassi [Sun, 3 Mar 2024 18:15:26 +0000 (18:15 +0000)] 
test: fix test-loopback failure when lacking privileges

Setting up the loopback might fail due to lack of privileges, as it
happens when running unit tests in the Noble CI environment. Skip
the test when it happens.

1584s  862/1330 systemd:test / test-loopback   FAIL  0.01s   exit status 1
1584s /* test_loopback_setup */
1584s Failed to configure loopback network device, ignoring: Operation not permitted
1584s loopback: Operation not permitted

3 months agoMerge pull request #31600 from YHNdnzj/fd-poll
Mike Yuan [Mon, 4 Mar 2024 14:28:00 +0000 (22:28 +0800)] 
Merge pull request #31600 from YHNdnzj/fd-poll

core/service: several trivial cleanups for fdstore