summaryrefslogtreecommitdiffstats
path: root/src/basic/missing_wait.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-03-06resolved: decrease mdns/llmnr priority for the reverse mapping domainsRonan Pigott2-2/+4
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.
2024-03-06meson: add missing dependency to libdlYu Watanabe1-0/+1
Follow-up for 1c20c9f4fce3b2eb501a776fb6025d6b5567fc00. Fixes https://github.com/systemd/systemd/pull/31550#issuecomment-1980458377.
2024-03-06ci: explicitly change oom-{score}-adj before running testsFrantisek Sumsal1-0/+6
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.
2024-03-06ci: make the build dir accessible when running w/o privilegesFrantisek Sumsal1-0/+5
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.
2024-03-06boot: replace manual string manipulation with xasprintfTobiPeterG1-11/+13
2024-03-06Improve the formatting by adding AlignArrayOfStructures and setting it to ↵Unique-Usman1-0/+1
Right(right justify)
2024-03-06meson: Remove version_h dependency from jinja2_cmdlineDaan De Meyer2-6/+5
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.
2024-03-06Use VERSION_TAG instead of GIT_VERSION in kernel-install scriptsDaan De Meyer2-2/+2
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.
2024-03-06string-util: allow taking SIZE_MAX as size to shorten toLennart Poettering2-0/+8
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
2024-03-06udev: use strndupa_safe() rather than strndupa()Lennart Poettering1-6/+6
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
2024-03-06PORTABLE_SERVICES.md: Improve grammarChristian Wesselhoeft1-2/+2
2024-03-06meson/man: allow man pages to use multiple conditionsZbigniew Jędrzejewski-Szmek9-15/+25
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.
2024-03-06ukify: convert certificate to public key before embedding in .pcrpkeyLuca Boccassi1-0/+14
Follow-up for 419b25ddcac39cf967555c7a2eaa274fbf1ad03c
2024-03-06test: use 'ahost' instead of 'hosts' where applicableFrantisek Sumsal1-15/+16
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
2024-03-06po: Translated using Weblate (Georgian)Temuri Doghonadze1-26/+19
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
2024-03-06po: Translated using Weblate (Ukrainian)Yuri Chornoivan1-34/+18
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
2024-03-06po: Translated using Weblate (Swedish)Göran Uddeborg1-27/+19
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
2024-03-05hwdb: Add touchpad toggle mapping for Kvadra LE14U/LE15UVasiliy Kovalev1-0/+8
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
2024-03-05basic: remove spuriously doubled newline and leftover separatorMike Yuan2-3/+0
Follow-up for 3fc72d54132151c131301fc7954e0b44cdd3c860
2024-03-05test: bump the timeout for test-execute subtests if running w/ QEMUFrantisek Sumsal1-0/+5
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.
2024-03-05mkosi: Use specifier to refer to the output directoryDaan De Meyer3-5/+5
Otherwise the output directory cannot be configured by users.
2024-03-05mkosi: Allow users to configure the build and cache directoryDaan De Meyer1-2/+2
2024-03-05mkosi: Set minimum versionDaan De Meyer1-0/+1
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.
2024-03-05resolved: remove entry from cache when goodbye packet receivedVishal Chillara Srinivas5-0/+66
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.
2024-03-05NEWS: Add note about freezing user session changesAdrian Vovk1-0/+9
These changes have the potential to break suspend on systems with proprietary NVIDIA drivers, so we should make a big NEWS entry about it
2024-03-05homework: Lock/Unlock: Freeze/Thaw user sessionAdrian Vovk2-0/+56
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.
2024-03-05sleep: Always freeze user.sliceAdrian Vovk3-28/+35
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
2024-03-05bus-unit-util: Add utility to freeze/thaw unitsAdrian Vovk2-0/+104
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 ```
2024-03-05resolved: properly decode NAPTR RRsLennart Poettering5-1/+333
Fixes: #18126
2024-03-05escape: teach octescape() to work with NUL terminated stringsLennart Poettering1-0/+6
2024-03-05resolved: make resolved authoritative in resolveing our local host nameLennart Poettering5-3/+30
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
2024-03-05resolved: make outselves authoritative for /etc/hosts entries in fullLennart Poettering1-1/+1
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
2024-03-05resolved: rename variable found_{a|aaaa} → question_for_{a|aaaa}Lennart Poettering1-8/+9
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.
2024-03-05resolved: do DNS RR type based routingLennart Poettering2-1/+71
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.
2024-03-05ci: disable test that is now answered by knotLennart Poettering1-3/+3
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.
2024-03-05resolved: enable DNS proxy mode if client wants DNSSECLennart Poettering1-2/+2
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
2024-03-05resolved: use relaxed single label rules when proxying DNS queriesLennart Poettering1-1/+2
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.
2024-03-05resolvectl: expose new SD_RESOLVED_RELAX_SINGLE_LABEL flag in resolvectlLennart Poettering2-1/+26
2024-03-05resolved: add new SD_RESOLVED_RELAX_SINGLE_LABEL resolver flagLennart Poettering7-28/+37
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.
2024-03-05extract-word: update remaining calls to `extract_many_words`Antonio Alvarez Feijoo3-9/+5
Follow-up to 4f49512695f8214c55c206b3c2f583dc7b309e1b
2024-03-05sd-netlink: allow to call rtnl_get_link_info() without iftype and flagsYu Watanabe1-1/+1
2024-03-05mkosi: make shellcheck happyFrantisek Sumsal1-1/+1
2024-03-05Update TODO fileMatteo Croce1-2/+2
Update the line about dynamically load compression libraries.
2024-03-05dynamically load compression librariesMatteo Croce17-213/+414
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.
2024-03-05move dlfcn-util into basicMatteo Croce4-1/+1
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.
2024-03-05Revert "mkosi: Don't fail on systemd-vconsole-setup.service failure for now"Frantisek Sumsal1-3/+0
This doesn't seem to fail anymore. This reverts commit 84c7929cd461f6f1cc2c44c69877b9fd0676c794.
2024-03-05Revert "mkosi: Disable cmdline addon test for now"Frantisek Sumsal1-3/+6
Let's see if this finally works. This reverts commit e167a8283d5964ca0f903b3e362ab7e48a1ed2ab.
2024-03-05mkosi: fix UKI addons testFrantisek Sumsal6-13/+14
The test hasn't been working for a while, since there's no /efi or /boot in $DESTDIR. Resolves: #31618
2024-03-05test: check for kernel.apparmor_restrict_unprivileged_usernsNick Rosbrook1-0/+21
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.
2024-03-05Fixing bad link to Debian packages testsMax Gautier1-1/+1