1
0
mirror of https://github.com/systemd/systemd synced 2025-09-30 09:14:46 +02:00

Compare commits

...

7 Commits

Author SHA1 Message Date
Yu Watanabe
ef72263f06 udev: fix grammar
Follow-up for 7e50402aa367d9d8b1a72e81795984dda704dab4.
2025-08-26 06:00:03 +09:00
Yu Watanabe
dac478c44c core: fix typo
Follow-up for b3415f5daef49642be3d5f417b8880c078420ff7.
2025-08-26 04:54:19 +09:00
Yu Watanabe
f78a482393 udev: fix typo
Follow-up for 32333754ae9a0352cd1850d2071e8c7676bc810d.
2025-08-26 04:49:03 +09:00
Jan Fooken
7bb8e9e82f tmpfiles: don't relabel files in dry run mode
tmpfiles attempts to correct the label of a file during various actions
via the function fd_set_perms().  Currently, said function generally
respects the dry-run mode.  However, it attempts to fix the label of a
given file regardless of the state of said dry-run mode.

This causes problems, because a user could attempt to run tmpfiles with
elevated permissions and dry run enabled, expecting the tool to not
modify their system.  Instead, tmpfiles would falsely relabel a file,
modifying their system.

This commit explicitly checks for when dry-run is enabled and skips the
file relabelling process.  Furthermore, I added logging for both cases.
I found helpful during debugging.  That said, I don't think it's
necessary to use the level LOG_INFO on the dry-run path, as it would
always produce an info log.
2025-08-26 04:07:24 +09:00
Luca Boccassi
9ce6d08196 import-generator: fix crash with no remote string in systemd.pull=
SYSTEMD_PROC_CMDLINE=rd.systemd.pull=raw,machine,blockdev,bootorigin:rootdisk systemd-import-generator

Follow-up for 0c892214f73584e55bfa3fd8f0d54f631cb527b0
2025-08-25 19:08:25 +01:00
Lennart Poettering
ce3b12713b
nspawn: the second time on_orderly_shutdown() is called userdata is NULL (#38709)
We know that it is, because we set it to NULL in the very same
on_orderly_shutdown() call.
2025-08-25 19:08:01 +01:00
Luca Boccassi
8f6236164c boot: also remember auto-generated entries
Windows/OSX/shell/etc entries are autogenerated, and should be remembered too
as the previous choice, together with Linux ones.

Follow-up for d870ae47b767183c1312ad7e3196696cf38e3b9e

Fixes https://github.com/systemd/systemd/issues/38694
2025-08-25 23:45:12 +09:00
6 changed files with 13 additions and 5 deletions

View File

@ -79,7 +79,7 @@ typedef enum LoaderType {
#define LOADER_TYPE_PROCESS_RANDOM_SEED(t) IN_SET(t, LOADER_LINUX, LOADER_UKI, LOADER_TYPE2_UKI)
/* Whether to persistently save the selected entry in an EFI variable, if that's requested. */
#define LOADER_TYPE_SAVE_ENTRY(t) IN_SET(t, LOADER_EFI, LOADER_LINUX, LOADER_UKI, LOADER_UKI_URL, LOADER_TYPE2_UKI)
#define LOADER_TYPE_SAVE_ENTRY(t) IN_SET(t, LOADER_AUTO, LOADER_EFI, LOADER_LINUX, LOADER_UKI, LOADER_UKI_URL, LOADER_TYPE2_UKI)
typedef enum {
REBOOT_NO,

View File

@ -4098,7 +4098,7 @@ static int setup_keyring(
return log_error_errno(errno, "Failed to change GID back for user keyring: %m");
}
/* Populate they keyring with the invocation ID by default, as original saved_uid. */
/* Populate the keyring with the invocation ID by default, as original saved_uid. */
if (!sd_id128_is_null(p->invocation_id)) {
key_serial_t key;

View File

@ -71,6 +71,8 @@ static int parse_pull_expression(const char *v) {
return log_error_errno(r, "Failed to extract local name from pull expression '%s': %m", v);
if (r == 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No local string in pull expression '%s'.", v);
if (isempty(p))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No remote string in pull expression '%s'.", v);
_cleanup_free_ char *remote = strdup(p);
if (!remote)

View File

@ -2959,7 +2959,7 @@ static int wait_for_container(PidRef *pid, ContainerStatus *container) {
}
static int on_orderly_shutdown(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
PidRef *pid = ASSERT_PTR(userdata);
PidRef *pid = userdata;
assert(si);

View File

@ -1060,6 +1060,12 @@ static int fd_set_perms(
}
shortcut:
if (arg_dry_run) {
log_debug("Would relabel \"%s\"", path);
return 0;
}
log_debug("Relabelling \"%s\"", path);
return label_fix_full(fd, /* inode_path= */ NULL, /* label_path= */ path, 0);
}

View File

@ -304,13 +304,13 @@ void manager_exit(Manager *manager) {
manager->varlink_server = sd_varlink_server_unref(manager->varlink_server);
(void) manager_serialize_config(manager);
/* Disable the event source, but does not close the inotify fd here, as we may still receive
/* Disable the event source, but do not close the inotify fd here, as we may still receive
* notification messages about requests to add or remove inotify watches. */
manager->inotify_event = sd_event_source_disable_unref(manager->inotify_event);
/* Disable the device monitor but do not free device monitor, as it may be used when a worker failed,
* and the manager needs to broadcast the kernel event assigned to the worker to libudev listeners.
* Note, hwere we cannot use sd_device_monitor_stop(), as it changes the multicast group of the socket. */
* Note, here we cannot use sd_device_monitor_stop(), as it changes the multicast group of the socket. */
(void) sd_event_source_set_enabled(sd_device_monitor_get_event_source(manager->monitor), SD_EVENT_OFF);
(void) sd_device_monitor_detach_event(manager->monitor);