]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 days agoopenssl-util: drop unnecessary functions when OpenSSL support is disabled 39455/head
Yu Watanabe [Sun, 26 Oct 2025 13:06:35 +0000 (22:06 +0900)] 
openssl-util: drop unnecessary functions when OpenSSL support is disabled

5 days agoopenssl-util: sort cleanup functions
Yu Watanabe [Sun, 2 Nov 2025 07:00:55 +0000 (16:00 +0900)] 
openssl-util: sort cleanup functions

5 days agorepart: drop OpenSSL specific logics when OpenSSL support is disabled
Yu Watanabe [Sun, 26 Oct 2025 12:44:59 +0000 (21:44 +0900)] 
repart: drop OpenSSL specific logics when OpenSSL support is disabled

5 days agorepart: merge common conditions
Yu Watanabe [Sun, 26 Oct 2025 12:42:26 +0000 (21:42 +0900)] 
repart: merge common conditions

No functional change, just refactoring.

5 days agorepart: make sign_verity_roothash() take Context
Yu Watanabe [Sun, 26 Oct 2025 12:40:42 +0000 (21:40 +0900)] 
repart: make sign_verity_roothash() take Context

No functional change, just refactoring.

5 days agorepart: load x509 certificate and private key after Context is allocated
Yu Watanabe [Sun, 26 Oct 2025 09:27:51 +0000 (18:27 +0900)] 
repart: load x509 certificate and private key after Context is allocated

This splits out context_load_keys() from parse_argv().
No functional change, just refactoring.

5 days agobootctl: return earlier when secure boot auto-enrollment is requested but OpenSSL...
Yu Watanabe [Sun, 26 Oct 2025 07:58:09 +0000 (16:58 +0900)] 
bootctl: return earlier when secure boot auto-enrollment is requested but OpenSSL support is disabled

5 days agobootctl: move conditions into corresponding functions
Yu Watanabe [Sun, 26 Oct 2025 07:57:07 +0000 (16:57 +0900)] 
bootctl: move conditions into corresponding functions

5 days agoopenssl-util: drop unused fake type definitions when OpenSSL is disabled
Yu Watanabe [Sun, 26 Oct 2025 07:22:42 +0000 (16:22 +0900)] 
openssl-util: drop unused fake type definitions when OpenSSL is disabled

5 days agope-binary: drop pe_hash() and friends when OpenSSL support is disabled
Yu Watanabe [Sun, 26 Oct 2025 07:33:11 +0000 (16:33 +0900)] 
pe-binary: drop pe_hash() and friends when OpenSSL support is disabled

These three functions are currently only used by sbsign, which requires
OpenSSL. Moreover, pe_hash() and uki_hash() anyway do not work if
OpenSSL is disabled. Let's only declare them when OpenSSL support is
enabled.

5 days agoopenssl-util: drop unused string_hashsum() and friends when OpenSSL is disabled
Yu Watanabe [Sun, 26 Oct 2025 07:19:47 +0000 (16:19 +0900)] 
openssl-util: drop unused string_hashsum() and friends when OpenSSL is disabled

5 days agoresolvectl: return earlier from openpgp command when OpenSSL support is disabled
Yu Watanabe [Sun, 26 Oct 2025 07:15:56 +0000 (16:15 +0900)] 
resolvectl: return earlier from openpgp command when OpenSSL support is disabled

When OpenSSL is disabled, string_hashsum_sha256()/_sha224() in
resolve_openpgp() will fail anyway. Let's return earlier.

5 days agocoredump: several cleanups, modernizations, fixlets for corner cases (#39418)
Yu Watanabe [Sun, 2 Nov 2025 01:13:53 +0000 (10:13 +0900)] 
coredump: several cleanups, modernizations, fixlets for corner cases (#39418)

5 days agodocs: add comment about requiring the mount hierarchy to be mounted MS_SHARED
Lennart Poettering [Sat, 1 Nov 2025 21:21:32 +0000 (22:21 +0100)] 
docs: add comment about requiring the mount hierarchy to be mounted MS_SHARED

This has been tripping up container manager people. let's document this
explicitly.

(Note that the container interface could really use some updates, i.e.
it was written before a time where cgroup namespacing was a thing. But I
am too lazy to fix that now, so let's just add this once facet.)

5 days agoSeveral cleanups for libcryptsetup dependency (#39452)
Yu Watanabe [Sat, 1 Nov 2025 23:07:15 +0000 (08:07 +0900)] 
Several cleanups for libcryptsetup dependency (#39452)

5 days agorepart: varlink support (#39421)
Lennart Poettering [Sat, 1 Nov 2025 22:21:37 +0000 (23:21 +0100)] 
repart: varlink support (#39421)

Split out of #38764

Replaces: #33741

5 days agodoc: indicate Type=oneshot also detects invocation failures
Christoph Anton Mitterer [Mon, 20 Oct 2025 01:30:58 +0000 (03:30 +0200)] 
doc: indicate Type=oneshot also detects invocation failures

Type `simple` explicitly mentions that invocation failures like a missing binary
or `User=` name won’t get detected – whereas type `exec` mentions that it does.

Type `oneshot` refers to being similar to `simple`, which could lead one to
assume it doesn’t detect such invocation failures either – it seems however it
does.

Indicate this my changing its wording to be similar to `exec`.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
5 days agoci: add testcases for recently added stuff 39421/head
Lennart Poettering [Thu, 23 Oct 2025 07:26:37 +0000 (09:26 +0200)] 
ci: add testcases for recently added stuff

5 days agorepart: report vendor/model/subsystem fields in ListCandidateDevices
Lennart Poettering [Fri, 24 Oct 2025 15:18:51 +0000 (17:18 +0200)] 
repart: report vendor/model/subsystem fields in ListCandidateDevices

Prompted by: #39435

5 days agoblockdev-list: switch to log_device_xyz() style logging
Lennart Poettering [Fri, 24 Oct 2025 15:18:31 +0000 (17:18 +0200)] 
blockdev-list: switch to log_device_xyz() style logging

5 days agoudev: introduce ID_BLOCK_SUBSYSTEM property
Lennart Poettering [Fri, 24 Oct 2025 15:13:12 +0000 (17:13 +0200)] 
udev: introduce ID_BLOCK_SUBSYSTEM property

Virtual block devices are a bit weird: they have no parent device, and
thus cannot be related to the subsystem they belong to, except by
pattern matching their name. This is OK to do if one knows what to look
for. However for tools that do not want to carry a list of known
subsystems with their appropriate matching patters this sucks. Let's
introduce a new ID_BLOCK_SUBSYSTEM property we can set on block devices
that carries an explicit string for this. Do so for a small number of
key subsystems: DM, loopback and zram.

5 days agorepart: sort input before output parameters in varlink IDL
Lennart Poettering [Fri, 24 Oct 2025 14:16:11 +0000 (16:16 +0200)] 
repart: sort input before output parameters in varlink IDL

5 days agorepart: add knobs for automatically deferring all partitions marked as empty or for...
Lennart Poettering [Tue, 16 Sep 2025 11:26:42 +0000 (13:26 +0200)] 
repart: add knobs for automatically deferring all partitions marked as empty or for factory reset

5 days agorepart: send out progress information via varlink (if more flag is given)
Lennart Poettering [Fri, 12 Sep 2025 19:23:57 +0000 (21:23 +0200)] 
repart: send out progress information via varlink (if more flag is given)

And while we are at it, also send it out via sd_notify()

5 days agorepart: add Varlink call that runs repart's engine
Lennart Poettering [Thu, 28 Aug 2025 13:49:46 +0000 (15:49 +0200)] 
repart: add Varlink call that runs repart's engine

5 days agorepart: if device node is specified as "-", calculate needed disk space
Lennart Poettering [Fri, 29 Aug 2025 08:40:24 +0000 (10:40 +0200)] 
repart: if device node is specified as "-", calculate needed disk space

So far repart always required specification of a device node. And if
none was specified, then we'd fine the node backing the root fs. Let's
optionally allow that the device node is explicitly not specified (i.e.
specified as "-" or ""), in which case we'll just print the size of the
minimal image given the definitions.

5 days agorepart: split out main function that ponders about placement of partitions
Lennart Poettering [Thu, 28 Aug 2025 13:44:13 +0000 (15:44 +0200)] 
repart: split out main function that ponders about placement of partitions

Let's move the key code that places partitions into a function of its
own. That will make it easier to call this via varlink.

5 days agorepart: move definitions + dry_run + empty fields into Context
Lennart Poettering [Thu, 28 Aug 2025 13:28:20 +0000 (15:28 +0200)] 
repart: move definitions + dry_run + empty fields into Context

This is preparation for making this eventually available via Varlink,
where we'd like to create Context object for each call that we can free
once it is done, but not inherit state from an earlier call.

Also fixes a couple of cases where we accessed arg_node, but where we
should have accessed the Context-specific copy in .node.

5 days agorepart: use SD_JSON_BUILD_UNSIGNED for disk sizes, as we should
Lennart Poettering [Fri, 24 Oct 2025 09:13:14 +0000 (11:13 +0200)] 
repart: use SD_JSON_BUILD_UNSIGNED for disk sizes, as we should

5 days agosd-varlink: fix sd_varlink_collect() with empty replies
Lennart Poettering [Thu, 23 Oct 2025 09:07:16 +0000 (11:07 +0200)] 
sd-varlink: fix sd_varlink_collect() with empty replies

Follow-up for: 48c64813ec6bdbe536b7a62281292ea5981295ba

5 days agoman: add documentation for the various sd_json_dispatch_xyz() calls
Lennart Poettering [Fri, 24 Oct 2025 08:22:36 +0000 (10:22 +0200)] 
man: add documentation for the various sd_json_dispatch_xyz() calls

Now that we comprehensively return accept null it's a good idea to
document which function maps null to what.

5 days agocryptsetup-util: sym_crypt_free() and friends are unused when libcryptsetup is disabled 39452/head
Yu Watanabe [Sun, 26 Oct 2025 05:32:41 +0000 (14:32 +0900)] 
cryptsetup-util: sym_crypt_free() and friends are unused when libcryptsetup is disabled

5 days agocryptsetup-util: sort loaded function prototypes
Yu Watanabe [Sun, 26 Oct 2025 05:02:45 +0000 (14:02 +0900)] 
cryptsetup-util: sort loaded function prototypes

5 days agolibcryptsetup: drop several unnecessary checks for existences of functions by libcryp...
Yu Watanabe [Sun, 26 Oct 2025 04:12:01 +0000 (13:12 +0900)] 
libcryptsetup: drop several unnecessary checks for existences of functions by libcryptsetyp

The functions crypt_set_metadata_size() and friends are supported since
libcryptsetup-2.0.

This also merges checks for functions used for supporting libcryptsetup
plugins with others.
Moreover, check existence of one more function (crypt_logf) that is used in
libcryptsetup plugins.

5 days agosd-json: parse signals also in string format
Lennart Poettering [Fri, 24 Oct 2025 09:10:31 +0000 (11:10 +0200)] 
sd-json: parse signals also in string format

5 days agosd-json: parse uid_t/gid_t as uint32_t first
Lennart Poettering [Fri, 24 Oct 2025 09:09:01 +0000 (11:09 +0200)] 
sd-json: parse uid_t/gid_t as uint32_t first

Let's use the proper uint32_t parsers initially, so that the usual logic
of formatting integers as decimal strings, works too for uids/gids. Not
because it made any sense to encode them like that, but just to be
systematic here.

5 days agosd-json: make sure all dispatch helpers do something sensible in case of "null" JSON...
Lennart Poettering [Fri, 24 Oct 2025 07:57:48 +0000 (09:57 +0200)] 
sd-json: make sure all dispatch helpers do something sensible in case of "null" JSON value

Most of our dispatch helpers already do something useful in case they
are invoked on a null JSON value: they translate this to the appropriate
niche value for the type, if there is one.

Add the same for *all* dispatchers we have, to make this fully
systematic.

For various types it's not always clear which niche value to pick. I
opted for UINT{8,16,32,64}_MAX for the various unsigned integers, which
maps our own use in most cases. I opted for -1 for the various signed
integer types. For arrays/blobs of stuff I opted for the empty
array/blob, and for booleans I opted for false.

Of course, in various cases this is not going to be the right niche
value, but that's entirely fine, after all before a json value reaches a
dispatcher function it must pass one of two type checks first:

1. Either the .type field of sd_json_dispatch_field must be
   _SD_JSON_VARIANT_TYPE_INVALID to not do a type check at all

2. Or the .type field is set, but then the SD_JSON_NULLABLE flag must be
   set in .flags.

This means, accidentally generating the niche values on null is not
really likely.

5 days agoIgnore --now when systemctl enable is called in a chroot (#39456)
Yu Watanabe [Sat, 1 Nov 2025 19:48:53 +0000 (04:48 +0900)] 
Ignore --now when systemctl enable is called in a chroot (#39456)

5 days agoparse-util: Add parse_capability_set()
Daan De Meyer [Wed, 29 Oct 2025 21:39:48 +0000 (22:39 +0100)] 
parse-util: Add parse_capability_set()

Let's extract common capability parsing code into a generic function
parse_capability_set() with a comprehensive set of unit tests.

We also replace usages of UINT64_MAX with CAP_MASK_UNSET where
applicable and replace the default value of CapabilityBoundingSet
with CAP_MASK_ALL which more clearly identifies that it is initialized
to all capabilities.

AI (copilot) was used to extract the generic function and write the
unit tests, with manual review and fixing afterwards to make sure
everything was correct.

5 days agotest: migrate test-load-fragment to use ASSERT_* macros
Daan De Meyer [Wed, 29 Oct 2025 19:43:28 +0000 (20:43 +0100)] 
test: migrate test-load-fragment to use ASSERT_* macros

Replace all assert_se() calls with appropriate ASSERT_* macros from tests.h:
- assert_se(r >= 0) → ASSERT_OK(r)
- assert_se(r == 0) → ASSERT_OK_ZERO(r)
- assert_se(r == -ERR) → ASSERT_ERROR(r, ERR)
- assert_se(expr == value) → ASSERT_EQ(expr, value)
- assert_se(str1, str2) → ASSERT_STREQ(str1, str2)
- assert_se(ptr) → ASSERT_NOT_NULL(ptr)
- assert_se(!ptr) → ASSERT_NULL(ptr)
- assert_se(expr) → ASSERT_TRUE(expr)
- assert_se(!expr) → ASSERT_FALSE(expr)

Also added unsigned suffixes (U) to numeric literals in comparisons with
unsigned types (size_t, rlim_t) to eliminate signedness warnings.

This code was written with the help of AI.

5 days agotest: add test case for verity deferred removal without sharing
Luca Boccassi [Fri, 31 Oct 2025 16:46:49 +0000 (16:46 +0000)] 
test: add test case for verity deferred removal without sharing

I recently found out (the hard way) that on an older version
there was a bug when the verity sharing is disabled: the
deferred close flag was not set correctly, so verity devices
were leaked.

This is not an issue in main currently, but add a test case
to cover it just in case, to avoid future regressions.

5 days agoresolvectl: do not use strjoina() on user provided strings
Lennart Poettering [Sat, 1 Nov 2025 15:29:39 +0000 (16:29 +0100)] 
resolvectl: do not use strjoina() on user provided strings

6 days agosystemctl: downgrade or silence warnings for --now 39456/head
Zbigniew Jędrzejewski-Szmek [Sun, 26 Oct 2025 10:57:56 +0000 (11:57 +0100)] 
systemctl: downgrade or silence warnings for --now

When calling systemctl enable/disable/reenable --now, we'd always fail with
error when operating offline. This seemly overly restricitive. In particular,
if systemd is not running at all, the service is not running either, so
complaining that we can't stop it is completely unnecessary. But even when
operating in a chroot where systemd is not running, let's just emit a warning
and return success. It's fairly common to have installation or package scripts
which do such calls and not starting/restarting the service in those scenarios
is the desired and expected operation. (If --now is called in combination
with --global or --root=, keep returning an error.)

Also make the messages nicer. I was adding some docs to tell the user to run
'systemctl enable --now', and checked how the command can fail, and the error
message that the user might see in some common scenarios was too complicated.
Split it up to be nicer.

6 days agosystemctl: convert return value of install_client_side() to enum
Zbigniew Jędrzejewski-Szmek [Sun, 26 Oct 2025 10:34:22 +0000 (11:34 +0100)] 
systemctl: convert return value of install_client_side() to enum

The checks are reordered to do checks that don't require interacting with the
system first.

6 days agobuild(deps): bump softprops/action-gh-release from 2.2.2 to 2.4.1
dependabot[bot] [Sat, 1 Nov 2025 09:01:19 +0000 (09:01 +0000)] 
build(deps): bump softprops/action-gh-release from 2.2.2 to 2.4.1

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.2 to 2.4.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/da05d552573ad5aba039eaac05058a918a7bf631...6da8fa9354ddfdc4aeace5fc48d7f679b5214090)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
6 days agobuild(deps): bump redhat-plumbers-in-action/advanced-issue-labeler
dependabot[bot] [Sat, 1 Nov 2025 09:01:14 +0000 (09:01 +0000)] 
build(deps): bump redhat-plumbers-in-action/advanced-issue-labeler

Bumps [redhat-plumbers-in-action/advanced-issue-labeler](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/compare/0db433d412193574252480b4fc22f2e4319a4ea3...e38e6809c5420d038eed380d49ee9a6ca7c92dbf)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/advanced-issue-labeler
  dependency-version: 3.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
6 days agodiscover-image: introduce bus_property_get_image_is_read_only() with BUS_DEFINE_PROPE...
Yu Watanabe [Fri, 31 Oct 2025 11:33:34 +0000 (20:33 +0900)] 
discover-image: introduce bus_property_get_image_is_read_only() with BUS_DEFINE_PROPERTY_GET() macro

This also makes image_is_read_only() return bool.

Follow-up for ee327e086e0534645d1c8cb9daa49cd8d7d68d51.

6 days agoSeveral cleanups around strv_extendf() (#39508)
Yu Watanabe [Sat, 1 Nov 2025 09:10:42 +0000 (18:10 +0900)] 
Several cleanups around strv_extendf() (#39508)

6 days agocore: Add RootDirectoryFileDescriptor= (#39480)
Daan De Meyer [Fri, 31 Oct 2025 21:30:46 +0000 (22:30 +0100)] 
core: Add RootDirectoryFileDescriptor= (#39480)

RootDirectory= but via a open_tree() file descriptor. This allows
setting up the execution environment for a service by the client in a
mount namespace and then starting a transient unit in that execution
environment using the new property.

We also add --root-directory= and --same-root-dir= to systemd-run to
have it run services within the given root directory. As systemd-run
might be invoked from a different mount namespace than what systemd is
running in, systemd-run opens the given path with open_tree() and then
sends it to systemd using the new RootDirectoryFileDescriptor= property.

6 days agoanalyze: add missing help entry
Yu Watanabe [Fri, 31 Oct 2025 15:51:34 +0000 (00:51 +0900)] 
analyze: add missing help entry

Follow-up for 0fe29d0672d8c7ad422ca88ad12d10f08f3f2a05.

6 days agocore/exec-invoke: correct fd array size for collect_open_file_fds()
Mike Yuan [Fri, 31 Oct 2025 15:09:54 +0000 (16:09 +0100)] 
core/exec-invoke: correct fd array size for collect_open_file_fds()

Follow-up for f70346fb87052f37d446d2e9ccf915e5289b2b87

6 days agoman: fix outdated link to freedesktop.org documentation (#39511)
Florian [Fri, 31 Oct 2025 17:03:43 +0000 (18:03 +0100)] 
man: fix outdated link to freedesktop.org documentation (#39511)

Freedesktop changed their link format.

7 days agoreread-partition-table: take exclusive lock when requested
Yu Watanabe [Fri, 31 Oct 2025 14:03:14 +0000 (23:03 +0900)] 
reread-partition-table: take exclusive lock when requested

Before aa47d8ade18cc4a079fef5a1aaa37d763507104e, we took an exclusive lock
for the whole block device, but with the commit, a shared lock is taken.
That causes, during we requesting the kernel to reread partition table,
udev workers can process the block device or its partitions.

Let's make udev workers not process block devices during rereading
partition table again.

Follow-up for aa47d8ade18cc4a079fef5a1aaa37d763507104e.

7 days agovmspawn: replace strv_extendf() with strv_extend_joined() when concatenating strings 39508/head
Yu Watanabe [Fri, 31 Oct 2025 13:46:42 +0000 (22:46 +0900)] 
vmspawn: replace strv_extendf() with strv_extend_joined() when concatenating strings

7 days agovmspawn: use strv_extendf() at one more place
Yu Watanabe [Fri, 31 Oct 2025 13:45:05 +0000 (22:45 +0900)] 
vmspawn: use strv_extendf() at one more place

7 days agodns-rr: use strv_extendf() at one more place
Yu Watanabe [Fri, 31 Oct 2025 13:36:41 +0000 (22:36 +0900)] 
dns-rr: use strv_extendf() at one more place

7 days agocore/exec-invoke: use heap allocation to build environment variables
Yu Watanabe [Fri, 31 Oct 2025 13:30:43 +0000 (22:30 +0900)] 
core/exec-invoke: use heap allocation to build environment variables

We sometimes forget to increase the size N_ENV_VARS. Let's use heap
allocation.

7 days agostrv: introduce strv_extend_joined() and strv_extend_joined_with_size()
Yu Watanabe [Fri, 31 Oct 2025 13:19:31 +0000 (22:19 +0900)] 
strv: introduce strv_extend_joined() and strv_extend_joined_with_size()

7 days agostring-util: introduce strextendv_with_separator()
Yu Watanabe [Fri, 31 Oct 2025 13:08:35 +0000 (22:08 +0900)] 
string-util: introduce strextendv_with_separator()

7 days agostrv: introduce strv_extendf_with_size()
Yu Watanabe [Fri, 31 Oct 2025 12:57:37 +0000 (21:57 +0900)] 
strv: introduce strv_extendf_with_size()

7 days agocore: Add RootDirectoryFileDescriptor= 39480/head
Daan De Meyer [Tue, 28 Oct 2025 22:47:26 +0000 (23:47 +0100)] 
core: Add RootDirectoryFileDescriptor=

RootDirectory= but via a open_tree() file descriptor. This allows
setting up the execution environment for a service by the client in
a mount namespace and then starting a transient unit in that execution
environment using the new property.

We also add --root-directory= and --same-root-dir= to systemd-run to
have it run services within the given root directory. As systemd-run
might be invoked from a different mount namespace than what systemd is
running in, systemd-run opens the given path with open_tree() and then
sends it to systemd using the new RootDirectoryFileDescriptor= property.

7 days agoVarious --bind-user= fixes (#39498)
Yu Watanabe [Fri, 31 Oct 2025 11:43:54 +0000 (20:43 +0900)] 
Various --bind-user= fixes (#39498)

7 days agonetwork: do not restart DHCPv4 client on stopping/restarting networkd
Yu Watanabe [Mon, 20 Oct 2025 02:36:40 +0000 (11:36 +0900)] 
network: do not restart DHCPv4 client on stopping/restarting networkd

Follow-up for fc35a9f8d1632c4e7a279228f869bfc77d8f5b9c (v255).
Fixes #39299.

7 days agoimportd: support OS tree "mangling" unpriv too (#39406)
Lennart Poettering [Fri, 31 Oct 2025 08:46:36 +0000 (09:46 +0100)] 
importd: support OS tree "mangling" unpriv too (#39406)

Split out of #38728

(background: os tree "mangling" is what we do if a tarball with an OS
image inside it if is nested inside an extra top-level dir inside the
tarball, which we need to "mangle" and move everything inside one level
up)

7 days agonetwork: propagate error in link_carrier_lost()
Yu Watanabe [Fri, 31 Oct 2025 05:54:21 +0000 (14:54 +0900)] 
network: propagate error in link_carrier_lost()

Follow-up for 07021ed4f5ee5e34b06fcba97cab2c6214f601c9 (v258).

7 days agonspawn/vmspawn: Add --bind-user-group= option 39498/head
Daan De Meyer [Thu, 30 Oct 2025 21:23:20 +0000 (22:23 +0100)] 
nspawn/vmspawn: Add --bind-user-group= option

Useful to add the bound users to the wheel group.

7 days agonspawn-bind-user: Write membership records
Daan De Meyer [Thu, 30 Oct 2025 21:20:59 +0000 (22:20 +0100)] 
nspawn-bind-user: Write membership records

7 days agouserdbctl: Write empty JSON object into membership files
Daan De Meyer [Thu, 30 Oct 2025 21:49:03 +0000 (22:49 +0100)] 
userdbctl: Write empty JSON object into membership files

7 days agoTEST-87-AUX-UTILS-VM: Propagate SYSTEMD_PAGER at one more place
Daan De Meyer [Fri, 31 Oct 2025 07:44:16 +0000 (08:44 +0100)] 
TEST-87-AUX-UTILS-VM: Propagate SYSTEMD_PAGER at one more place

7 days agouserdb: Add missing .membership extension to membership files
Daan De Meyer [Thu, 30 Oct 2025 21:21:46 +0000 (22:21 +0100)] 
userdb: Add missing .membership extension to membership files

Follow up for fe0342edf4693ac14c8cb9a977afa09e4acd4daf

This also drops the mkosi testuser from the wheel and systemd-journal
groups as the integration tests rely on the testuser not being to read
the full journal.

7 days agonspawn: Fix docs
Daan De Meyer [Thu, 30 Oct 2025 21:20:36 +0000 (22:20 +0100)] 
nspawn: Fix docs

7 days agoman: clarify quoting of `$` in command lines (#39494)
Christoph Anton Mitterer [Fri, 31 Oct 2025 06:28:57 +0000 (07:28 +0100)] 
man: clarify quoting of `$` in command lines (#39494)

When the special executable prefix `:` is used, `$$` yield the literal `$$`.

7 days agoman: clarify requirements for BridgeVLAN to work
dgengtek [Thu, 30 Oct 2025 18:50:11 +0000 (19:50 +0100)] 
man: clarify requirements for BridgeVLAN to work

7 days agomount-setup: Add memory_hugetlb_accounting to cgroupfs mount (#39486)
Yu Watanabe [Fri, 31 Oct 2025 06:20:10 +0000 (15:20 +0900)] 
mount-setup: Add memory_hugetlb_accounting to cgroupfs mount (#39486)

This mount option will count HugeTLB memory usage towards the cgroup’s
overall memory usage for the memory controller.

See
https://lore.kernel.org/all/20231006184629.155543-4-nphamcs@gmail.com/T/#u
for the patch introducing the new mount option.

7 days agocore: Rename bus_set_transient_std_fd() and remove unused name argument
Daan De Meyer [Tue, 28 Oct 2025 23:11:49 +0000 (00:11 +0100)] 
core: Rename bus_set_transient_std_fd() and remove unused name argument

7 days agoimport: make sure image mangling works unpriv too 39406/head
Lennart Poettering [Mon, 25 Aug 2025 09:34:53 +0000 (11:34 +0200)] 
import: make sure image mangling works unpriv too

7 days agoimport-common: rework import_mangle_os_tree() to operate based on fd to tree
Lennart Poettering [Mon, 25 Aug 2025 09:19:02 +0000 (11:19 +0200)] 
import-common: rework import_mangle_os_tree() to operate based on fd to tree

7 days agoos-util: add fd_is_os_tree() which is like path_is_os_tree() but operates on an fd
Lennart Poettering [Mon, 25 Aug 2025 09:17:40 +0000 (11:17 +0200)] 
os-util: add fd_is_os_tree() which is like path_is_os_tree() but operates on an fd

7 days agomount-setup: Add memory_hugetlb_accounting to cgroupfs mount 39486/head
Daan De Meyer [Wed, 29 Oct 2025 15:30:07 +0000 (16:30 +0100)] 
mount-setup: Add memory_hugetlb_accounting to cgroupfs mount

This mount option will count HugeTLB memory usage towards the cgroup’s
overall memory usage for the memory controller.

See https://lore.kernel.org/all/20231006184629.155543-4-nphamcs@gmail.com/T/#u
for the patch introducing the new mount option.

7 days agomount-setup: Add optional function which provides extra mount options
Daan De Meyer [Wed, 29 Oct 2025 15:28:40 +0000 (16:28 +0100)] 
mount-setup: Add optional function which provides extra mount options

7 days agoimportd: port export-tar code to use the one systemd-dissect already uses (#39405)
Lennart Poettering [Thu, 30 Oct 2025 21:15:34 +0000 (22:15 +0100)] 
importd: port export-tar code to use the one systemd-dissect already uses (#39405)

Split out of #38728.

(Testcase is part of that PR)

7 days agomount-setup: Reformat table
Daan De Meyer [Wed, 29 Oct 2025 12:38:38 +0000 (13:38 +0100)] 
mount-setup: Reformat table

Preparation for the next commit.

7 days agocore: several cleanups/fixes for fd passing (#39491)
Daan De Meyer [Thu, 30 Oct 2025 18:57:16 +0000 (19:57 +0100)] 
core: several cleanups/fixes for fd passing (#39491)

8 days agocore/exec-invoke: switch keep_fds to heap allocation 39491/head
Mike Yuan [Thu, 30 Oct 2025 14:38:19 +0000 (15:38 +0100)] 
core/exec-invoke: switch keep_fds to heap allocation

Hardcoding total size of the array is error-prone, especially
considering the exeuctable_fd is added far below, so the '4' is
not entirely obvious. Also we seldomly do VLAs.

8 days agocore/exec-invoke: store all stashed fds in ExecParameters, incl. OpenFile= ones
Mike Yuan [Wed, 29 Oct 2025 21:13:35 +0000 (22:13 +0100)] 
core/exec-invoke: store all stashed fds in ExecParameters, incl. OpenFile= ones

Keeping a half-detached counter around brings nothing
but confusion, and leads to fd leak in error paths.

8 days agocore/exec-invoke: do not discard stashed fds when stdio is connected to socket
Mike Yuan [Wed, 29 Oct 2025 20:53:44 +0000 (21:53 +0100)] 
core/exec-invoke: do not discard stashed fds when stdio is connected to socket

This makes zero sense. Not sure how it got introduced...

8 days agocore/service: also pass sockets to control processes when stdio is named fd
Mike Yuan [Wed, 29 Oct 2025 21:03:02 +0000 (22:03 +0100)] 
core/service: also pass sockets to control processes when stdio is named fd

8 days agocore/service: only pass socket fds to control processes
Mike Yuan [Wed, 29 Oct 2025 20:25:42 +0000 (21:25 +0100)] 
core/service: only pass socket fds to control processes

If socket is used as stdio, we'd currently imply EXEC_PASS_FDS
and dump the whole set of fds to the control processes. This is
pretty much unexpected and unnecessary though, instead let's
pass only the socket fds.

Yes, this is a compat break, but a relatively minor one I'd
argue. And we can always revisit things if users do complain.

8 days agocore/execute: merge n_storage_fds and n_extra_fds into stashed_fds
Mike Yuan [Wed, 29 Oct 2025 20:20:26 +0000 (21:20 +0100)] 
core/execute: merge n_storage_fds and n_extra_fds into stashed_fds

The distinction between fdstore and extra fds is only meaningful
to struct Service. As far as executor is concerned they're just
some fds to pass to the service. Let's just merge it hence,
for the sake of simplicity.

8 days agocore/execute: serialize fd_names only if there're fds to pass
Mike Yuan [Thu, 30 Oct 2025 14:20:33 +0000 (15:20 +0100)] 
core/execute: serialize fd_names only if there're fds to pass

8 days agocore/execute: reorder ExecParameters fields
Mike Yuan [Wed, 29 Oct 2025 20:12:41 +0000 (21:12 +0100)] 
core/execute: reorder ExecParameters fields

8 days agocore/exec-invoke: rename process earlier
Mike Yuan [Thu, 30 Oct 2025 15:01:17 +0000 (16:01 +0100)] 
core/exec-invoke: rename process earlier

This is independent of any other setup stages, and should
happen as early as possible to make comm logged by journald
accurate.

8 days agocore/exec-invoke: set exit_status on exec_context_named_iofds() failure
Mike Yuan [Thu, 30 Oct 2025 14:58:19 +0000 (15:58 +0100)] 
core/exec-invoke: set exit_status on exec_context_named_iofds() failure

8 days agocore/exec-invoke: do not attempt to use fdstore/extra fds for stdio
Mike Yuan [Wed, 29 Oct 2025 20:27:46 +0000 (21:27 +0100)] 
core/exec-invoke: do not attempt to use fdstore/extra fds for stdio

According to systemd.exec(5):

> The fd:name option connects standard input to a specific, named
> file descriptor provided *by a socket unit*. ...

Currently however we're looking at the whole fd array passed,
fix it.

8 days agocore/exec-invoke: drop redundant stdio_fdname checks
Mike Yuan [Wed, 29 Oct 2025 18:39:35 +0000 (19:39 +0100)] 
core/exec-invoke: drop redundant stdio_fdname checks

exec_context_fdname() would never return NULL if corresponding
stdio mode is set to named fd.

8 days agocore/execute: mark exec_context_fdname() as pure
Mike Yuan [Wed, 29 Oct 2025 20:33:13 +0000 (21:33 +0100)] 
core/execute: mark exec_context_fdname() as pure

8 days agocore/execute: remove unused ExecParameters.cgroup_supported
Mike Yuan [Wed, 29 Oct 2025 18:05:43 +0000 (19:05 +0100)] 
core/execute: remove unused ExecParameters.cgroup_supported

Follow-up for 188286eec6b3af2a13c2ccd86038f74e3d5da72f

8 days agomkosi: update fedora commit reference to ea1d871ecd6c2fe063523840c1e4cf9bcf200e32...
Daan De Meyer [Thu, 30 Oct 2025 15:07:22 +0000 (16:07 +0100)] 
mkosi: update fedora commit reference to ea1d871ecd6c2fe063523840c1e4cf9bcf200e32 (#39483)

8 days agorun0: Add --empower
Daan De Meyer [Thu, 30 Oct 2025 11:28:19 +0000 (12:28 +0100)] 
run0: Add --empower

--empower gives full privileges to a non-root user. Currently this
includes all capabilities but we leave the option open to add more
privileges via this option in the future.

Why is this useful? When running privileged development or debugging
commands from your home directory (think bpftrace, strace and such),
you want any files written by these tools to be owned by your current
user, and not by the root user. run0 --empower will allow you to run
all privileged operations (assuming the tools check for capabilities
and not UIDs), while any files written by the tools will still be owned
by the current user.

8 days agopcrlock: don't lock PCR 12 by default
Lennart Poettering [Wed, 29 Oct 2025 15:43:31 +0000 (16:43 +0100)] 
pcrlock: don't lock PCR 12 by default

This creates a chicken-and-egg problem: we stuff the pcrlock policy into
a credential in the ESP, but credentials get measured into PCR 12, hence
PCR 12 is both input and output of the pcrlock logic, which makes
impossible to calculate.

Let's drop PCR 12 for now.

(We might want to pass the policy some other way one day, to avoid this,
but that's something for another day.)

Note that this still allows locking to PCR12 if people want to (for
example because they don't need this for the rootfs, and hence need no
cred passing via the ESP), this hence only changes the default, nothing
more.

Fixes: #33546