mirror of
https://github.com/systemd/systemd
synced 2026-03-16 18:14:46 +01:00
Compare commits
No commits in common. "e41d7de091ea3380407d117ae7252d8cb1523b74" and "331fef07d8b2909a84a88cc3d18911853b413f8f" have entirely different histories.
e41d7de091
...
331fef07d8
@ -26,11 +26,6 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generator_soft_rebooted()) {
|
|
||||||
log_debug("Skipping generator, current system is entered via soft-reboot.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_efi_boot()) {
|
if (!is_efi_boot()) {
|
||||||
log_debug("Skipping generator, not an EFI boot.");
|
log_debug("Skipping generator, not an EFI boot.");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -4047,8 +4047,8 @@ int bus_exec_context_set_transient_property(
|
|||||||
_cleanup_free_ char *format_str = NULL;
|
_cleanup_free_ char *format_str = NULL;
|
||||||
MountImage *mount_images = NULL;
|
MountImage *mount_images = NULL;
|
||||||
size_t n_mount_images = 0;
|
size_t n_mount_images = 0;
|
||||||
|
char *source, *destination;
|
||||||
CLEANUP_ARRAY(mount_images, n_mount_images, mount_image_free_many);
|
int permissive;
|
||||||
|
|
||||||
r = sd_bus_message_enter_container(message, 'a', "(ssba(ss))");
|
r = sd_bus_message_enter_container(message, 'a', "(ssba(ss))");
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -4057,8 +4057,7 @@ int bus_exec_context_set_transient_property(
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
_cleanup_(mount_options_free_allp) MountOptions *options = NULL;
|
_cleanup_(mount_options_free_allp) MountOptions *options = NULL;
|
||||||
_cleanup_free_ char *source_escaped = NULL, *destination_escaped = NULL;
|
_cleanup_free_ char *source_escaped = NULL, *destination_escaped = NULL;
|
||||||
char *source, *destination;
|
char *tuple;
|
||||||
int permissive;
|
|
||||||
|
|
||||||
r = sd_bus_message_enter_container(message, 'r', "ssba(ss)");
|
r = sd_bus_message_enter_container(message, 'r', "ssba(ss)");
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -4085,12 +4084,15 @@ int bus_exec_context_set_transient_property(
|
|||||||
if (!destination_escaped)
|
if (!destination_escaped)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
r = strextendf_with_separator(&format_str, " ", "%s%s:%s",
|
tuple = strjoin(format_str,
|
||||||
permissive ? "-" : "",
|
format_str ? " " : "",
|
||||||
source_escaped,
|
permissive ? "-" : "",
|
||||||
destination_escaped);
|
source_escaped,
|
||||||
if (r < 0)
|
":",
|
||||||
return r;
|
destination_escaped);
|
||||||
|
if (!tuple)
|
||||||
|
return -ENOMEM;
|
||||||
|
free_and_replace(format_str, tuple);
|
||||||
|
|
||||||
r = bus_read_mount_options(message, reterr_error, &options, &format_str, ":");
|
r = bus_read_mount_options(message, reterr_error, &options, &format_str, ":");
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -4120,21 +4122,15 @@ int bus_exec_context_set_transient_property(
|
|||||||
|
|
||||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
||||||
if (n_mount_images == 0) {
|
if (n_mount_images == 0) {
|
||||||
mount_image_free_many(c->mount_images, c->n_mount_images);
|
c->mount_images = mount_image_free_many(c->mount_images, &c->n_mount_images);
|
||||||
c->mount_images = NULL;
|
|
||||||
c->n_mount_images = 0;
|
|
||||||
|
|
||||||
unit_write_settingf(u, flags, name, "%s=", name);
|
unit_write_settingf(u, flags, name, "%s=", name);
|
||||||
} else {
|
} else {
|
||||||
if (!c->mount_images) {
|
for (size_t i = 0; i < n_mount_images; ++i) {
|
||||||
c->mount_images = TAKE_PTR(mount_images);
|
r = mount_image_add(&c->mount_images, &c->n_mount_images, &mount_images[i]);
|
||||||
c->n_mount_images = n_mount_images;
|
if (r < 0)
|
||||||
} else
|
return r;
|
||||||
FOREACH_ARRAY(i, mount_images, n_mount_images) {
|
}
|
||||||
r = mount_image_add(&c->mount_images, &c->n_mount_images, i);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
unit_write_settingf(u, flags|UNIT_ESCAPE_C|UNIT_ESCAPE_SPECIFIERS,
|
unit_write_settingf(u, flags|UNIT_ESCAPE_C|UNIT_ESCAPE_SPECIFIERS,
|
||||||
name,
|
name,
|
||||||
@ -4144,15 +4140,14 @@ int bus_exec_context_set_transient_property(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
mount_images = mount_image_free_many(mount_images, &n_mount_images);
|
||||||
|
|
||||||
|
return 1;
|
||||||
} else if (streq(name, "ExtensionImages")) {
|
} else if (streq(name, "ExtensionImages")) {
|
||||||
_cleanup_free_ char *format_str = NULL;
|
_cleanup_free_ char *format_str = NULL;
|
||||||
MountImage *extension_images = NULL;
|
MountImage *extension_images = NULL;
|
||||||
size_t n_extension_images = 0;
|
size_t n_extension_images = 0;
|
||||||
|
|
||||||
CLEANUP_ARRAY(extension_images, n_extension_images, mount_image_free_many);
|
|
||||||
|
|
||||||
r = sd_bus_message_enter_container(message, 'a', "(sba(ss))");
|
r = sd_bus_message_enter_container(message, 'a', "(sba(ss))");
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
@ -4160,7 +4155,7 @@ int bus_exec_context_set_transient_property(
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
_cleanup_(mount_options_free_allp) MountOptions *options = NULL;
|
_cleanup_(mount_options_free_allp) MountOptions *options = NULL;
|
||||||
_cleanup_free_ char *source_escaped = NULL;
|
_cleanup_free_ char *source_escaped = NULL;
|
||||||
char *source;
|
char *source, *tuple;
|
||||||
int permissive;
|
int permissive;
|
||||||
|
|
||||||
r = sd_bus_message_enter_container(message, 'r', "sba(ss)");
|
r = sd_bus_message_enter_container(message, 'r', "sba(ss)");
|
||||||
@ -4181,10 +4176,13 @@ int bus_exec_context_set_transient_property(
|
|||||||
if (!source_escaped)
|
if (!source_escaped)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
r = strextendf_with_separator(&format_str, " ", "%s%s",
|
tuple = strjoin(format_str,
|
||||||
permissive ? "-" : "", source_escaped);
|
format_str ? " " : "",
|
||||||
if (r < 0)
|
permissive ? "-" : "",
|
||||||
return r;
|
source_escaped);
|
||||||
|
if (!tuple)
|
||||||
|
return -ENOMEM;
|
||||||
|
free_and_replace(format_str, tuple);
|
||||||
|
|
||||||
r = bus_read_mount_options(message, reterr_error, &options, &format_str, ":");
|
r = bus_read_mount_options(message, reterr_error, &options, &format_str, ":");
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -4213,21 +4211,15 @@ int bus_exec_context_set_transient_property(
|
|||||||
|
|
||||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
||||||
if (n_extension_images == 0) {
|
if (n_extension_images == 0) {
|
||||||
mount_image_free_many(c->extension_images, c->n_extension_images);
|
c->extension_images = mount_image_free_many(c->extension_images, &c->n_extension_images);
|
||||||
c->extension_images = NULL;
|
|
||||||
c->n_extension_images = 0;
|
|
||||||
|
|
||||||
unit_write_settingf(u, flags, name, "%s=", name);
|
unit_write_settingf(u, flags, name, "%s=", name);
|
||||||
} else {
|
} else {
|
||||||
if (!c->extension_images) {
|
for (size_t i = 0; i < n_extension_images; ++i) {
|
||||||
c->extension_images = TAKE_PTR(extension_images);
|
r = mount_image_add(&c->extension_images, &c->n_extension_images, &extension_images[i]);
|
||||||
c->n_extension_images = n_extension_images;
|
if (r < 0)
|
||||||
} else
|
return r;
|
||||||
FOREACH_ARRAY(i, extension_images, n_extension_images) {
|
}
|
||||||
r = mount_image_add(&c->extension_images, &c->n_extension_images, i);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
unit_write_settingf(u, flags|UNIT_ESCAPE_C|UNIT_ESCAPE_SPECIFIERS,
|
unit_write_settingf(u, flags|UNIT_ESCAPE_C|UNIT_ESCAPE_SPECIFIERS,
|
||||||
name,
|
name,
|
||||||
@ -4237,6 +4229,8 @@ int bus_exec_context_set_transient_property(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension_images = mount_image_free_many(extension_images, &n_extension_images);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
} else if (STR_IN_SET(name, "StateDirectorySymlink", "RuntimeDirectorySymlink", "CacheDirectorySymlink", "LogsDirectorySymlink")) {
|
} else if (STR_IN_SET(name, "StateDirectorySymlink", "RuntimeDirectorySymlink", "CacheDirectorySymlink", "LogsDirectorySymlink")) {
|
||||||
|
|||||||
@ -684,6 +684,8 @@ void exec_context_done(ExecContext *c) {
|
|||||||
iovec_done(&c->root_hash_sig);
|
iovec_done(&c->root_hash_sig);
|
||||||
c->root_hash_sig_path = mfree(c->root_hash_sig_path);
|
c->root_hash_sig_path = mfree(c->root_hash_sig_path);
|
||||||
c->root_verity = mfree(c->root_verity);
|
c->root_verity = mfree(c->root_verity);
|
||||||
|
c->extension_images = mount_image_free_many(c->extension_images, &c->n_extension_images);
|
||||||
|
c->extension_directories = strv_free(c->extension_directories);
|
||||||
c->tty_path = mfree(c->tty_path);
|
c->tty_path = mfree(c->tty_path);
|
||||||
c->syslog_identifier = mfree(c->syslog_identifier);
|
c->syslog_identifier = mfree(c->syslog_identifier);
|
||||||
c->user = mfree(c->user);
|
c->user = mfree(c->user);
|
||||||
@ -703,16 +705,10 @@ void exec_context_done(ExecContext *c) {
|
|||||||
bind_mount_free_many(c->bind_mounts, c->n_bind_mounts);
|
bind_mount_free_many(c->bind_mounts, c->n_bind_mounts);
|
||||||
c->bind_mounts = NULL;
|
c->bind_mounts = NULL;
|
||||||
c->n_bind_mounts = 0;
|
c->n_bind_mounts = 0;
|
||||||
mount_image_free_many(c->mount_images, c->n_mount_images);
|
|
||||||
c->mount_images = NULL;
|
|
||||||
c->n_mount_images = 0;
|
|
||||||
mount_image_free_many(c->extension_images, c->n_extension_images);
|
|
||||||
c->extension_images = NULL;
|
|
||||||
c->n_extension_images = 0;
|
|
||||||
c->extension_directories = strv_free(c->extension_directories);
|
|
||||||
temporary_filesystem_free_many(c->temporary_filesystems, c->n_temporary_filesystems);
|
temporary_filesystem_free_many(c->temporary_filesystems, c->n_temporary_filesystems);
|
||||||
c->temporary_filesystems = NULL;
|
c->temporary_filesystems = NULL;
|
||||||
c->n_temporary_filesystems = 0;
|
c->n_temporary_filesystems = 0;
|
||||||
|
c->mount_images = mount_image_free_many(c->mount_images, &c->n_mount_images);
|
||||||
|
|
||||||
cpu_set_done(&c->cpu_set);
|
cpu_set_done(&c->cpu_set);
|
||||||
numa_policy_reset(&c->numa_policy);
|
numa_policy_reset(&c->numa_policy);
|
||||||
|
|||||||
@ -5175,9 +5175,7 @@ int config_parse_mount_images(
|
|||||||
|
|
||||||
if (isempty(rvalue)) {
|
if (isempty(rvalue)) {
|
||||||
/* Empty assignment resets the list */
|
/* Empty assignment resets the list */
|
||||||
mount_image_free_many(c->mount_images, c->n_mount_images);
|
c->mount_images = mount_image_free_many(c->mount_images, &c->n_mount_images);
|
||||||
c->mount_images = NULL;
|
|
||||||
c->n_mount_images = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5325,9 +5323,7 @@ int config_parse_extension_images(
|
|||||||
|
|
||||||
if (isempty(rvalue)) {
|
if (isempty(rvalue)) {
|
||||||
/* Empty assignment resets the list */
|
/* Empty assignment resets the list */
|
||||||
mount_image_free_many(c->extension_images, c->n_extension_images);
|
c->extension_images = mount_image_free_many(c->extension_images, &c->n_extension_images);
|
||||||
c->extension_images = NULL;
|
|
||||||
c->n_extension_images = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3098,16 +3098,19 @@ int bind_mount_add(BindMount **b, size_t *n, const BindMount *item) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mount_image_free_many(MountImage *m, size_t n) {
|
MountImage* mount_image_free_many(MountImage *m, size_t *n) {
|
||||||
assert(m || n == 0);
|
assert(n);
|
||||||
|
assert(m || *n == 0);
|
||||||
|
|
||||||
FOREACH_ARRAY(i, m, n) {
|
for (size_t i = 0; i < *n; i++) {
|
||||||
free(i->source);
|
free(m[i].source);
|
||||||
free(i->destination);
|
free(m[i].destination);
|
||||||
mount_options_free_all(i->mount_options);
|
mount_options_free_all(m[i].mount_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(m);
|
free(m);
|
||||||
|
*n = 0;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mount_image_add(MountImage **m, size_t *n, const MountImage *item) {
|
int mount_image_add(MountImage **m, size_t *n, const MountImage *item) {
|
||||||
|
|||||||
@ -286,15 +286,12 @@ DECLARE_STRING_TABLE_LOOKUP(private_pids, PrivatePIDs);
|
|||||||
void bind_mount_free_many(BindMount *b, size_t n);
|
void bind_mount_free_many(BindMount *b, size_t n);
|
||||||
int bind_mount_add(BindMount **b, size_t *n, const BindMount *item);
|
int bind_mount_add(BindMount **b, size_t *n, const BindMount *item);
|
||||||
|
|
||||||
void mount_image_free_many(MountImage *m, size_t n);
|
|
||||||
int mount_image_add(MountImage **m, size_t *n, const MountImage *item);
|
|
||||||
|
|
||||||
void temporary_filesystem_free_many(TemporaryFileSystem *t, size_t n);
|
void temporary_filesystem_free_many(TemporaryFileSystem *t, size_t n);
|
||||||
int temporary_filesystem_add(
|
int temporary_filesystem_add(TemporaryFileSystem **t, size_t *n,
|
||||||
TemporaryFileSystem **t,
|
const char *path, const char *options);
|
||||||
size_t *n,
|
|
||||||
const char *path,
|
MountImage* mount_image_free_many(MountImage *m, size_t *n);
|
||||||
const char *options);
|
int mount_image_add(MountImage **m, size_t *n, const MountImage *item);
|
||||||
|
|
||||||
int refresh_extensions_in_namespace(
|
int refresh_extensions_in_namespace(
|
||||||
const PidRef *target,
|
const PidRef *target,
|
||||||
|
|||||||
@ -2071,12 +2071,6 @@ static int dns_configuration_json_append(
|
|||||||
|
|
||||||
assert(configuration);
|
assert(configuration);
|
||||||
|
|
||||||
if (current_dns_server) {
|
|
||||||
r = dns_server_dump_configuration_to_json(current_dns_server, ¤t_dns_server_json);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
SET_FOREACH(scope, dns_scopes) {
|
SET_FOREACH(scope, dns_scopes) {
|
||||||
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
|
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
|
||||||
|
|
||||||
|
|||||||
@ -959,9 +959,6 @@ testcase_10_resolvectl_json() {
|
|||||||
|
|
||||||
assert_eq "$(resolvectl --json=short nta dns0 | jq -rc '.[0].negativeTrustAnchors | .[0]')" 'bar'
|
assert_eq "$(resolvectl --json=short nta dns0 | jq -rc '.[0].negativeTrustAnchors | .[0]')" 'bar'
|
||||||
assert_eq "$(jq -rc '.[0].negativeTrustAnchors | .[0]' "$status_json")" 'bar'
|
assert_eq "$(jq -rc '.[0].negativeTrustAnchors | .[0]' "$status_json")" 'bar'
|
||||||
|
|
||||||
# Test that currentServer is non-empty.
|
|
||||||
jq -rce '.[0].currentServer' "$status_json"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test serve stale feature and NFTSet= if nftables is installed
|
# Test serve stale feature and NFTSet= if nftables is installed
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user