]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
14 months agopcrlock: be more careful when preparing credential name for pcrlock policy 34298/head
Lennart Poettering [Fri, 6 Sep 2024 16:32:17 +0000 (18:32 +0200)] 
pcrlock: be more careful when preparing credential name for pcrlock policy

The .cred suffix is stripped from a credential as it is imported from
the ESP, hence it should not be included in the credential name embedded
in the credential.

Fixes: #33497
14 months agoMerge pull request #34177 from poettering/pcrlock-and-signed
Lennart Poettering [Fri, 6 Sep 2024 16:11:22 +0000 (18:11 +0200)] 
Merge pull request #34177 from poettering/pcrlock-and-signed

cryptenroll/cryptsetup: support combined signed PCR + pcrlock policies

14 months agojournald: mention the access mode we tried to open /dev/kmsg in
Lennart Poettering [Fri, 6 Sep 2024 12:19:59 +0000 (14:19 +0200)] 
journald: mention the access mode we tried to open /dev/kmsg in

Let's make clearer what we are going to use /dev/kmsg for: read/write or just
writing. This hopefully should avoid confusion, such as the one #33975
is result of.

(Also while we are at it, add one extra debug message).

Fixes: #33975
14 months agoNEWS: extend the userdb sshd_config NEWS entry a bit
Lennart Poettering [Fri, 6 Sep 2024 12:39:15 +0000 (14:39 +0200)] 
NEWS: extend the userdb sshd_config NEWS entry a bit

14 months agotpm2-util: introduce tpm2b_sensitive_data_erase_and_esys_freep() destructor 34177/head
Lennart Poettering [Thu, 5 Sep 2024 16:29:26 +0000 (18:29 +0200)] 
tpm2-util: introduce tpm2b_sensitive_data_erase_and_esys_freep() destructor

Let's make sure we erase TPM2B_SENSITIVE_DATA structures reliably in all
code paths.

14 months agocryptenroll/cryptsetup: allow combined signed TPM2 PCR policy + pcrlock policy
Lennart Poettering [Thu, 29 Aug 2024 14:16:10 +0000 (16:16 +0200)] 
cryptenroll/cryptsetup: allow combined signed TPM2 PCR policy + pcrlock policy

So far you had to pick:

1. Use a signed PCR TPM2 policy to lock your disk to (i.e. UKI vendor
   blesses your setup via signature)
or
2. Use a pcrlock policy (i.e. local system blesses your setup via
   dynamic local policy stored in NV index)

It was not possible combine these two, because TPM2 access policies do
not allow the combination of PolicyAuthorize (used to implement #1
above) and PolicyAuthorizeNV (used to implement #2) in a single policy,
unless one is "further upstream" (and can simply remove the other from
the policy freely).

This is quite limiting of course, since we actually do want to enforce
on each TPM object that both the OS vendor policy and the local policy
must be fulfilled, without the chance for the vendor or the local system
to disable the other.

This patch addresses this: instead of trying to find a way to come up
with some adventurous scheme to combine both policy into one TPM2
policy, we simply shard the symmetric LUKS decryption key: one half we
protect via the signed PCR policy, and the other we protect via the
pcrlock policy. Only if both halves can be acquired the disk can be
decrypted.

This means:

1. we simply double the unlock key in length in case both policies shall
   be used.
2. We store two resulting TPM policy hashes in the LUKS token JSON, one
   for each policy
3. We store two sealed TPM policy key blobs in the LUKS token JSON, for
   both halves of the LUKS unlock key.

This patch keeps the "sharding" logic relatively generic (i.e. the low
level logic is actually fine with more than 2 shards), because I figure
sooner or later we might have to encode more shards, for example if we
add further TPM2-based access policies, for example when combining FIDO2
with TPM2, or implementing TOTP for this.

14 months agoiovec-util: add iovec_append() for appending to an existing iovec
Lennart Poettering [Thu, 29 Aug 2024 09:46:07 +0000 (11:46 +0200)] 
iovec-util: add iovec_append() for appending to an existing iovec

14 months agoMerge pull request #34291 from poettering/utmpx-all-the-way
Lennart Poettering [Fri, 6 Sep 2024 13:22:52 +0000 (15:22 +0200)] 
Merge pull request #34291 from poettering/utmpx-all-the-way

tree-wide: complete the switch to utmpx

14 months agoman: document that sd_bus_message_read_strv() happily spits out empty arrays as NULL
Lennart Poettering [Fri, 6 Sep 2024 09:30:23 +0000 (11:30 +0200)] 
man: document that sd_bus_message_read_strv() happily spits out empty arrays as NULL

Fixes: #34163
14 months agotree-wide: use UTMPX_FILE rather than _PATH_UTMPX 34291/head
Lennart Poettering [Fri, 6 Sep 2024 11:51:51 +0000 (13:51 +0200)] 
tree-wide: use UTMPX_FILE rather than _PATH_UTMPX

Apparently _PATH_UTMPX is a glibc'ism. UTMPX_FILE is the same thing and
what everyone else uses. Since they are otherwise equivalent, let's just
switch.

14 months agotest-utmp: replace UT_LINESIZE/UT_NAMESIZE/UT_HOSTSIZE with sizeof_field()
Lennart Poettering [Fri, 6 Sep 2024 11:22:32 +0000 (13:22 +0200)] 
test-utmp: replace UT_LINESIZE/UT_NAMESIZE/UT_HOSTSIZE with sizeof_field()

utmpx doesn't know these defines, hence fix them.

14 months agotree-wide: drop unnecessary utmp includes
Lennart Poettering [Fri, 6 Sep 2024 11:22:06 +0000 (13:22 +0200)] 
tree-wide: drop unnecessary utmp includes

14 months agouser-util: switch from utmp to utmpx
Lennart Poettering [Fri, 6 Sep 2024 11:20:11 +0000 (13:20 +0200)] 
user-util: switch from utmp to utmpx

We generally use utmpx instead of utmp (both are actually identical on
Linux, but utmpx is POSIX, while utmp is not). Let's fix one left-over
case.

UT_NAMESIZE does not exist in utmpx world, it has no direct counterpart,
hence let's just sizeof_field() to determine the size of the actual
field. (which comes to the same result of course: 32).

14 months agocoredump: set ProtectHome to read-only
Etienne Cordonnier [Fri, 6 Sep 2024 08:36:28 +0000 (10:36 +0200)] 
coredump: set ProtectHome to read-only

In https://github.com/systemd/systemd/pull/5283/commits/924453c22599cc246746a0233b2f52a27ade0819
ProtectHome was set to true for systemd-coredump in order to reduce risk, since an attacker could craft a malicious binary in order to compromise systemd-coredump.
At that point the object analysis was done in the main systemd-coredump process.
Because of this systemd-coredump is unable to product symbolicated call-stacks for binaries running under /home ("n/a" is shown instead of function names).

However, later in https://github.com/systemd/systemd/commit/61aea456c12c54f49c4a76259af130e576130ce9 systemd-coredump was changed to do the object analysis in a forked process,
covering those security concerns.

Let's set ProtectHome to read-only so that systemd-coredump produces symbolicated call-stacks for processes running under /home.

14 months agoMerge pull request #34279 from yuwata/ask-password
Lennart Poettering [Fri, 6 Sep 2024 11:30:15 +0000 (13:30 +0200)] 
Merge pull request #34279 from yuwata/ask-password

ask-password: refuse empty password strv

14 months agoMerge pull request #34285 from poettering/boot-measure-profile
Lennart Poettering [Fri, 6 Sep 2024 11:06:58 +0000 (13:06 +0200)] 
Merge pull request #34285 from poettering/boot-measure-profile

measure: introduce support for a new ".profile" section

14 months agopo: Translated using Weblate (French)
Léane GRASSER [Fri, 6 Sep 2024 09:38:46 +0000 (11:38 +0200)] 
po: Translated using Weblate (French)

Currently translated at 100.0% (253 of 253 strings)

Co-authored-by: Léane GRASSER <leane.grasser@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fr/
Translation: systemd/main

14 months agomeasure: introduce support for a new ".profile" section 34285/head
Lennart Poettering [Fri, 28 Jun 2024 17:48:32 +0000 (19:48 +0200)] 
measure: introduce support for a new ".profile" section

This introduces the concept, and makes sure systemd-measure covers it.
See a later commit for details on the new section.

14 months agouki: add new ".profile" PE section type
Lennart Poettering [Fri, 6 Sep 2024 09:12:35 +0000 (11:12 +0200)] 
uki: add new ".profile" PE section type

This is the most basic preparatory work for supporting multi-profile
UKIs.

(This temporarily drops an assert_cc() check which we'll address in the
next commit)

14 months agonetwork/route: ignore EEXIST reply when the corresponding request is already detached
Yu Watanabe [Thu, 5 Sep 2024 23:58:18 +0000 (08:58 +0900)] 
network/route: ignore EEXIST reply when the corresponding request is already detached

Follow-ups for db8dc7c1dd7f4620e14fbc4c1560a68a1fc9b85b.
Fixes #34275.

14 months agoMerge pull request #34278 from yuwata/timesync-log
Daan De Meyer [Fri, 6 Sep 2024 06:09:56 +0000 (08:09 +0200)] 
Merge pull request #34278 from yuwata/timesync-log

timesync: downgrade log level for several messages

14 months agoMerge pull request #34280 from yuwata/cleanups
Daan De Meyer [Fri, 6 Sep 2024 06:08:56 +0000 (08:08 +0200)] 
Merge pull request #34280 from yuwata/cleanups

tree-wide: trivial cleanups

14 months agotree-wide: check if non-empty password is acquired 34279/head
Yu Watanabe [Fri, 6 Sep 2024 06:00:32 +0000 (15:00 +0900)] 
tree-wide: check if non-empty password is acquired

14 months agoask-password: refuse empty password strv
Yu Watanabe [Fri, 6 Sep 2024 02:19:39 +0000 (11:19 +0900)] 
ask-password: refuse empty password strv

Fixes #34270.

14 months agosd-netlink: fix typo
Yu Watanabe [Fri, 6 Sep 2024 00:16:58 +0000 (09:16 +0900)] 
sd-netlink: fix typo

Fixes #34273.

14 months agonspawn: refuse to bind mount device node from host when --private-users= is specified
Yu Watanabe [Thu, 5 Sep 2024 06:05:32 +0000 (15:05 +0900)] 
nspawn: refuse to bind mount device node from host when --private-users= is specified

Also do not chown if a device node is bind-mounted.

Fixes #34243.

14 months agotest: fix copy-and-paste error in comment 34280/head
Yu Watanabe [Fri, 6 Sep 2024 03:39:58 +0000 (12:39 +0900)] 
test: fix copy-and-paste error in comment

14 months agonspawn: fix indentation
Yu Watanabe [Fri, 6 Sep 2024 04:10:04 +0000 (13:10 +0900)] 
nspawn: fix indentation

14 months agobase-filesystem: use FOREACH_ELEMENT()
Yu Watanabe [Thu, 5 Sep 2024 10:37:52 +0000 (19:37 +0900)] 
base-filesystem: use FOREACH_ELEMENT()

14 months agomount-util: wrap long line
Yu Watanabe [Thu, 5 Sep 2024 04:54:31 +0000 (13:54 +0900)] 
mount-util: wrap long line

14 months agoMerge pull request #34203 from yuwata/network-conf-parser
Yu Watanabe [Fri, 6 Sep 2024 04:07:39 +0000 (13:07 +0900)] 
Merge pull request #34203 from yuwata/network-conf-parser

network: several cleanups for conf parser

14 months agoMerge pull request #34267 from DaanDeMeyer/script
Yu Watanabe [Fri, 6 Sep 2024 01:43:04 +0000 (10:43 +0900)] 
Merge pull request #34267 from DaanDeMeyer/script

mkosi: Install util-linux-script on Rawhide

14 months agonetwork/address: use log_section_warning() 34203/head
Yu Watanabe [Sun, 1 Sep 2024 12:08:57 +0000 (21:08 +0900)] 
network/address: use log_section_warning()

14 months agonetwork/address: use generic section parser more
Yu Watanabe [Fri, 6 Sep 2024 01:38:15 +0000 (10:38 +0900)] 
network/address: use generic section parser more

This also
- rename variable n -> address,
- use log_syntax_parse_error() where applicable,
- add one more assertion for lvalue in config_parse_address().

14 months agonetwork/address: introduce generic config parser for [Address] section
Yu Watanabe [Wed, 28 Aug 2024 05:01:36 +0000 (14:01 +0900)] 
network/address: introduce generic config parser for [Address] section

Then, use generic conf parsers defined in conf-parser.[ch].

14 months agofirewall-util: several cleanups for config_parse_nft_set()
Yu Watanabe [Sun, 1 Sep 2024 12:37:33 +0000 (21:37 +0900)] 
firewall-util: several cleanups for config_parse_nft_set()

- use log_syntax_parse_error(),
- return 1 on success,
- drop unnecessary or redundant assertions,
- add missing log_oom().

14 months agoconf-parser: introduce config_parse_uint32_invert_flag()
Yu Watanabe [Wed, 28 Aug 2024 04:11:43 +0000 (13:11 +0900)] 
conf-parser: introduce config_parse_uint32_invert_flag()

It is similar to config_parse_uint32_flag(), but drops the specified flag
when true.

14 months agonetwork: align table in network-gperf
Yu Watanabe [Sat, 31 Aug 2024 05:45:22 +0000 (14:45 +0900)] 
network: align table in network-gperf

14 months agonetwork/address-label: use log_section_warning_errno()
Yu Watanabe [Sun, 1 Sep 2024 12:01:40 +0000 (21:01 +0900)] 
network/address-label: use log_section_warning_errno()

14 months agonetwork/address-label: introduce generic conf parser for [IPv6AddressLabel] section
Yu Watanabe [Wed, 28 Aug 2024 04:57:05 +0000 (13:57 +0900)] 
network/address-label: introduce generic conf parser for [IPv6AddressLabel] section

This also
- renames n -> label,
- use log_syntax_parse_error().

No functional change, just refactoring.

14 months agoconf-parser: introduce config section parser wrapper
Yu Watanabe [Wed, 28 Aug 2024 02:57:34 +0000 (11:57 +0900)] 
conf-parser: introduce config section parser wrapper

It will be used later.

14 months agohwdb: Mark Apple Wireless keyboards as not having NumLock LED
Bastien Nocera [Thu, 5 Sep 2024 13:09:58 +0000 (15:09 +0200)] 
hwdb: Mark Apple Wireless keyboards as not having NumLock LED

Mark those Apple Wireless keyboards as not having a NumLock key:
https://en.wikipedia.org/wiki/Apple_Wireless_Keyboard

You can see that they don't have a NumLock LED because they didn't even
have a NumLock in the first place:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0fea6fe7d5ef1b5fa5f78048d4729f85181c04ca

14 months agotimesync: make manager_is_connected() static 34278/head
Yu Watanabe [Fri, 6 Sep 2024 01:20:21 +0000 (10:20 +0900)] 
timesync: make manager_is_connected() static

14 months agotimesync: downgrade log level about network configuration change
Yu Watanabe [Thu, 5 Sep 2024 11:08:24 +0000 (20:08 +0900)] 
timesync: downgrade log level about network configuration change

These message may be unnecessarily shown multiple times when e.g.
networkd is restarted, system is wakeup from suspend, and so on.

Closes #34262.

14 months agoMerge pull request #34155 from poettering/gmtime-safe
Yu Watanabe [Fri, 6 Sep 2024 00:07:48 +0000 (09:07 +0900)] 
Merge pull request #34155 from poettering/gmtime-safe

handle gmtime_r() errors more robustly

14 months agobasic: Include <sys/file.h> for LOCK_* constants
A. Wilcox [Wed, 21 Aug 2024 12:21:46 +0000 (07:21 -0500)] 
basic: Include <sys/file.h> for LOCK_* constants

This is needed to ensure LOCK_{EX,SH} are defined in certain
environments, including uclibc-ng and musl libc.

14 months agoMerge pull request #34261 from yuwata/repart-seed-random
Yu Watanabe [Thu, 5 Sep 2024 23:30:12 +0000 (08:30 +0900)] 
Merge pull request #34261 from yuwata/repart-seed-random

repart: initialize seed earlier

14 months agoedit-util: EditFileContext: avoid reserved 'stdin'
A. Wilcox [Wed, 21 Aug 2024 13:51:08 +0000 (08:51 -0500)] 
edit-util: EditFileContext: avoid reserved 'stdin'

The identifier 'stdin' is reserved in C.  It can be #defined to any
statement that evaluates to a FILE*.  We do not want that for our field,
so change to a more descriptive name.

14 months agoudev: allow persistent storage rules for rbd devices
Peter Rajnoha [Thu, 5 Sep 2024 10:31:20 +0000 (12:31 +0200)] 
udev: allow persistent storage rules for rbd devices

The RADOS Block Device (rbd) can be used as any other block device with
further layers on top of it, hence allow the common persistent storage
rules to apply, including watching for changes.

14 months agomkosi: Remove rpm workaround 34267/head
Daan De Meyer [Thu, 5 Sep 2024 16:45:52 +0000 (18:45 +0200)] 
mkosi: Remove rpm workaround

rpm 4.19.93 (4.20 rc) is in rawhide so let's drop the workaround.

14 months agomkosi: Install util-linux-script on Rawhide
Daan De Meyer [Thu, 5 Sep 2024 16:38:33 +0000 (18:38 +0200)] 
mkosi: Install util-linux-script on Rawhide

It's now subpackaged so we can build images without pulling in
libutempter but we use script in the testsuite so let's install the
subpackage.

14 months agoMerge pull request #34266 from DaanDeMeyer/fix
Daan De Meyer [Thu, 5 Sep 2024 16:36:44 +0000 (18:36 +0200)] 
Merge pull request #34266 from DaanDeMeyer/fix

mkfs-util: Make sure we pass non option arguments last

14 months agotime-util: rework localtime_or_gmtime() into localtime_or_gmtime_usec() 34155/head
Lennart Poettering [Wed, 28 Aug 2024 12:10:01 +0000 (14:10 +0200)] 
time-util: rework localtime_or_gmtime() into localtime_or_gmtime_usec()

We typically want to deal in usec_t, hence let's change the prototype
accordingly, and do proper range checks. Also, make sure are not
confused by negative times.

Do something similar for mktime_or_timegm().

This is a more comprehensive alternative to #34065

Replaces: #34065

14 months agohwclock-util: the struct tm parameter is not a pure return parameter, it's also an...
Lennart Poettering [Wed, 28 Aug 2024 12:13:42 +0000 (14:13 +0200)] 
hwclock-util: the struct tm parameter is not a pure return parameter, it's also an input parameter

14 months agoMerge pull request #34256 from YHNdnzj/pid1-followup
Lennart Poettering [Thu, 5 Sep 2024 15:01:10 +0000 (17:01 +0200)] 
Merge pull request #34256 from YHNdnzj/pid1-followup

core: follow-ups for recent PRs

14 months agomkfs-util: Make sure we pass non option arguments last 34266/head
Daan De Meyer [Thu, 5 Sep 2024 14:09:22 +0000 (16:09 +0200)] 
mkfs-util: Make sure we pass non option arguments last

POSIX specifies that getopt() stops parsing options when it encounters
a non-option argument, so let's make sure we pass non-option arguments
last.

14 months agomkfs-util: Fix error handling
Daan De Meyer [Thu, 5 Sep 2024 14:08:00 +0000 (16:08 +0200)] 
mkfs-util: Fix error handling

14 months agoupdate TODO
Lennart Poettering [Thu, 5 Sep 2024 13:56:13 +0000 (15:56 +0200)] 
update TODO

14 months agotest: fix indentation 34261/head
Yu Watanabe [Thu, 5 Sep 2024 08:57:24 +0000 (17:57 +0900)] 
test: fix indentation

14 months agotest: add test case for systemd-repart --seed=random
Yu Watanabe [Thu, 5 Sep 2024 08:58:29 +0000 (17:58 +0900)] 
test: add test case for systemd-repart --seed=random

For issue #34257.

14 months agoMerge pull request #34235 from yuwata/firstboot-systemctl-trivial-cleanups
Lennart Poettering [Thu, 5 Sep 2024 07:22:54 +0000 (09:22 +0200)] 
Merge pull request #34235 from yuwata/firstboot-systemctl-trivial-cleanups

firstboot,systemctl: trivial cleanups

14 months agorepart: initialize seed earlier
Yu Watanabe [Thu, 5 Sep 2024 06:49:09 +0000 (15:49 +0900)] 
repart: initialize seed earlier

As the seed is used by context_load_partition_table() -> derive_uuid().

Fixes #34257.

14 months agoman: ARP=no also disables IPv6 Neighbor Discovery Protocol
Yu Watanabe [Mon, 2 Sep 2024 01:52:54 +0000 (10:52 +0900)] 
man: ARP=no also disables IPv6 Neighbor Discovery Protocol

Addresses https://github.com/systemd/systemd/issues/18063#issuecomment-2323410288.

14 months agoMerge pull request #34090 from DaanDeMeyer/cow-fix
Yu Watanabe [Thu, 5 Sep 2024 01:19:49 +0000 (10:19 +0900)] 
Merge pull request #34090 from DaanDeMeyer/cow-fix

Rework COW <=> NOCOW copying behavior

14 months agofirstboot: reduce log level of timezone validation 34235/head
Michael Ferrari [Thu, 6 Jun 2024 14:06:34 +0000 (16:06 +0200)] 
firstboot: reduce log level of timezone validation

An error message is already printed directly after, so the user already
knows that the validation failed. This also isn't done for the other
validation functions.

14 months agofirstboot: reduce empty input log level
Michael Ferrari [Wed, 5 Jun 2024 17:40:57 +0000 (19:40 +0200)] 
firstboot: reduce empty input log level

The user knows they pressed `Enter`, no need to inform them again about
that they skipped the prompt.

14 months agofirstboot: add newline before key wait
Michael Ferrari [Wed, 5 Jun 2024 17:33:19 +0000 (19:33 +0200)] 
firstboot: add newline before key wait

When sd-firstboot is ran during first boot of a new system this missing
newline leads to a bootup message being appended on the same line as the
message instructing to press a key.

14 months agotest: add test cases of "systemctl cat" for nonexistent units
Yu Watanabe [Tue, 3 Sep 2024 02:46:45 +0000 (11:46 +0900)] 
test: add test cases of "systemctl cat" for nonexistent units

14 months agosystemctl: cat: do not exit(1) on missing units if `--force`
Ivan Shapovalov [Wed, 17 Jul 2024 08:50:27 +0000 (10:50 +0200)] 
systemctl: cat: do not exit(1) on missing units if `--force`

We are eating the error message if `--force` is set, so do not return
a non-zero exit code either.

14 months agoMerge pull request #34212 from YHNdnzj/recvmsg-safe-trunc
Yu Watanabe [Wed, 4 Sep 2024 22:22:28 +0000 (07:22 +0900)] 
Merge pull request #34212 from YHNdnzj/recvmsg-safe-trunc

tree-wide: handle MSG_TRUNC with recvmsg_safe()

14 months agocore: rename BindJournalSockets= to BindLogSockets= 34256/head
Mike Yuan [Wed, 4 Sep 2024 13:06:39 +0000 (15:06 +0200)] 
core: rename BindJournalSockets= to BindLogSockets=

Addresses https://github.com/systemd/systemd/pull/32487#issuecomment-2328465309

14 months agocore/namespace: add comment to explain the non-obvious assumption on /run/systemd...
Mike Yuan [Wed, 4 Sep 2024 16:16:51 +0000 (18:16 +0200)] 
core/namespace: add comment to explain the non-obvious assumption on /run/systemd/journal/

Follow-up for 119820f8abf587f96a11fb1f28ef854e84bc3122

Addresses https://github.com/systemd/systemd/pull/32487#discussion_r1743493196

14 months agocore/namespace: make bind mounted journal sockets nosuid + noexec + nodev
Mike Yuan [Wed, 4 Sep 2024 13:36:52 +0000 (15:36 +0200)] 
core/namespace: make bind mounted journal sockets nosuid + noexec + nodev

Addresses https://github.com/systemd/systemd/pull/32487#discussion_r1743464797

14 months agocore/exec-invoke: use bind_mount_add() where appropriate
Mike Yuan [Wed, 4 Sep 2024 13:28:45 +0000 (15:28 +0200)] 
core/exec-invoke: use bind_mount_add() where appropriate

14 months agocore/namespace: use GREEDY_REALLOC at one more place
Mike Yuan [Wed, 4 Sep 2024 13:21:25 +0000 (15:21 +0200)] 
core/namespace: use GREEDY_REALLOC at one more place

14 months agocore/unit: introduce unit_set_debug_invocation()
Mike Yuan [Wed, 28 Aug 2024 17:46:22 +0000 (19:46 +0200)] 
core/unit: introduce unit_set_debug_invocation()

Given that debug_invocation is a Unit thing, make
service_set_debug_invocation() generic. Plus, don't
say "Service failed", as it would be spurious when
Restart=always.

14 months agocore: add missing serialization for Unit.debug_invocation
Mike Yuan [Tue, 3 Sep 2024 20:52:40 +0000 (22:52 +0200)] 
core: add missing serialization for Unit.debug_invocation

Follow-up for 7d8bbfbe0852ec89590d1dc5e28afc95d6d44fa1

14 months agocore/service: modernize service_load_pid_file() a bit
Mike Yuan [Fri, 30 Aug 2024 20:54:14 +0000 (22:54 +0200)] 
core/service: modernize service_load_pid_file() a bit

14 months agocore/service: minor coding style tweak
Mike Yuan [Mon, 26 Aug 2024 20:29:15 +0000 (22:29 +0200)] 
core/service: minor coding style tweak

14 months agocopy: Introduce COPY_NOCOW_AFTER and use it when copying images 34090/head
Daan De Meyer [Fri, 23 Aug 2024 11:40:40 +0000 (13:40 +0200)] 
copy: Introduce COPY_NOCOW_AFTER and use it when copying images

When dealing with copying COW images, we have to make a tradeoff:

- Either we don't touch the NOCOW bit on the copied file COW and get
  an instant copy because we're able to reflink, but we might get
  reduced performance if the source file was COW as COW files and lots
  of random writes don't play well together.
- Or we force NOCOW for the copied file, which means we have to do a
  full copy as reflinking from COW files to NOCOW files or vice versa
  is not supported.

In exec-invoke.c, we've opted for the first option. In nspawn.c and
discover-image.c, we've opted for the second option.

In nspawn, this applies to the --ephemeral option to make ephemeral
copies. In discover-image.c, this applies to cloning images into
/var/lib/machines. Both these features might be used to run many
machines of the same original image. We really don't want to force
a full copy onto users in these scenarios when they're expecting
reflink behavior, leading to them running out of disk space. Instead,
degraded performance in their machines is a much less severe issue,
which they will discover on their own if it affects them, at which
point they can make their original image NOCOW at which point they'll
get both the reflinks and better performance.

Given the above reasoning, let's switch nspawn.c and discover-image.c
to use COPY_NOCOW_AFTER as well instead of enabling NOCOW upfront and
forcing a copy if the original source image is COW.

14 months agocopy: Copy nocow flag by default
Daan De Meyer [Fri, 23 Aug 2024 11:04:33 +0000 (13:04 +0200)] 
copy: Copy nocow flag by default

Unless otherwise requested, if we're going to copy a nocow file, make the
target file nocow as well.

Aside from keeping the performance characteristics of the cow or nocow file
intact, reflinking also only works from cow to cow or nocow to nocow files.
Reflinking from cow to nocow or nocow to cow files does not work and can
easily lead to unexpected copies for users, so by keeping the nocow bit
intact across copies by default we also make sure reflinks always work.

14 months agochattr-util: Optimize read_attr_at()
Daan De Meyer [Mon, 26 Aug 2024 12:14:07 +0000 (14:14 +0200)] 
chattr-util: Optimize read_attr_at()

Let's make sure we only reopen O_PATH file descriptors.

14 months agosocket-util: make recvmsg_safe() handle MSG_TRUNC too 34212/head
Mike Yuan [Fri, 30 Aug 2024 22:17:13 +0000 (00:17 +0200)] 
socket-util: make recvmsg_safe() handle MSG_TRUNC too

Also, unify MSG_TRUNC handling all across the codebase.

14 months agomachine-dbus: use in_same_namespace() at one more place
Mike Yuan [Sat, 31 Aug 2024 15:16:47 +0000 (17:16 +0200)] 
machine-dbus: use in_same_namespace() at one more place

14 months agoudev-ctrl: drop unused next_datagram_size_fd() call
Mike Yuan [Sat, 31 Aug 2024 13:37:36 +0000 (15:37 +0200)] 
udev-ctrl: drop unused next_datagram_size_fd() call

14 months agocore/manager: close all cmsg fds where none is expected
Mike Yuan [Mon, 2 Sep 2024 21:43:53 +0000 (23:43 +0200)] 
core/manager: close all cmsg fds where none is expected

14 months agoudev-ctrl: add missing size check of received message
Mike Yuan [Mon, 2 Sep 2024 14:24:10 +0000 (16:24 +0200)] 
udev-ctrl: add missing size check of received message

While at it, downgrade log level of ignored errors to LOG_WARNING.

14 months agoaudit-util: check correct errno
Mike Yuan [Sat, 31 Aug 2024 13:42:43 +0000 (15:42 +0200)] 
audit-util: check correct errno

14 months agosd-varlink: check correct errno
Mike Yuan [Sat, 31 Aug 2024 13:35:45 +0000 (15:35 +0200)] 
sd-varlink: check correct errno

'n' can also be assigned from recvmsg_safe(), which is our own
func returning negative errno.

14 months agofd-util: also close pidfd from SCM_PIDFD in cmsg_close_all()
Mike Yuan [Fri, 30 Aug 2024 21:47:48 +0000 (23:47 +0200)] 
fd-util: also close pidfd from SCM_PIDFD in cmsg_close_all()

14 months agoRevert "copy: Copy file attributes as well"
Daan De Meyer [Fri, 23 Aug 2024 10:24:16 +0000 (12:24 +0200)] 
Revert "copy: Copy file attributes as well"

This reverts commit 2356104efcc599439c887b087da83fbeca1fa9a6.

14 months agoRevert "tree-wide: Don't explicity disable copy-on-write when copying images"
Daan De Meyer [Thu, 22 Aug 2024 15:23:58 +0000 (17:23 +0200)] 
Revert "tree-wide: Don't explicity disable copy-on-write when copying images"

Let's still try to disable COW after copying. It won't do much, but
it doesn't hurt either.

See https://github.com/systemd/systemd/pull/33825/files#r1727288871.

This reverts commit 42e9288180ce37abd86c58774950636ebce35432.

14 months agoMerge pull request #34251 from DaanDeMeyer/multiq
Daan De Meyer [Wed, 4 Sep 2024 14:03:32 +0000 (16:03 +0200)] 
Merge pull request #34251 from DaanDeMeyer/multiq

network: Add support for multiq qdisc

14 months agonetwork: Add support for mq qdisc 34251/head
Daan De Meyer [Wed, 4 Sep 2024 11:32:32 +0000 (13:32 +0200)] 
network: Add support for mq qdisc

14 months agonetwork: Add support for multiq qdisc
Daan De Meyer [Wed, 4 Sep 2024 10:19:49 +0000 (12:19 +0200)] 
network: Add support for multiq qdisc

14 months agoMerge pull request #34205 from yuwata/pretty-print-buffering
Mike Yuan [Wed, 4 Sep 2024 12:34:21 +0000 (14:34 +0200)] 
Merge pull request #34205 from yuwata/pretty-print-buffering

pretty-print: introduce WITH_BUFFERED_STDERR macro to enable buffering

14 months agoMerge pull request #34224 from yuwata/network-make-qdisc-reconfigurable
Daan De Meyer [Wed, 4 Sep 2024 10:07:16 +0000 (12:07 +0200)] 
Merge pull request #34224 from yuwata/network-make-qdisc-reconfigurable

network: make qdisc reconfigurable

14 months agoMerge pull request #32487 from YHNdnzj/bind-journal-sockets
Daan De Meyer [Wed, 4 Sep 2024 07:26:58 +0000 (09:26 +0200)] 
Merge pull request #32487 from YHNdnzj/bind-journal-sockets

core: introduce BindJournalSockets=

14 months agobuild(deps): bump softprops/action-gh-release from 2.0.5 to 2.0.8
dependabot[bot] [Sun, 1 Sep 2024 09:10:21 +0000 (09:10 +0000)] 
build(deps): bump softprops/action-gh-release from 2.0.5 to 2.0.8

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.5 to 2.0.8.
- [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/69320dbe05506a9a39fc8ae11030b214ec2d1f87...c062e08bd532815e2082a85e87e3ef29c3e6d191)

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

Signed-off-by: dependabot[bot] <support@github.com>
14 months agobuild(deps): bump super-linter/super-linter from 6.6.0 to 7.1.0
dependabot[bot] [Sun, 1 Sep 2024 09:10:23 +0000 (09:10 +0000)] 
build(deps): bump super-linter/super-linter from 6.6.0 to 7.1.0

Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 6.6.0 to 7.1.0.
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/88ea3923a7e1f89dd485d079f6eb5f5e8f937589...b92721f792f381cedc002ecdbb9847a15ece5bb8)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>