]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 months agobus-util: Fix bus_log_connect_error() 34851/head
Daan De Meyer [Tue, 22 Oct 2024 10:32:02 +0000 (12:32 +0200)] 
bus-util: Fix bus_log_connect_error()

12 months agobus-util: Special case when DBUS_SESSION_BUS_ADDRESS is set and XDG_RUNTIME_DIR isn't
Daan De Meyer [Tue, 22 Oct 2024 09:12:17 +0000 (11:12 +0200)] 
bus-util: Special case when DBUS_SESSION_BUS_ADDRESS is set and XDG_RUNTIME_DIR isn't

We noticed some failures because we have code that connects to user
managers by setting DBUS_SESSION_BUS_ADDRESS without setting XDG_RUNTIME_DIR.
If that's the case, connect to the user session bus instead of the
private manager bus as we can't connect to the latter if XDG_RUNTIME_DIR
is not set.

12 months agobus-util: Return ENOMEDIUM if XDG_RUNTIME_DIR is unset
Daan De Meyer [Tue, 22 Oct 2024 08:59:27 +0000 (10:59 +0200)] 
bus-util: Return ENOMEDIUM if XDG_RUNTIME_DIR is unset

bus_log_connect_error() checks for ENOMEDIUM, not ENXIO.

12 months agoMerge pull request #34628 from DaanDeMeyer/measure
Daan De Meyer [Mon, 21 Oct 2024 16:55:33 +0000 (18:55 +0200)] 
Merge pull request #34628 from DaanDeMeyer/measure

Rework TEST-86-MULTI-PROFILE-UKI + associated bugfixes

12 months agoRework TEST-86-MULTI-PROFILE-UKI 34628/head
Daan De Meyer [Fri, 4 Oct 2024 14:46:16 +0000 (16:46 +0200)] 
Rework TEST-86-MULTI-PROFILE-UKI

Now that mkosi supports generating UKI profiles, let's make use of
that to generate the UKI profiles required for the test instead of
doing it within the test itself.

12 months agoTEST-70-TPM2: Disable public key enrollment explicitly
Daan De Meyer [Mon, 21 Oct 2024 13:01:59 +0000 (15:01 +0200)] 
TEST-70-TPM2: Disable public key enrollment explicitly

Otherwise, when the test is executed on a system with signed PCRs,
cryptenroll will automatically pick up the public key from the UKI
which results in a volume that can't be unlocked because the pcrextend
tests appends extra things to pcr 11.

12 months agocryptenroll: Remove faulty assert()
Daan De Meyer [Sun, 20 Oct 2024 14:31:23 +0000 (16:31 +0200)] 
cryptenroll: Remove faulty assert()

We can break out of the preceeding for loop in certain scenarios
which would trigger the assert so let's drop it.

12 months agopcrlock: Take VirtualSize > SizeOfRawData into account
Daan De Meyer [Mon, 7 Oct 2024 15:39:27 +0000 (17:39 +0200)] 
pcrlock: Take VirtualSize > SizeOfRawData into account

If VirtualSize > SizeOfRawData, measure extra zeros to take into
account the extra zeros also measured by the stub.

12 months agomachine: rework Operation logic to reuse in varlink interface
Ivan Kruglov [Fri, 11 Oct 2024 14:26:38 +0000 (16:26 +0200)] 
machine: rework Operation logic to reuse in varlink interface

12 months agoMerge pull request #34403 from poettering/askpw-per-user
Lennart Poettering [Mon, 21 Oct 2024 14:37:28 +0000 (16:37 +0200)] 
Merge pull request #34403 from poettering/askpw-per-user

modernize the ask-password logic, and add unpriv askpw agents to the concept

12 months agoMerge pull request #34787 from yuwata/core-ip-address-allow-deny
Lennart Poettering [Mon, 21 Oct 2024 14:35:49 +0000 (16:35 +0200)] 
Merge pull request #34787 from yuwata/core-ip-address-allow-deny

core/cgroup: fix IPAddressAllow=/IPAddressDeny= set through DBus

12 months agomkosi: update opensuse commit reference
Luca Boccassi [Mon, 21 Oct 2024 13:26:05 +0000 (14:26 +0100)] 
mkosi: update opensuse commit reference

It was force-pushed again

12 months agovarlinkctl: respect $COLUMNS when rebreaking lines and we are not connected to a TTY
Lennart Poettering [Mon, 21 Oct 2024 09:10:35 +0000 (11:10 +0200)] 
varlinkctl: respect $COLUMNS when rebreaking lines and we are not connected to a TTY

Let's provide a mechanism to select the number of screen columns for
rebreaking comments in Varlink IDL connected to a TTY, by honouring the
$COLUMNS env var then too. Previously we'd only honour when connected to
a TTY, but it's also useful otherwise for rebreaking ridiculously long
comments, hence honour it in this case too.

12 months agotty-askpw-agent: modernize wall_tty_match() a bit 34403/head
Lennart Poettering [Mon, 21 Oct 2024 12:10:52 +0000 (14:10 +0200)] 
tty-askpw-agent: modernize wall_tty_match() a bit

12 months agoask-password-api: don't accidentally create a dir, when we don't want one
Lennart Poettering [Fri, 18 Oct 2024 19:36:34 +0000 (21:36 +0200)] 
ask-password-api: don't accidentally create a dir, when we don't want one

Previously, we were using touch(), which usually works fine, because the
path should always refer to an existing directory, in which case it just
updates the timestamp. However, if the dir does not exist yet (which
shouldn't happen), it would be created as regular file, which is just
wrong.

Hence, let's instead create the dir as dir if it is missing, and then
update its timestamp.

12 months agoman: update PASSWORD_AGENTS spec, and introduce unpriv pw queries
Lennart Poettering [Fri, 13 Sep 2024 12:55:49 +0000 (14:55 +0200)] 
man: update PASSWORD_AGENTS spec, and introduce unpriv pw queries

Fixes: #1232 #2217
12 months agoask-password-tool: add --user/--system flag to systemd-ask-password tool
Lennart Poettering [Fri, 13 Sep 2024 11:45:08 +0000 (13:45 +0200)] 
ask-password-tool: add --user/--system flag to systemd-ask-password tool

This allows selecting which agents to ask about this: system-level
agents, or per-user agents.

Fixes: #1232 #2217
12 months agoask-password-api: add support for querying pws from unpriv agents
Lennart Poettering [Fri, 13 Sep 2024 11:53:35 +0000 (13:53 +0200)] 
ask-password-api: add support for querying pws from unpriv agents

12 months agoask-password-api: minor modernizations
Lennart Poettering [Fri, 13 Sep 2024 11:49:25 +0000 (13:49 +0200)] 
ask-password-api: minor modernizations

12 months agotty-ask-password-agent: support for watching both system-wide and per-user askpw dir
Lennart Poettering [Fri, 13 Sep 2024 11:54:36 +0000 (13:54 +0200)] 
tty-ask-password-agent: support for watching both system-wide and per-user askpw dir

Fixes: #1232 #2217
12 months agotty-ask-password-agent: minor modernizations
Lennart Poettering [Fri, 13 Sep 2024 09:06:28 +0000 (11:06 +0200)] 
tty-ask-password-agent: minor modernizations

12 months agocore: modernize askpw handling a bit
Lennart Poettering [Fri, 13 Sep 2024 09:40:11 +0000 (11:40 +0200)] 
core: modernize askpw handling a bit

12 months agoMerge pull request #33398 from AdrianVovk/sysupdate-optional
Lennart Poettering [Mon, 21 Oct 2024 10:36:43 +0000 (12:36 +0200)] 
Merge pull request #33398 from AdrianVovk/sysupdate-optional

sysupdate: Add support for optional features

12 months agoMerge pull request #34667 from rpigott/resolved-bypass
Lennart Poettering [Mon, 21 Oct 2024 10:34:24 +0000 (12:34 +0200)] 
Merge pull request #34667 from rpigott/resolved-bypass

resolve: fixes for sd-resolved bypass

12 months agosysupdate: Use camelCase for JSON field names
Adrian Vovk [Fri, 18 Oct 2024 22:11:47 +0000 (18:11 -0400)] 
sysupdate: Use camelCase for JSON field names

Seems like we missed some snake_case field names in previous reviews of
systemd-sysupdate

12 months agomeasure: Take SizeOfImage into account as well for .linux section
Daan De Meyer [Fri, 4 Oct 2024 08:22:37 +0000 (10:22 +0200)] 
measure: Take SizeOfImage into account as well for .linux section

Same change as https://github.com/systemd/systemd/pull/34583 but for
systemd-measure. Otherwise we end up with PCR policy digest mismatches
as systemd-stub will measure the full virtual size of the kernel image
after it has been loaded while systemd-measure will disregard the extra
size introduced by SizeOfImage.

While ideally the stub would only measure the data that's actually on
disk and not the uninitialized data introduced by VirtualSize > SizeOfRawData,
we want newer systemd-measure to work with older stubs so we have to fix
systemd-measure and can't fix this in the stub.

12 months agotest: exercise bypass mode on the sd-resolved stub 34667/head
Ronan Pigott [Fri, 11 Oct 2024 05:40:03 +0000 (22:40 -0700)] 
test: exercise bypass mode on the sd-resolved stub

A basic test will verify that we provide the right flags.

12 months agoresolved: update condition for caching full packets
Ronan Pigott [Sat, 12 Oct 2024 17:00:56 +0000 (10:00 -0700)] 
resolved: update condition for caching full packets

Previously a full packet was cached only if the CD bit was set, but this
no longer corresponds to the cases where bypass is enabled.

Update the cache to retain a full packet in the cases where it might
actually be useful.

12 months agoresolved: enable CD bit without DO set
Ronan Pigott [Sat, 19 Oct 2024 04:10:57 +0000 (21:10 -0700)] 
resolved: enable CD bit without DO set

This is useful for a validating resolver to indicate to a non-validating
resolver when checking was disabled for the query. This matches the
behavior of the major public resovlers in response to queries with CD bu
tnot DO set.

12 months agoresolved: authenticate bypass queries
Ronan Pigott [Mon, 7 Oct 2024 18:05:18 +0000 (11:05 -0700)] 
resolved: authenticate bypass queries

Following 13e15dae9f0b, resolved does not forward the AD bit for bypass
queries, but resolved also didn't do it's own validation, making these
replies appear to never be authentic. We should enable validation for
bypass queries.

Let's disable our own validation when processing a +cd query, and also
ensure that it skips the cache so that we don't accidentally fail to
return inauthentic replies from upstream.

Previously, when we had a bypass transaction without cd, a cached,
authenticated, reply with cd could be served, leaving the cd bit
erroneously set in the reply. Only reply with a CD bit if the client
requested it.

Fixes: 13e15dae9f0b (resolved: clear the AD bit for bypass packets)
12 months agoTEST-55-OOMD: workaround for kernel regression in 6.12-rcX
Yu Watanabe [Fri, 11 Oct 2024 17:44:22 +0000 (02:44 +0900)] 
TEST-55-OOMD: workaround for kernel regression in 6.12-rcX

This ignore failures when running on kernel-6.12-rcX, which has a
regression in the kernel scheduler that breaks PSI.

From https://github.com/systemd/systemd/issues/32730#issuecomment-2415312260
> There is a known scheduler bug in 6.12 that breaks psi. It leaks
> "running tasks" counts, which matches your symptoms of seeing partial
> pressure only.
>
> Do you see "inconsistent task state" warnings in dmesg | grep psi?
>
> A fix is queued in the scheduler tree, should be sent to Linus shortly:
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=c6508124193d42bbc3224571eb75bfa4c1821fbb

Workaround for #32730.

12 months agoupdatectl: Introduce optional feature verbs 33398/head
Adrian Vovk [Fri, 5 Jul 2024 00:03:09 +0000 (20:03 -0400)] 
updatectl: Introduce optional feature verbs

This introduces a nice UX for listing, inspecting, enabling, and
disabling optional features from the command line.

12 months agosysupdated: Plumb through optional features
Adrian Vovk [Tue, 2 Jul 2024 18:41:31 +0000 (14:41 -0400)] 
sysupdated: Plumb through optional features

This adds APIs to enumerate/inspect/enable/disable optional features.

12 months agosysupdate: Add verb to inspect features
Adrian Vovk [Wed, 3 Jul 2024 21:49:36 +0000 (17:49 -0400)] 
sysupdate: Add verb to inspect features

12 months agosysupdate: Add tests for optional features
Adrian Vovk [Tue, 2 Jul 2024 18:56:27 +0000 (14:56 -0400)] 
sysupdate: Add tests for optional features

Makes sure we don't regress on #33343 and #33344

12 months agosysupdate: Introduce optional features
Adrian Vovk [Sat, 22 Jun 2024 18:48:50 +0000 (14:48 -0400)] 
sysupdate: Introduce optional features

Optional features allow distros to define sets of transfers that can
be enabled or disabled by the system administrator. This is useful for
situations where a distro may want to ship some resources version-locked
to the core OS, but many people have no need for the resource, such as:
development tools/compilers, drivers for specialized hardware, language
packs, etc

We also rename sysupdate.d/*.conf -> sysupdate.d/*.transfer, because
now there are more than one type of definition in sysupdate.d/. For
backwards compat, we still load *.conf files as long as no *.transfer
files are found and the *.conf files don't try to declare themselves
as part of any features

Fixes https://github.com/systemd/systemd/issues/33343
Fixes https://github.com/systemd/systemd/issues/33344

12 months agofs-util: Introduce symlinkat_idempotent
Adrian Vovk [Fri, 18 Oct 2024 21:57:42 +0000 (17:57 -0400)] 
fs-util: Introduce symlinkat_idempotent

12 months agoMerge pull request #34820 from poettering/dissect-image-uclean
Yu Watanabe [Fri, 18 Oct 2024 17:15:01 +0000 (02:15 +0900)] 
Merge pull request #34820 from poettering/dissect-image-uclean

dissect-image: generate better log message for EUCLEAN dissect error

12 months agoMerge pull request #34783 from keszybz/man-nspawn-private-users
Zbigniew Jędrzejewski-Szmek [Fri, 18 Oct 2024 16:44:05 +0000 (18:44 +0200)] 
Merge pull request #34783 from keszybz/man-nspawn-private-users

Change systemd-nspawn man page to strongly recommend private users

12 months agotree-wise: use "lightweight" spelling 34783/head
Zbigniew Jędrzejewski-Szmek [Tue, 15 Oct 2024 16:54:28 +0000 (18:54 +0200)] 
tree-wise: use "lightweight" spelling

Both spellings were used, but the dictionary says that "lightweight"
is the standard spelling.

12 months agoman/systemd-nspawn: emphasise that user namespaces are strongly recommended
Zbigniew Jędrzejewski-Szmek [Tue, 15 Oct 2024 16:53:00 +0000 (18:53 +0200)] 
man/systemd-nspawn: emphasise that user namespaces are strongly recommended

12 months agotest: customize /etc/os-release instead of /usr/lib/os-release
Luca Boccassi [Fri, 18 Oct 2024 14:02:03 +0000 (15:02 +0100)] 
test: customize /etc/os-release instead of /usr/lib/os-release

As per spec image builders can create a local /etc/os-release
with per-image IDs, so modify that one instead of the original
one in /usr/lib. For example we do this when we build debian
unstable images in mkosi.

12 months agodissect-image: generate better log message for EUCLEAN dissect error 34820/head
Lennart Poettering [Fri, 18 Oct 2024 12:16:53 +0000 (14:16 +0200)] 
dissect-image: generate better log message for EUCLEAN dissect error

Fixes: #31799
12 months agodissect-image: uppercase first char of dissect error message systematically
Lennart Poettering [Fri, 18 Oct 2024 12:16:13 +0000 (14:16 +0200)] 
dissect-image: uppercase first char of dissect error message systematically

Some of the log message stricts used proper uppercasing, others didn't.
Fix that to make it uniform.

12 months agoresolved: refresh resolv.conf files when link goes away
Lennart Poettering [Fri, 18 Oct 2024 09:30:12 +0000 (11:30 +0200)] 
resolved: refresh resolv.conf files when link goes away

This might have the effect that some DNS server or search domain
disappears, hence rewrite the relevant files.

See: #27543

12 months agomkosi: update opensuse commit reference and switch branch
Luca Boccassi [Fri, 18 Oct 2024 10:35:56 +0000 (11:35 +0100)] 
mkosi: update opensuse commit reference and switch branch

'factory' was reset to 8 years ago

12 months agoresolved: add some more comments to varlink interface
Lennart Poettering [Fri, 18 Oct 2024 08:20:21 +0000 (10:20 +0200)] 
resolved: add some more comments to varlink interface

This is by no means complete, but gets us a bit closer.

12 months agonetworkd: raise limits on number of address 8x
Lennart Poettering [Fri, 18 Oct 2024 07:19:23 +0000 (09:19 +0200)] 
networkd: raise limits on number of address 8x

Limits should be enforced, but not in a way real setups collide with
them.

There have been multiple reports that current limits are too low, hence
raise them 8x.

Fixes: #24852
12 months agoupdate TODO
Lennart Poettering [Fri, 18 Oct 2024 07:54:32 +0000 (09:54 +0200)] 
update TODO

12 months agoupdate TODO
Lennart Poettering [Fri, 18 Oct 2024 07:23:54 +0000 (09:23 +0200)] 
update TODO

12 months agoGREEDY_REALLOC_APPEND: Make more type safe
Adrian Vovk [Wed, 4 Sep 2024 17:44:26 +0000 (13:44 -0400)] 
GREEDY_REALLOC_APPEND: Make more type safe

Previously, GREEDY_REALLOC_APPEND would compile perfectly fine and cause
subtle memory corruption if the caller messes up the type they're passing
in (i.e. by forgetting to pass-by-reference when appending a Type* to an
array of Type*). Now this will lead to compilation failure

12 months agoMerge pull request #34801 from poettering/async-sd-notify-close
Lennart Poettering [Thu, 17 Oct 2024 12:43:19 +0000 (14:43 +0200)] 
Merge pull request #34801 from poettering/async-sd-notify-close

pid1: close unexpected fds received via sd_notify() asyncronously

12 months agoMerge pull request #34795 from YHNdnzj/bump-kernel-baseline-5.4
Lennart Poettering [Thu, 17 Oct 2024 12:42:25 +0000 (14:42 +0200)] 
Merge pull request #34795 from YHNdnzj/bump-kernel-baseline-5.4

Bump kernel baseline to 5.4

12 months agoudev: consider serial ports as unconfigured only if both port and iomem_base sysattr...
Lennart Poettering [Thu, 17 Oct 2024 07:57:41 +0000 (09:57 +0200)] 
udev: consider serial ports as unconfigured only if both port and iomem_base sysattr is zero

Various archs do not know the "io port" concept, hence check for the
"iomem" configuration, too.

Fixes: #34800
12 months agopid1: close fds we receive via sd_notify() and cannot make use of asynchronously 34801/head
Lennart Poettering [Thu, 17 Oct 2024 07:46:16 +0000 (09:46 +0200)] 
pid1: close fds we receive via sd_notify() and cannot make use of asynchronously

This addresses #11112 fully. It mostly was addressed by
99620f457ed0886852ba18c9093b59767299121c already, but for fds not
even passed to the fdstore, this adds the missing asynchronous close
codepath.

Fixes: #11112
12 months agofdset: optionally, close remaining fds asynchronously
Lennart Poettering [Thu, 17 Oct 2024 07:43:37 +0000 (09:43 +0200)] 
fdset: optionally, close remaining fds asynchronously

12 months agoMerge pull request #34597 from ryantimwilson/oomd-pressure-duration
Yu Watanabe [Thu, 17 Oct 2024 05:30:13 +0000 (14:30 +0900)] 
Merge pull request #34597 from ryantimwilson/oomd-pressure-duration

Add ManagedOOMMemoryPressureDurationSec override setting for units

12 months agoReformat load-fragment-gperf.gperf.in 34597/head
Ryan Wilson [Tue, 15 Oct 2024 04:13:36 +0000 (21:13 -0700)] 
Reformat load-fragment-gperf.gperf.in

This commit reformats load-fragment-gperf.gperf.in after changes
made for adding the ManagedOOMMemoryPressureDurationSec= property.

12 months agocgroup: Add ManagedOOMMemoryPressureDurationSec= override setting for units
Ryan Wilson [Tue, 15 Oct 2024 03:49:54 +0000 (20:49 -0700)] 
cgroup: Add ManagedOOMMemoryPressureDurationSec= override setting for units

This will allow units (scopes/slices/services) to override the default
systemd-oomd setting DefaultMemoryPressureDurationSec=.

The semantics of ManagedOOMMemoryPressureDurationSec= are:
- If >= 1 second, overrides DefaultMemoryPressureDurationSec= from oomd.conf
- If is empty, uses DefaultMemoryPressureDurationSec= from oomd.conf
- Ignored if ManagedOOMMemoryPressure= is not "kill"
- Disallowed if < 1 second

Note the corresponding dbus property is DefaultMemoryPressureDurationUSec
which is in microseconds. This is consistent with other time-based
dbus properties.

12 months agooomd: Refactor DefaultMemoryPressureDurationSec= to use conf parser
Ryan Wilson [Wed, 16 Oct 2024 17:40:30 +0000 (10:40 -0700)] 
oomd: Refactor DefaultMemoryPressureDurationSec= to use conf parser

Parsing DefaultMemoryPressureDurationSec= is currently split between
conf parser, main() and manager_start() methods. This commit centralizes
parsing and bounds checking logic within a single custom conf parser
function.

12 months agoMerge pull request #34797 from yuwata/test-mount
Yu Watanabe [Wed, 16 Oct 2024 22:23:36 +0000 (07:23 +0900)] 
Merge pull request #34797 from yuwata/test-mount

TEST-60: several cleanups and potential performance improvement

12 months agoTEST-60-MOUNT-RATELIMIT: disable journal ratelimiting 34797/head
Yu Watanabe [Wed, 16 Oct 2024 13:34:48 +0000 (22:34 +0900)] 
TEST-60-MOUNT-RATELIMIT: disable journal ratelimiting

Otherwise, journal check in testcase_mount_ratelimit() may fail and we
need to wait 2 minutes.

12 months agoTEST-60-MOUNT-RATEMINIT: split into small test cases
Yu Watanabe [Wed, 16 Oct 2024 13:32:09 +0000 (22:32 +0900)] 
TEST-60-MOUNT-RATEMINIT: split into small test cases

Then, use run_testcases().

12 months agoTEST-60-MOUNT-RATELIMIT: wait for mount unit being started or stopped
Yu Watanabe [Wed, 16 Oct 2024 12:17:15 +0000 (21:17 +0900)] 
TEST-60-MOUNT-RATELIMIT: wait for mount unit being started or stopped

12 months agoMerge pull request #34793 from yuwata/journalctl-copy-arguments
Yu Watanabe [Wed, 16 Oct 2024 16:52:03 +0000 (01:52 +0900)] 
Merge pull request #34793 from yuwata/journalctl-copy-arguments

journalctl: copy arguments

12 months agoBump kernel recommended baseline to v5.4 34795/head
Mike Yuan [Tue, 15 Oct 2024 16:36:51 +0000 (18:36 +0200)] 
Bump kernel recommended baseline to v5.4

12 months agoNEWS: rearrange incompatible changes, separate from Future Removals
Mike Yuan [Tue, 15 Oct 2024 16:33:49 +0000 (18:33 +0200)] 
NEWS: rearrange incompatible changes, separate from Future Removals

12 months agodoc: fix typo
Yu Watanabe [Wed, 16 Oct 2024 15:49:56 +0000 (00:49 +0900)] 
doc: fix typo

Follow-up for b3b7cf8b7c35df14c6eb4f79da1a241dc0aa8c7e.

12 months agomachine: fix typo
Yu Watanabe [Wed, 16 Oct 2024 15:48:40 +0000 (00:48 +0900)] 
machine: fix typo

Follow-up for ad0d4f9a4c340f3fd5f0fcf646f7c762722737cd.

12 months agopidref: fix typo
Yu Watanabe [Wed, 16 Oct 2024 15:46:42 +0000 (00:46 +0900)] 
pidref: fix typo

Follow-up for de34ec188c4d4f682a337445aa7753259cd7f821.

12 months agoukify: fix typo
Yu Watanabe [Wed, 16 Oct 2024 15:44:38 +0000 (00:44 +0900)] 
ukify: fix typo

Follow-up for 02eabaffe98c9a3b5dec1c4837968a4d3e2ff7db.

12 months agoMerge pull request #34381 from DaanDeMeyer/extension-submounts
Yu Watanabe [Wed, 16 Oct 2024 15:11:17 +0000 (00:11 +0900)] 
Merge pull request #34381 from DaanDeMeyer/extension-submounts

sysext: Deal with nested mounts properly

12 months agoFix maybe-uninitialized warnings with gcc 14.2
Luca Boccassi [Wed, 16 Oct 2024 10:42:06 +0000 (11:42 +0100)] 
Fix maybe-uninitialized warnings with gcc 14.2

../src/resolve/resolved-bus.c: In function ‘call_link_method’:
../src/resolve/resolved-bus.c:1769:16: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
 1769 |         return handler(message, l, error);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1755:15: note: ‘l’ was declared here
 1755 |         Link *l;
      |               ^
../src/resolve/resolved-bus.c: In function ‘bus_method_get_link’:
../src/resolve/resolved-bus.c:1828:13: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
 1828 |         p = link_bus_path(l);
      |             ^~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1816:15: note: ‘l’ was declared here
 1816 |         Link *l;
      |               ^

12 months agopid1: add env var to override default mount rate limit interval
xujing [Wed, 16 Oct 2024 07:19:09 +0000 (15:19 +0800)] 
pid1: add env var to override default mount rate limit interval

Similar to 24a4542c24a4542c can only be set 1 in 1s at most,
sometimes we may need to set to something else(such as 1 in 2s).
So it's best to let the user decide.

This also allows users to solve #34690.

12 months agojournalctl: do not directly use optarg, but copy optarg before use 34793/head
Yu Watanabe [Wed, 16 Oct 2024 10:34:18 +0000 (19:34 +0900)] 
journalctl: do not directly use optarg, but copy optarg before use

Otherwise, if the process forks child processes, then the arguments
cannot be used from them.
To avoid potential issues like the one fixed by
6d3012bab4ce4c1ed260598d05b4e9f2ea471658.

12 months agoMerge pull request #34791 from poettering/live-mount-tweak
Luca Boccassi [Wed, 16 Oct 2024 13:43:14 +0000 (14:43 +0100)] 
Merge pull request #34791 from poettering/live-mount-tweak

tweaks to live mount property logging

12 months agosysext: Deal with nested mounts properly 34381/head
Daan De Meyer [Thu, 12 Sep 2024 18:42:02 +0000 (20:42 +0200)] 
sysext: Deal with nested mounts properly

Nested mounts should be carried over from host to overlayfs to overlayfs
(and back to host if unmerged). Otherwise you run into hard to debug
issues where merging extensions means you can't unmount those nested mounts
anymore as they are hidden by the overlayfs mount.

To fix this, before unmerging any previous extensions, let's move the nested
mounts from the hierarchy to the workspace, then set up the new hierachy, and
finally, just before moving the hierarchy into place, move the nested mounts
back into place.

Because there might be multiple nested mounts that consists of one or more
mounts stacked on top of each other, we make sure to move all stacked mounts
properly to the overlayfs. The kernel doesn't really provide a nice way to do
this, so we create a stack, pop off each mount onto the stack and then pop from
the stack again to the destination to re-establish the stacked mounts in the same
order in the destination.

12 months agosysext: Run unmerge in a subprocess
Daan De Meyer [Thu, 12 Sep 2024 18:28:01 +0000 (20:28 +0200)] 
sysext: Run unmerge in a subprocess

Preparation for later commit where we need a private mount namespace
for unmerge.

12 months agojournalctl: erase verify key before free
Yu Watanabe [Wed, 16 Oct 2024 10:27:36 +0000 (19:27 +0900)] 
journalctl: erase verify key before free

Even optarg is erased, copied string was not erased.
Let's erase the copied key for safety.

12 months agomount-util: Make get_submounts() a public function
Daan De Meyer [Thu, 12 Sep 2024 10:20:56 +0000 (12:20 +0200)] 
mount-util: Make get_submounts() a public function

12 months agoMerge pull request #34756 from yuwata/test-oomd-cleanups
Yu Watanabe [Wed, 16 Oct 2024 09:39:33 +0000 (18:39 +0900)] 
Merge pull request #34756 from yuwata/test-oomd-cleanups

TEST-55-OOMD: several cleanups

12 months agotest: fix TOCTOU in test-json
Yu Watanabe [Wed, 16 Oct 2024 05:35:32 +0000 (14:35 +0900)] 
test: fix TOCTOU in test-json

Follow-up for 60ae3b86fb52d545b279e3927d2214462385e734.
Fixes CID#1563782.

12 months agocore: move debug logging from _can_live_mount() functions to caller 34791/head
Lennart Poettering [Wed, 16 Oct 2024 08:45:10 +0000 (10:45 +0200)] 
core: move debug logging from _can_live_mount() functions to caller

Let's debug log the returned dbus error where we want the logging, but
don't log it, where we don't.

This removes the noisy logging from the property handler for the
CanLiveMount property, but keeps it in place for the MountImage() method
call where we want it.

Alternative to #34175

Follow-up for 5162829ec87df20c7af763bdf274735bf9e53552 and 1cafbecabecc619b4e147abd9925282d0ff323bd

12 months agocore: one more Mount -> LiveMount rename
Luca Boccassi [Thu, 29 Aug 2024 15:10:46 +0000 (16:10 +0100)] 
core: one more Mount -> LiveMount rename

Missed by earlier search-and-replace

Follow-up for 5162829ec87df20c7af763bdf274735bf9e53552

12 months agoMerge pull request #34742 from yuwata/test-storage
Frantisek Sumsal [Wed, 16 Oct 2024 08:21:22 +0000 (10:21 +0200)] 
Merge pull request #34742 from yuwata/test-storage

test: fix multipath test in TEST-64-STORAGE

12 months agoTEST-55-OOMD: check slice property before stressing slice 34756/head
Yu Watanabe [Wed, 16 Oct 2024 06:20:08 +0000 (15:20 +0900)] 
TEST-55-OOMD: check slice property before stressing slice

12 months agoTEST-55-OOMD: stop test units when unnecessary
Yu Watanabe [Wed, 16 Oct 2024 06:18:41 +0000 (15:18 +0900)] 
TEST-55-OOMD: stop test units when unnecessary

Then, sleep becomes not necessary anymore. This greatly improve performance.

12 months agoTEST-55-OOMD: check slice more in detail
Yu Watanabe [Wed, 16 Oct 2024 06:12:32 +0000 (15:12 +0900)] 
TEST-55-OOMD: check slice more in detail

system and user slice has same name, hence we need to check full path.

12 months agoTEST-55-OOMD: split into small testcases
Yu Watanabe [Wed, 16 Oct 2024 06:04:07 +0000 (15:04 +0900)] 
TEST-55-OOMD: split into small testcases

Then, we can run each small test cases separately.

12 months agoTEST-55-OOMD: check global config earlier
Yu Watanabe [Wed, 16 Oct 2024 05:52:49 +0000 (14:52 +0900)] 
TEST-55-OOMD: check global config earlier

'Default Memory Pressure Duration' field in oomctl, which can be configured
with DefaultMemoryPressureDurationSec= in oomd.conf, is a global config.
Let's check it earlier.

This also drops unnecessary cleanup at the beginning.

12 months agoTEST-55-OOMD: set ManagedOOMMemoryPressure= and friends in a drop-in config
Yu Watanabe [Fri, 11 Oct 2024 07:09:11 +0000 (16:09 +0900)] 
TEST-55-OOMD: set ManagedOOMMemoryPressure= and friends in a drop-in config

Fedora and friends has a drop-in config for the settings in
/usr/lib/systemd/user/slice.d/ . Hence, settings in the main .slice may be
overridden. Let's set below in a drop-in with higher decimal prefix.

Also, rename override.conf -> 99-managed-oom-preference.conf for the same reason.

12 months agoTEST-19-CGROUP: add test cases for IPAddressAllow=/IPAddressDeny= 34787/head
Yu Watanabe [Wed, 16 Oct 2024 05:31:16 +0000 (14:31 +0900)] 
TEST-19-CGROUP: add test cases for IPAddressAllow=/IPAddressDeny=

12 months agocore/cgroup: fix IPAddressAllow=/IPAddressDeny= set through DBus
Yu Watanabe [Wed, 16 Oct 2024 03:45:34 +0000 (12:45 +0900)] 
core/cgroup: fix IPAddressAllow=/IPAddressDeny= set through DBus

Fixes a regression caused by 84ebe6f01381c21b88e37e856956c9c9ee6781d6 (v250).
Fixes #34773.

12 months agogpt-auto: remove directory check for ESP mount
Michael Ferrari [Tue, 15 Oct 2024 16:42:20 +0000 (18:42 +0200)] 
gpt-auto: remove directory check for ESP mount

Ensure that we always attempt to mount the `ESP` partition to `/boot`
when there is no `XBOOTLDR` partition.

Fixes an issue when booting without a `XBOOTLDR` partition and an empty
root partition, since it would mount the `ESP` partition to `/efi/`
unconditionally causing boot entries to not be under `/boot/` as
recommended by the Boot Loader Specification.

12 months agoMerge pull request #34482 from bgurney-rh/alt-nvme-multins-symlink-fix
Yu Watanabe [Wed, 16 Oct 2024 01:05:46 +0000 (10:05 +0900)] 
Merge pull request #34482 from bgurney-rh/alt-nvme-multins-symlink-fix

Pin obsolete NVMe symlinks to namespace 1

12 months agoMerge pull request #34781 from poettering/write-string-rename-full
Yu Watanabe [Tue, 15 Oct 2024 21:18:57 +0000 (06:18 +0900)] 
Merge pull request #34781 from poettering/write-string-rename-full

fileio: write_string_file() naming clean-ups

12 months agoMerge pull request #34719 from poettering/pidref-remote
Yu Watanabe [Tue, 15 Oct 2024 21:15:26 +0000 (06:15 +0900)] 
Merge pull request #34719 from poettering/pidref-remote

pidref: add explicit concept of "remote" PidRef

12 months agojson-util: initialize "remote" flag for PidRef when parsing JSON pidref serializations 34719/head
Lennart Poettering [Fri, 11 Oct 2024 15:14:26 +0000 (17:14 +0200)] 
json-util: initialize "remote" flag for PidRef when parsing JSON pidref serializations

Now that we have a way to recognize "remoteness" of a PidRef, let's make
sure when we decode a JSON pidref we initialize things that way.

12 months agopidref: add explicit concept of "remote" PidRef
Lennart Poettering [Fri, 11 Oct 2024 09:33:42 +0000 (11:33 +0200)] 
pidref: add explicit concept of "remote" PidRef

This PidRef just track some data, but cannot be used for any active
operation.

Background: for https://github.com/systemd/systemd/pull/34703 it makes
sense to track explicitly if some PidRef is not a local one, so that we
never attempt to for example "kill a remote process" and thus
acccidentally hit the wrong process (i.e. a local one by the same PID).

12 months agodebug-generator: create prefix dir of generate unit file 34781/head
Lennart Poettering [Tue, 15 Oct 2024 13:36:06 +0000 (15:36 +0200)] 
debug-generator: create prefix dir of generate unit file

Strictly speaking, it's more correct if we create the prefix path before
writing our unit file.