From 0fa8b51962d5de7870d2a90600919136b301c8f4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Jul 2025 12:08:12 +0200 Subject: [PATCH 1/3] tree-wide: the env var is called $XDG_RUNTIME_DIR, not $XDG_RUNTIME_DIRECTORY --- docs/TEMPORARY_DIRECTORIES.md | 2 +- src/login/pam_systemd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/TEMPORARY_DIRECTORIES.md b/docs/TEMPORARY_DIRECTORIES.md index bc9cb7bc45..b0b5da8c06 100644 --- a/docs/TEMPORARY_DIRECTORIES.md +++ b/docs/TEMPORARY_DIRECTORIES.md @@ -143,7 +143,7 @@ strategies to avoid these issues: the sticky bit has a different meaning for them. 6. Don't use `/tmp/` or `/var/tmp/`, but use your own sub-directory under - `/run/` or `$XDG_RUNTIME_DIRECTORY` (the former if privileged, the latter if + `/run/` or `$XDG_RUNTIME_DIR` (the former if privileged, the latter if unprivileged), or `/var/lib/` and `~/.config/` (similar, but with persistency and suitable for larger data). The two temporary directories `/tmp/` and `/var/tmp/` come with the implicit clean-up semantics described diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index 9fc4231b98..a2f0a7373a 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -1569,7 +1569,7 @@ static int setup_environment( /* Also create a per-area subdirectory for $XDG_RUNTIME_DIR, so that each area has their own * set of runtime services. We follow the same directory structure as for $HOME. Note that we * do not define any form of automatic clean-up for the per-aera subdirs beyond the regular - * clean-up of the whole $XDG_RUNTIME_DIRECTORY hierarchy when the user finally logs out. */ + * clean-up of the whole $XDG_RUNTIME_DIR hierarchy when the user finally logs out. */ r = make_area_runtime_directory(handle, ur, runtime_directory, area, &per_area_runtime_directory); if (r != PAM_SUCCESS) From 4baede011dca5bb49d18c9594aa448dc21315f48 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Jul 2025 12:15:34 +0200 Subject: [PATCH 2/3] machined: align string table --- src/machine/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/machine.c b/src/machine/machine.c index e127ddcb0e..1ce906b7a2 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -1605,8 +1605,8 @@ int machine_open_root_directory(Machine *machine) { static const char* const machine_class_table[_MACHINE_CLASS_MAX] = { [MACHINE_CONTAINER] = "container", - [MACHINE_VM] = "vm", - [MACHINE_HOST] = "host", + [MACHINE_VM] = "vm", + [MACHINE_HOST] = "host", }; DEFINE_STRING_TABLE_LOOKUP(machine_class, MachineClass); From d32ca63318025bfb2fe16654961911dc9f5b364c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Jul 2025 12:15:47 +0200 Subject: [PATCH 3/3] machined: use RET_GATHER() more --- src/machine/machined.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/machine/machined.c b/src/machine/machined.c index 52fd69c6da..46395d7df4 100644 --- a/src/machine/machined.c +++ b/src/machine/machined.c @@ -198,15 +198,13 @@ static int manager_enumerate_machines(Manager *m) { k = manager_add_machine(m, de->d_name, &machine); if (k < 0) { - r = log_error_errno(k, "Failed to add machine by file name %s: %m", de->d_name); + RET_GATHER(r, log_error_errno(k, "Failed to add machine by file name %s: %m", de->d_name)); continue; } machine_add_to_gc_queue(machine); - k = machine_load(machine); - if (k < 0) - r = k; + RET_GATHER(r, machine_load(machine)); } return r;