]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
20 months agoshared/conf-parser: add two more annotations 30480/head
Zbigniew Jędrzejewski-Szmek [Thu, 7 Mar 2024 17:47:31 +0000 (18:47 +0100)] 
shared/conf-parser: add two more annotations

20 months agobootctl: use the full parser too
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2024 22:44:09 +0000 (23:44 +0100)] 
bootctl: use the full parser too

20 months agokernel-install: support full set of config files and drop-ins
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2024 12:41:57 +0000 (13:41 +0100)] 
kernel-install: support full set of config files and drop-ins

This brings the handling of config for kernel-install in line with most of
systemd, i.e. we search the set of paths for the main config file, and the full
set of drop-in paths for drop-ins.

This mirrors what 07f5e35fe7967c824a87f18a3a1d3c22e5be70f5 did for udev.conf.
That change worked out fine, so I hope this one will too.

The update in the man page is minimal. I think we should split out a separate
page for the config file later on.

One motivating use case is to allow a drop-in to be created for temporary
config overrides and then removed after the operation is done.

20 months agoman: document all the new paths
Zbigniew Jędrzejewski-Szmek [Thu, 22 Feb 2024 09:58:48 +0000 (10:58 +0100)] 
man: document all the new paths

20 months agovarious: use new config loader instead of config_parse_config_file()
Zbigniew Jędrzejewski-Szmek [Thu, 22 Feb 2024 09:50:05 +0000 (10:50 +0100)] 
various: use new config loader instead of config_parse_config_file()

This means the main config file is loaded also from /run and /usr.

We should load the main config file from all the places where we load drop-ins.

I realize I had a giant blind spot: I always assumed that we load config files
from /etc, /run, /usr/local/lib, /usr/lib. But it turns out that we only used
those paths for drop-ins. For the main config file, we only looked in /etc. The
docs actually partially described this behaviour, i.e. most SYNOPSIS sections
and some parts of the text, but not others.

This is strange, because 6495361c7d5e8bf640841d1292ef6cfe1ea244cf was completely
bogus with the behaviour before this patch. We had a huge discussion before it
was merged, and clearly nobody noticed this. Similarly, in the previous version
of the current pull request, we had a long discussion about the appropriate
order of directories, and apparently nobody noticed that there was no order,
because only looked in one directory. So the blind spot seems to have been
shared.

Also, systemd-analyze cat-config behaved incorrectly, i.e. its behaviour matches
the new behaviour.

Possibly, in the future it'll make it easier to add support for --root.

20 months agoshared/conf-parser: add function which implements the standard config file set
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2024 21:31:41 +0000 (22:31 +0100)] 
shared/conf-parser: add function which implements the standard config file set

Also allow config_parse_many() to be called for config files without
sections. The test uses such a file.

20 months agoshared/conf-parser: use chase() in config_parse_many_files()
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2024 21:29:56 +0000 (22:29 +0100)] 
shared/conf-parser: use chase() in config_parse_many_files()

The function was partially implementing chroot lookups. It would be given
file names that were prefixed with the chroot, so it would mostly work.
But if any of those files were symlinks, fopen() would do the wrong thing.

Also we don't need locking.

So give 'root' as the argument and use chase_and_fopen_unlocked() to get
proper chroot-aware lookups.

The only place where config_parse_many() is called with root is is repart.c.
So this is a follow-up for e594a3b154bd06c535a934a1cc7231b1ef76df73 and
34f2fd5096cdb26ef57998740b1b876332d968fc.

20 months agostrv: add helper to extend strv from both sides
Zbigniew Jędrzejewski-Szmek [Thu, 22 Feb 2024 09:47:23 +0000 (10:47 +0100)] 
strv: add helper to extend strv from both sides

Also, use the more correct type of 'const char* const*' for the input strv.
This requires adding the cast in a few places, but also allows to remove some
casts in others.

20 months agoudevd: inline iterator variable
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2024 13:09:52 +0000 (14:09 +0100)] 
udevd: inline iterator variable

20 months agoudev,backlight,kernel-install: reword sentences starting with "Skipping to"
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2024 11:38:27 +0000 (12:38 +0100)] 
udev,backlight,kernel-install: reword sentences starting with "Skipping to"

That's not gramatically correct.

In backlight, change "assocation" to "deduplication". Without the context,
it's probably not clear at all that we "associate" them to ignore them.

20 months agoshared/pretty-print: rename output parameters
Zbigniew Jędrzejewski-Szmek [Thu, 22 Feb 2024 09:36:52 +0000 (10:36 +0100)] 
shared/pretty-print: rename output parameters

20 months agoshared/conf-parser: collapse pkgdir and conf_file args into one
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jan 2024 17:30:43 +0000 (18:30 +0100)] 
shared/conf-parser: collapse pkgdir and conf_file args into one

This essentially reverts 5656cdfeeabc16b5489f5ec7a0a36025a2ec1f23. I find it
much easier to understand what is going on when the
path-relative-to-the-search-path is passed in full, instead of being constructed
from two parts, with one of the parts being implicit in some places.

Also, we call 'systemd-analyze cat-config <path>' with <path> with the same
meaning, so this makes the internal and external APIs more consistent.

20 months agoconstants: drop duplicated CONF_PATHS defines
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2023 09:52:34 +0000 (10:52 +0100)] 
constants: drop duplicated CONF_PATHS defines

Follow-up for b0d3095fd6cc1791a38f57a1982116b4475244ba.

20 months agovarious: use modern strv helpers
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2023 09:41:13 +0000 (10:41 +0100)] 
various: use modern strv helpers

If we're building a strv, let's just use strv_new() with the CONF_PATHS macro,
which gives as an exploded string set.

20 months agodocs: show mkosi project on website
hulkoba [Wed, 24 Jan 2024 11:13:12 +0000 (12:13 +0100)] 
docs: show mkosi project on website

20 months agoMerge pull request #31426 from YHNdnzj/logind-minor-cleanup
Luca Boccassi [Wed, 21 Feb 2024 11:35:34 +0000 (11:35 +0000)] 
Merge pull request #31426 from YHNdnzj/logind-minor-cleanup

logind: some cleanups

20 months agonetworkd: support setting dhcp server port
Martin Ivicic [Wed, 21 Feb 2024 01:07:26 +0000 (02:07 +0100)] 
networkd: support setting dhcp server port

20 months agonetwork: DHCP6 Allow to export DHCP6 DUID (#31355)
Susant Sahani [Wed, 21 Feb 2024 10:32:27 +0000 (16:02 +0530)] 
network: DHCP6 Allow to export DHCP6 DUID (#31355)

We did not support the export of DHCP6 DUID. Let's add this. Some
applications may use it.

20 months agocryptsetup-tokens: fix typo in comments
Antonio Alvarez Feijoo [Wed, 21 Feb 2024 10:08:18 +0000 (11:08 +0100)] 
cryptsetup-tokens: fix typo in comments

20 months agohomectl: make sure we sent the full 8 bytes as flags
Frantisek Sumsal [Tue, 20 Feb 2024 21:38:42 +0000 (22:38 +0100)] 
homectl: make sure we sent the full 8 bytes as flags

Otherwise weird stuff happens on the other side:

[1217111.957263] testsuite-46.sh[61]: + homectl create test-user --disk-size=min --luks-discard=yes --image-path=/home/test-user.home --luks-pbkdf-type=pbkdf2 --luks-pbkdf-time-cost=1ms
[1217112.598219] homectl[66]: Operation on home test-user failed: Provided flags are unsupported (0ad2578000000000).

(taken from TEST-46-HOME run on armv7l)

Fixes issue mentioned in https://github.com/systemd/systemd/pull/31419#issuecomment-1955117397.

20 months agologind-dbus: clean up manager_{start,stop,kill}_unit 31426/head
Mike Yuan [Tue, 20 Feb 2024 15:39:27 +0000 (23:39 +0800)] 
logind-dbus: clean up manager_{start,stop,kill}_unit

20 months agologind-dbus: rearrange functions
Mike Yuan [Tue, 20 Feb 2024 09:49:12 +0000 (17:49 +0800)] 
logind-dbus: rearrange functions

20 months agologind-session-dbus: drop unneeded unref_and_replace
Mike Yuan [Tue, 20 Feb 2024 10:03:14 +0000 (18:03 +0800)] 
logind-session-dbus: drop unneeded unref_and_replace

If there's pending s->upgrade_message, we already return early
above.

20 months agoMerge pull request #31405 from yuwata/network-ndisc-reachable-time
Yu Watanabe [Wed, 21 Feb 2024 05:29:01 +0000 (14:29 +0900)] 
Merge pull request #31405 from yuwata/network-ndisc-reachable-time

network/ndisc: set neighbor reachable time

20 months agoMerge pull request #31419 from AdrianVovk/fixup-largefile-define
Mike Yuan [Wed, 21 Feb 2024 05:12:30 +0000 (13:12 +0800)] 
Merge pull request #31419 from AdrianVovk/fixup-largefile-define

Fixup largefile define

20 months agoMerge pull request #31408 from mrc0mmand/verify-unit-files-v2
Yu Watanabe [Wed, 21 Feb 2024 03:01:48 +0000 (12:01 +0900)] 
Merge pull request #31408 from mrc0mmand/verify-unit-files-v2

test: verify our own units (where applicable)

20 months agoMerge pull request #31400 from poettering/askpw-rework
Luca Boccassi [Tue, 20 Feb 2024 23:45:52 +0000 (23:45 +0000)] 
Merge pull request #31400 from poettering/askpw-rework

Password Asking rework

20 months agofd-util: Add helpers to check if FD flags are safe 31419/head
Adrian Vovk [Tue, 20 Feb 2024 19:54:21 +0000 (14:54 -0500)] 
fd-util: Add helpers to check if FD flags are safe

Adds a SAFE_FD_FLAGS define to list out all the safe FD flags, and also
an UNSAFE_FD_FLAGS() macro to strip out the safe flags and leave only
the unsafe flags. This can be used to quickly check if any unsafe flags
are set and print them for diagnostic purposes

20 months agomissing_fcntl: Fix RAW_O_LARGEFILE
Adrian Vovk [Tue, 20 Feb 2024 19:24:01 +0000 (14:24 -0500)] 
missing_fcntl: Fix RAW_O_LARGEFILE

This value is actually arch-specific, so this commit defines it for all
the arches that set it to some custom value

Fixes https://github.com/systemd/systemd/issues/31417

20 months agoanalyze: always recommend saving the output to a file
Zbigniew Jędrzejewski-Szmek [Tue, 20 Feb 2024 17:14:53 +0000 (18:14 +0100)] 
analyze: always recommend saving the output to a file

The command will refuse to write to a TTY, so give a strong hint
that redirecting to a file is recommended. This makes the synopsis,
man page text, and --help output consistent.

Also drop the space after the redirection operator everywhere.

20 months agocryptsetup: drop "headless" bool, make it a flag in AskPasswordFlags instead 31400/head
Lennart Poettering [Mon, 19 Feb 2024 17:45:49 +0000 (18:45 +0100)] 
cryptsetup: drop "headless" bool, make it a flag in AskPasswordFlags instead

This bool controls whether we should interactively ask for a password,
which is pretty much what the ask_password-api.c APIs are about. Hence,
just make the bool a flag in AskPasswordFlags enum, and use it
everywhere.

This still catches the flag early in upper levels of the codebase,
exactly as before, but if the flag is still present in the lower layers
it's also handled there and results in ENOEXEC if seen.

This is mostly an excercise in simplifying our ridiculously long
function call parameter lists a bit.

20 months agoman: tweak cryptsetup credentials docs a bit
Lennart Poettering [Mon, 19 Feb 2024 17:21:31 +0000 (18:21 +0100)] 
man: tweak cryptsetup credentials docs a bit

Let's bring the credentials into a better order, in order of relevance.

Also, let's clarify what the generic LUKS PIN is about.

Finally, list the credentials in system-credentials(7) too, after all
people might want to unlock a disk with this via SMBIOS Type 11 or so.

20 months agoman: now that the crdentials used by systemd-cryptenroll are in order, document them
Lennart Poettering [Mon, 19 Feb 2024 17:22:49 +0000 (18:22 +0100)] 
man: now that the crdentials used by systemd-cryptenroll are in order, document them

Replaces: #31370

20 months agocryptsetup-pkcs11: also plug credential name to use to credential plugin
Lennart Poettering [Mon, 19 Feb 2024 17:16:47 +0000 (18:16 +0100)] 
cryptsetup-pkcs11: also plug credential name to use to credential plugin

20 months agocryptenroll,cryptsetup: clean up unlock credential for TPM2 + FIDO2
Lennart Poettering [Mon, 19 Feb 2024 17:06:34 +0000 (18:06 +0100)] 
cryptenroll,cryptsetup: clean up unlock credential for TPM2 + FIDO2

Let's make sure that when cryptenroll asks for the TPM2 or FIDO2 token
PIN it uses cryptenroll.* credential namespace, and cryptsetup uses
cryptsetup.*.

20 months agopkcs11-util: clean up credential handling for PKCS11 PIN
Lennart Poettering [Mon, 19 Feb 2024 16:44:01 +0000 (17:44 +0100)] 
pkcs11-util: clean up credential handling for PKCS11 PIN

similar as the previous commit, let's clean up the credential name we
use. Use home.token-pin in case of homectl, and cryptenroll.pkcs11-pin
in case of cryptenroll.

20 months agocryptenroll: use a different credential for new new PIN
Lennart Poettering [Mon, 19 Feb 2024 16:34:20 +0000 (17:34 +0100)] 
cryptenroll: use a different credential for new new PIN

The TPM2 enrollment is the only of the three token enrollments where the
user picks a PIN at enrollment time (the others have a PIN set for the
token, not for the enrollment). Let's make sure it uses a different
credential for retrieving this PIN, in order to make sure people can
programmatically change PINs via credentials (in which case they need to
supply both).

20 months agolibfido2: tweak credential to read fido2 PIN from
Lennart Poettering [Mon, 19 Feb 2024 16:30:56 +0000 (17:30 +0100)] 
libfido2: tweak credential to read fido2 PIN from

Querying a fido2 PIN via askpw for enrolling is currently used in two
places: cryptenroll and homectl. So far we sloppily used the same fixed
credential name "fido2-pin" in both cases. Let's tweak that and make the
credential name match the other credentials cryptenroll or home query,
i.e. using the cryptenroll.* and home.* namespaces.

This is particular done in light of #31370, which wants to make the
credential name public. We really should get the name in order before
making it public.

20 months agopcrlock: normalize credential name for TPM2 PIN
Lennart Poettering [Mon, 19 Feb 2024 16:03:49 +0000 (17:03 +0100)] 
pcrlock: normalize credential name for TPM2 PIN

Let's drop the "systemd-" prefix from the credential name. We do not
prefix credentials that way so far. Don't do so here either.

The name is not really API, it's not documented, hence change it now
where we still can.

20 months agocryptenroll: use correct askpw id for pw request
Lennart Poettering [Mon, 19 Feb 2024 16:01:01 +0000 (17:01 +0100)] 
cryptenroll: use correct askpw id for pw request

The "id" is used in the askpw protocol to recognize password prompts, in
case a service is replying to them and needs some id. Previously we set
an incorrect id, the one of cryptsetup. Fix that.

(I guess the id is not used much, it comes from a time where we had no
credentials, and thus some people wanted to supply passphrases
programmatically rather interactively. The usecase is probably gone, but
we should still set some valid id I guess.)

20 months agodissect-image: use strv_free_erase() at one more place
Lennart Poettering [Mon, 19 Feb 2024 15:38:01 +0000 (16:38 +0100)] 
dissect-image: use strv_free_erase() at one more place

20 months agocryptenroll: fix type confusion on acquire_tpm2_key() parameter
Lennart Poettering [Mon, 19 Feb 2024 15:37:36 +0000 (16:37 +0100)] 
cryptenroll: fix type confusion on acquire_tpm2_key() parameter

20 months agoask-password: rework how we pass request meta info when asking passwords
Lennart Poettering [Mon, 19 Feb 2024 15:35:12 +0000 (16:35 +0100)] 
ask-password: rework how we pass request meta info when asking passwords

Rather than adding more and more parameters to ask_password_auto(), let's
pass a structure of the fields that often are constant anyway.

This way, callers can fill in what they need, and we take the filled
structure which we can pass around internally as one.

This is in particular preparation for adding one more field in one of
the next commits.

20 months agocore/mount: if umount(8) fails but mount disappeared, assume success
Mike Yuan [Fri, 16 Feb 2024 19:03:50 +0000 (03:03 +0800)] 
core/mount: if umount(8) fails but mount disappeared, assume success

Fixes #31337

20 months agotest: verify our own units (where applicable) 31408/head
Frantisek Sumsal [Mon, 19 Feb 2024 19:41:49 +0000 (20:41 +0100)] 
test: verify our own units (where applicable)

This is inspired by one of our internal tests that does pretty much the
same thing. However, it is slightly more convoluted than I'd like it to
be, since I really don't want to duplicate the list of our units in
another place, so we need to, somehow, pass the list from the meson file
to the test script. I originally envisioned this to be a part of the
unit test suite, but this doesn't work for unit files with absolute
paths to binaries, as we'd have to install the build first (maybe using
a chroot would work?).

It doesn't check man pages (since they might not be installed on the
test machine) and also skip recursive dependencies (as that would trip
over issues in files that are not under our direct control), but it
should still cover typos and such.

There are currently two units for which the check had to be disabled -
syslog.socket, as the corresponding syslog.service might not be
installed, and rc-local.service as that's a compat API and the necessary
/etc/rc.d/rc.local file may not (and most likely won't be) present.

20 months agohwdb: Add support for MetawillBook01 to 60-sensor.hwdb
Zmyeir [Tue, 20 Feb 2024 10:50:03 +0000 (18:50 +0800)] 
hwdb: Add support for MetawillBook01 to 60-sensor.hwdb
Add accel orientation quirk for the METAPHYUNI MetawillBook01 2-in-1 laptop

20 months agoboot: padding for default arrow at too long lines
MrSmör [Thu, 16 Nov 2023 12:31:50 +0000 (13:31 +0100)] 
boot: padding for default arrow at too long lines

If the default boot entry name doesnt leave enough space for the
indicator arrow, it overwrote the first two characters of the entry

Now every line will always have enough padding.

20 months agotest: fix mixed indent
Frantisek Sumsal [Mon, 19 Feb 2024 19:52:16 +0000 (20:52 +0100)] 
test: fix mixed indent

20 months agotest: support TEST_MATCH_* stuff in TEST-23-UNIT-FILE as well
Frantisek Sumsal [Mon, 19 Feb 2024 19:37:31 +0000 (20:37 +0100)] 
test: support TEST_MATCH_* stuff in TEST-23-UNIT-FILE as well

TEST-23 uses run_subtests_with_signals() which I forgot about when
introducing the change.

Follow-up for 0efa27bd4b.

20 months agoMerge pull request #31388 from keszybz/bitfield-cleanup
Luca Boccassi [Tue, 20 Feb 2024 12:15:24 +0000 (12:15 +0000)] 
Merge pull request #31388 from keszybz/bitfield-cleanup

Bitfield cleanup

20 months agoanalyze: skip to check ExecCommand for .mount and .swap units
Yu Watanabe [Tue, 20 Feb 2024 02:09:43 +0000 (11:09 +0900)] 
analyze: skip to check ExecCommand for .mount and .swap units

They are not set by a unit file, but dynamically generated.

Fixes a bug caused by abf0ccc1c6fb81fdcb801566695600a518a28b43.

Fixes #31396.

20 months agologind: drop bitfield annotations 31388/head
Zbigniew Jędrzejewski-Szmek [Mon, 19 Feb 2024 11:25:29 +0000 (12:25 +0100)] 
logind: drop bitfield annotations

As in other cases, this is simpler but better.

pahole:
- /* size: 336, cachelines: 6, members: 50 */
- /* sum members: 316, holes: 4, sum holes: 19 */
- /* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */
- /* last cacheline: 16 bytes */
+ /* size: 328, cachelines: 6, members: 50 */
+ /* sum members: 320, holes: 3, sum holes: 8 */
+ /* last cacheline: 8 bytes */

20 months agotimesyncd: reorder structs instead of useless bitfields
Zbigniew Jędrzejewski-Szmek [Mon, 19 Feb 2024 11:20:20 +0000 (12:20 +0100)] 
timesyncd: reorder structs instead of useless bitfields

Because of alignment, those bitfields were not doing anything useful,
and were causing the generated code to be more complicated. But in this
case, at least potentially there might be a number of copies of those
structs (if we have a bunch of time servers configured), so let's actually
implement the intended space savings by reording the fields to reduce the
size of holes.

20 months agosystemctl: drop pointless bitfield
Zbigniew Jędrzejewski-Szmek [Mon, 19 Feb 2024 11:11:19 +0000 (12:11 +0100)] 
systemctl: drop pointless bitfield

20 months agosysupdate: drop pointless bitfields
Zbigniew Jędrzejewski-Szmek [Mon, 19 Feb 2024 11:10:34 +0000 (12:10 +0100)] 
sysupdate: drop pointless bitfields

Again, even without considering how many copies of the struct there
can be, this bitfield is useless because of alignment.

20 months agocore/kmod-setup: drop another pointless bitfield annotation
Zbigniew Jędrzejewski-Szmek [Mon, 19 Feb 2024 11:02:55 +0000 (12:02 +0100)] 
core/kmod-setup: drop another pointless bitfield annotation

We have two bools followed by a func pointer, which is aligned to e.g. 8 bytes,
so whether the two bools take one bit, one byte, or even a full word, makes no
difference in storage size. But the code generated to service a bitfield is
more complicated.

Also switch to FOREACH_ARRAY().

20 months agonetwork/ndisc: set IPv6 neighbor reachable time 31405/head
Yu Watanabe [Tue, 20 Feb 2024 06:24:09 +0000 (15:24 +0900)] 
network/ndisc: set IPv6 neighbor reachable time

Closes #31402.

20 months agosd-ndisc: introduce sd_ndisc_router_get_reachable_time()
Yu Watanabe [Tue, 20 Feb 2024 06:10:59 +0000 (15:10 +0900)] 
sd-ndisc: introduce sd_ndisc_router_get_reachable_time()

20 months agonetwork/ndisc: ignore most fields of RA header when lifetime is zero
Yu Watanabe [Mon, 19 Feb 2024 01:37:23 +0000 (10:37 +0900)] 
network/ndisc: ignore most fields of RA header when lifetime is zero

20 months agonetwork/ndisc: drop configurations when received RA with zero lifetime
Yu Watanabe [Mon, 19 Feb 2024 01:35:48 +0000 (10:35 +0900)] 
network/ndisc: drop configurations when received RA with zero lifetime

20 months agosd-ndisc: allow to call sd_ndisc_router_get_lifetime() with NULL for 'ret'
Yu Watanabe [Mon, 19 Feb 2024 01:00:33 +0000 (10:00 +0900)] 
sd-ndisc: allow to call sd_ndisc_router_get_lifetime() with NULL for 'ret'

20 months agosd-ndisc: introduce sd_ndisc_is_running()
Yu Watanabe [Wed, 14 Feb 2024 06:43:27 +0000 (15:43 +0900)] 
sd-ndisc: introduce sd_ndisc_is_running()

20 months agosd-ndisc: split sd-ndisc.h into small pieces
Yu Watanabe [Wed, 14 Feb 2024 09:11:06 +0000 (18:11 +0900)] 
sd-ndisc: split sd-ndisc.h into small pieces

20 months agoudev: String substitutions can be done in ENV, too
runiq [Mon, 19 Feb 2024 11:03:57 +0000 (12:03 +0100)] 
udev: String substitutions can be done in ENV, too

Precedence for example in https://github.com/systemd/systemd/blob/ac63c8df309e37960618610d8b57ac19ac657254/rules.d/99-systemd.rules.in#L75.

Add ENV to the list of keys where string substitutions can be used.

While I'm at it, also sort the list in that paragraph alphabetically.

20 months agohome: fix typo
Yu Watanabe [Tue, 20 Feb 2024 00:24:24 +0000 (09:24 +0900)] 
home: fix typo

Follow-up for 25c89b89771adf3251b2398eaddc3a49c22752e3 and
a4d72746c776f820a440d72eaadd49ad158e10dc.

20 months agovconsole-setup: fix typo
Yu Watanabe [Tue, 20 Feb 2024 00:23:15 +0000 (09:23 +0900)] 
vconsole-setup: fix typo

Follow-up for 190ff0d0a8d1fc367ec04296f24cd1cab5b7543b.

20 months agoresolve: several follow-ups for resolving service via varlink
Yu Watanabe [Sat, 17 Feb 2024 21:50:39 +0000 (06:50 +0900)] 
resolve: several follow-ups for resolving service via varlink

Follow-ups for e1634bb8321c5534a8e5d16b474c7e9d43ef3baa.

- Allow to call the method without "name" and "type".
- Allow to specify SD_RESOLVE_NO_TXT and SD_RESOLVE_NO_ADDRESS.
- Allow to provide multiple services, and fix memory leak.
- Rearrange the return value format.
- Encode TXT field with octescape() to make the field matches with the
  io.systemd.Resolve.Monitor interface.

Fixes #31371.

20 months agogpt-auto-generator: fix argument passed to `parse_image_policy_argument`
Antonio Alvarez Feijoo [Mon, 19 Feb 2024 15:53:15 +0000 (16:53 +0100)] 
gpt-auto-generator: fix argument passed to `parse_image_policy_argument`

Otherwise:

```
Feb 19 16:35:34 localhost systemd-gpt-auto-generator[188]: Assertion 's' failed at src/shared/image-policy.c:656, function parse_image_policy_argument(). Aborting.
```

Fixes 06e78680e3c36589b785f90ecda64d124905a3f7

20 months agoMerge pull request #31351 from YHNdnzj/exit-status-no-executable
Luca Boccassi [Mon, 19 Feb 2024 19:17:31 +0000 (19:17 +0000)] 
Merge pull request #31351 from YHNdnzj/exit-status-no-executable

core/exec-invoke: record correct exit status when failed to locate executable

20 months agopkcs11-util: Explicitly initiaiize variable to avoid warning
Daan De Meyer [Mon, 19 Feb 2024 15:55:42 +0000 (16:55 +0100)] 
pkcs11-util: Explicitly initiaiize variable to avoid warning

Avoid the following warning on C9S by explicitly initializing
"object".

"""
[389/2801] Compiling C object src/shared/libsystemd-shared-256-devel.a.p/pkcs11-util.c.o
../src/src/shared/pkcs11-util.c: In function ‘pkcs11_token_find_private_key’:
../src/src/shared/pkcs11-util.c:983:21: warning: ‘object’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  983 |         *ret_object = object;
      |         ~~~~~~~~~~~~^~~~~~~~
"""

20 months agocgroup: typo fix initial_restric_ifaces_link_fds → initial_restrict_ifaces_link_fds
Lennart Poettering [Mon, 19 Feb 2024 15:37:27 +0000 (16:37 +0100)] 
cgroup: typo fix initial_restric_ifaces_link_fds → initial_restrict_ifaces_link_fds

20 months agoMerge pull request #31357 from keszybz/cleanups-vmspawn
Luca Boccassi [Mon, 19 Feb 2024 16:45:42 +0000 (16:45 +0000)] 
Merge pull request #31357 from keszybz/cleanups-vmspawn

Cleanups vmspawn

20 months agotest: add a test for #31384
David Tardon [Fri, 16 Feb 2024 15:22:05 +0000 (16:22 +0100)] 
test: add a test for #31384

20 months agocore/execute: clean up log_exec_full_errno and friends 31351/head
Mike Yuan [Mon, 19 Feb 2024 12:55:51 +0000 (20:55 +0800)] 
core/execute: clean up log_exec_full_errno and friends

Also drop unused log_exec_struct_iovec().

20 months agocore/exec-invoke: raise the log level of missing executable to notice
Mike Yuan [Mon, 19 Feb 2024 12:43:47 +0000 (20:43 +0800)] 
core/exec-invoke: raise the log level of missing executable to notice

Suggested in
https://github.com/systemd/systemd/pull/31351#discussion_r1494450831:

> one above just informational, but also not a warning yet.

20 months agocore/exec-invoke: record correct exit status when failed to locate executable
Mike Yuan [Fri, 16 Feb 2024 12:00:06 +0000 (20:00 +0800)] 
core/exec-invoke: record correct exit status when failed to locate executable

Follow-up for 4d8b0f0f7aeadc401ac02f67576ccb1de8cf79e6

After the mentioned commit, when the ExecCommand executable is missing,
and failure will be ignored by manager, we exit with EXIT_SUCCESS at executor
side too. The behavior however contradicts systemd.service(5), which states:

> If the executable path is prefixed with "-", an exit code of the command
> normally considered a failure (i.e. non-zero exit status or abnormal exit
> due to signal is _recorded_, but has no further effect and is considered
> equivalent to success.

and thus makes debugging unexpected failures harder. Therefore, let's still
exit with EXIT_EXEC, but just skip LOG_ERR level log.

20 months agoci(labeler): add policy for `escape` labeler
Jan Macku [Mon, 19 Feb 2024 15:00:25 +0000 (16:00 +0100)] 
ci(labeler): add policy for `escape` labeler

20 months agoSet SYSTEMD_LOG_LEVEL=info explicitly in test-sysusers
Daan De Meyer [Mon, 19 Feb 2024 13:35:07 +0000 (14:35 +0100)] 
Set SYSTEMD_LOG_LEVEL=info explicitly in test-sysusers

If we're looking for output on stderr, let's make sure it's not
littered with debug logs if SYSTEMD_LOG_LEVEL=debug.

20 months agoMerge pull request #31386 from mrc0mmand/test-tweaks
Frantisek Sumsal [Mon, 19 Feb 2024 13:53:31 +0000 (14:53 +0100)] 
Merge pull request #31386 from mrc0mmand/test-tweaks

Revert "test: use btrfs by default on Arch as well"

20 months agoMerge pull request #30840 from AdrianVovk/homed-bulk-v2
Luca Boccassi [Mon, 19 Feb 2024 13:39:26 +0000 (13:39 +0000)] 
Merge pull request #30840 from AdrianVovk/homed-bulk-v2

Homed bulk directories v2

20 months agoupdate TODO 30840/head
Adrian Vovk [Wed, 17 Jan 2024 02:34:10 +0000 (21:34 -0500)] 
update TODO

20 months agoTEST-46-HOMED: Add tests for blob directories
Adrian Vovk [Thu, 11 Jan 2024 23:23:47 +0000 (18:23 -0500)] 
TEST-46-HOMED: Add tests for blob directories

20 months agohomectl: Add flags to edit blob directories
Adrian Vovk [Wed, 10 Jan 2024 22:25:00 +0000 (17:25 -0500)] 
homectl: Add flags to edit blob directories

This makes it possible to edit blob directories using homectl. The
following syntax is available:

* `--blob-directory=/path/somewhere`: Replaces the entire blob directory
with the contents of /path/somewhere

* `--blob-directory=foobar=/path/somewhere`: Replaces just the file
foobar in the blob directory with the contents of /path/somewhere

* `--blob-directory=foobar=`: Deletes the file foobar from the blob
directory

* `--blob-directory=`: Resets all previous flags

* `--avatar=`, etc: Shortcuts for `--blob-directory=FILENAME=` for the
known files in the blob directory

20 months agohomework: Handle Update & Create w/ blob dir
Adrian Vovk [Wed, 10 Jan 2024 03:06:35 +0000 (22:06 -0500)] 
homework: Handle Update & Create w/ blob dir

Introduces new extended variants of the various incarnations of
Create and Update, which take a map of filenames to FDs. This map is
then used to populate the bulk directory.

FDs are used to prevent the client from abusing homed's blob directory
permissions (everything is made world-readable by homed) to open files
that they normally aren't allowed to open. Passing along an FD ensures
that the client has read access to the file it wants homed to make
world-readable.

Internally, homework uses the map to overwrite the system blob dir.
Later, homework's existing blob dir reconciliation logic will propagate
the new contents from the system blob dir into the embedded blob
dir

20 months agohomework: Reconcile blob directories
Adrian Vovk [Tue, 9 Jan 2024 19:39:38 +0000 (14:39 -0500)] 
homework: Reconcile blob directories

Whenever the host & embedded records are reconciled, the host & embedded
blob directories are now reconciled too in the same direction.
Reconciling the blob directories serves exactly the same purpose as
reconciling the user records, and thus should behave in the same way.

20 months agohomed: Create & advertise blob directory
Adrian Vovk [Mon, 8 Jan 2024 23:37:52 +0000 (18:37 -0500)] 
homed: Create & advertise blob directory

This ensures that a user-specific blob directory exists in
/var/cache/systemd/homed for as long as the user exists, and gets
deleted if the user gets deleted.

It also advertises this blob directory via the user record, so that
clients can find and use it.

20 months agouser-record: Add blobDirectory and blobManifest
Adrian Vovk [Mon, 8 Jan 2024 23:11:43 +0000 (18:11 -0500)] 
user-record: Add blobDirectory and blobManifest

These fields are used to connect a JSON user record to its blob
directory, and to include the directory's contents in the record's
signature

20 months agoDocument blob directory behavior
Adrian Vovk [Mon, 8 Jan 2024 22:21:55 +0000 (17:21 -0500)] 
Document blob directory behavior

We're documenting the behavior of blob directories here. These docs
refer to things that aren't yet implemented at the time of the commit, but will be later in the same PR.

20 months agofd-util: Expose helper to pack fds into 3,4,5,...
Adrian Vovk [Tue, 13 Feb 2024 20:09:54 +0000 (15:09 -0500)] 
fd-util: Expose helper to pack fds into 3,4,5,...

This is useful for situations where an array of FDs is to be passed into
a child process (i.e. by passing it through safe_fork). This function
can be called in the child (before calling exec) to pack the FDs to all
be next to each-other starting from SD_LISTEN_FDS_START (i.e. 3)

20 months agoMerge pull request #31364 from bluca/vpick_ext
Luca Boccassi [Mon, 19 Feb 2024 11:15:54 +0000 (11:15 +0000)] 
Merge pull request #31364 from bluca/vpick_ext

core: add support for vpick for ExtensionImages=/ExtensionDirectories=

20 months agojournal: use the usual spelling of "serialize" 31357/head
Zbigniew Jędrzejewski-Szmek [Mon, 19 Feb 2024 10:54:06 +0000 (11:54 +0100)] 
journal: use the usual spelling of "serialize"

20 months agovmspawn: rework --help
Zbigniew Jędrzejewski-Szmek [Fri, 16 Feb 2024 15:09:46 +0000 (16:09 +0100)] 
vmspawn: rework --help

In this context, "VM" doesn't need explaining. Make the texts more precise
and try to make them fit in one line. Help output is much easier to read
when it's not wrapped.

20 months agoman: reword paragraph about --forward-journal= and adjust spacing
Zbigniew Jędrzejewski-Szmek [Fri, 16 Feb 2024 14:55:35 +0000 (15:55 +0100)] 
man: reword paragraph about --forward-journal= and adjust spacing

The previous text did not look right when rendered.

The text is much easier to read when paragraphs are separated by an empty
line, latex-style.

20 months agotest-journald-config: indentation
Zbigniew Jędrzejewski-Szmek [Fri, 16 Feb 2024 14:37:23 +0000 (15:37 +0100)] 
test-journald-config: indentation

20 months agojournald: shorten code a bit and return error where it's useful
Zbigniew Jędrzejewski-Szmek [Fri, 16 Feb 2024 14:29:29 +0000 (15:29 +0100)] 
journald: shorten code a bit and return error where it's useful

Follow-up for f31cff849d3db074d0d8157e4117d9b8372c03e8.

20 months agotest: temporarily enable session lingering for the test user 31386/head
Frantisek Sumsal [Mon, 19 Feb 2024 09:37:30 +0000 (10:37 +0100)] 
test: temporarily enable session lingering for the test user

So the user daemon with the long-running service is not killed while we
test the journal:

[  834.077080] testsuite-04.sh[10937]: Running as unit: user-sleep.service; invocation ID: b1f2c9c9a14a40ce836c867139d14dc8
[  834.077687] systemd[10943]: Started user-sleep.service.
[  834.078437] (sd-pam)[10952]: pam_unix(login:session): session closed for user testuser
[  834.078643] systemd[1]: run-u3.service: Deactivated successfully.
[  834.078710] testsuite-04.sh[10930]: + for _ in {0..9}
[  834.078710] testsuite-04.sh[10930]: + journalctl --rotate
...
[  834.081253] systemd[1]: session-7.scope: Deactivated successfully.
...
[  844.602065] testsuite-04.sh[10930]: + journalctl --rotate
[  844.630414] testsuite-04.sh[10930]: + journalctl --sync
[  844.632005] systemd[1]: Stopping user@4711.service...
[  844.634179] systemd[10943]: Activating special unit exit.target...
[  844.635769] systemd[10943]: Stopped target default.target.
[  844.636136] systemd[10943]: Stopped target timers.target.
[  844.636479] systemd[10943]: Stopping user-sleep.service...
[  844.636998] systemd[10943]: Stopped user-sleep.service.
...
[  844.758893] testsuite-04.sh[10930]: + systemctl stop --user -M testuser@ user-sleep.service
[  845.213399] systemctl[11066]: Failed to stop user-sleep.service: Unit user-sleep.service not loaded.

20 months agoRevert "test: use btrfs by default on Arch as well"
Frantisek Sumsal [Mon, 19 Feb 2024 10:23:31 +0000 (11:23 +0100)] 
Revert "test: use btrfs by default on Arch as well"

There's something very wrong going on when using btrfs for the test
images, namely:
  - there's a significant performance hit, i.e. the Arch Linux run is
    ~20% slower, in the coverage run the situation is even worse
  - intermittent boot failures
  - intermittent "No space left on device" errors (even though there's
    enough free space)

Since debugging this might take a while, let's temporarily revert back
to ext4 to make the CI stable again.

This reverts commit 7eb7e3ec4f5dbc13ee729557e1544527f3101187.

20 months agosd-radv: fix potential buffer overflow
Yu Watanabe [Mon, 19 Feb 2024 00:30:17 +0000 (09:30 +0900)] 
sd-radv: fix potential buffer overflow

Fixes a bug in 1925f829ab17cee7d65cc8c350d8281f8f41588e and
6a6d27bc5b08388964118e922f0c1b49b3c6a8ae (v255).

20 months agopam-util: include cache ID of bus connection in the log message
Yu Watanabe [Mon, 19 Feb 2024 03:02:04 +0000 (12:02 +0900)] 
pam-util: include cache ID of bus connection in the log message

To make it easier to debug issues like #31375.

20 months agocore/exec: do not crash with UtmpMode=user without User= setting
Yu Watanabe [Mon, 19 Feb 2024 04:04:28 +0000 (13:04 +0900)] 
core/exec: do not crash with UtmpMode=user without User= setting

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2264404.

Replaces #31356.