From b004393d70761f55d4f13195a96b78bb8591e792 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Aug 2024 18:18:41 +0200 Subject: [PATCH] =?utf8?q?core:=20rename=20original=5Fambient=5Fset=20?= =?utf8?q?=E2=86=92=20saved=5Fambient=5Fset?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We call similar other fields in main.c (notably: rlimit stuff, env vars) "saved", rather than "original". Hence stick to that kind of naming here too. Follow-up for: #32937 --- src/core/execute.c | 2 +- src/core/main.c | 18 +++++++++--------- src/core/manager.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/execute.c b/src/core/execute.c index c2735fc998c..55cf9ef3796 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -468,7 +468,7 @@ int exec_spawn( /* Restore the original ambient capability set the manager was started with to pass it to * sd-executor. */ - r = capability_ambient_set_apply(unit->manager->original_ambient_set, /* also_inherit= */ false); + r = capability_ambient_set_apply(unit->manager->saved_ambient_set, /* also_inherit= */ false); if (r < 0) return log_unit_error_errno(unit, r, "Failed to apply the starting ambient set: %m"); diff --git a/src/core/main.c b/src/core/main.c index 29723a9c664..16ba8a5ebc9 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1938,7 +1938,7 @@ static int do_reexecute( FDSet *fds, const char *switch_root_dir, const char *switch_root_init, - uint64_t capability_ambient_set, + uint64_t saved_capability_ambient_set, const char **ret_error_message) { size_t i, args_size; @@ -2000,7 +2000,7 @@ static int do_reexecute( log_error_errno(r, "Failed to switch root, trying to continue: %m"); } - r = capability_ambient_set_apply(capability_ambient_set, /* also_inherit= */ false); + r = capability_ambient_set_apply(saved_capability_ambient_set, /* also_inherit= */ false); if (r < 0) log_warning_errno(r, "Failed to apply the starting ambient set, ignoring: %m"); @@ -2379,12 +2379,12 @@ static int initialize_runtime( bool first_boot, struct rlimit *saved_rlimit_nofile, struct rlimit *saved_rlimit_memlock, - uint64_t *original_ambient_set, + uint64_t *saved_ambient_set, const char **ret_error_message) { int r; - assert(original_ambient_set); + assert(saved_ambient_set); assert(ret_error_message); /* Sets up various runtime parameters. Many of these initializations are conditionalized: @@ -2506,7 +2506,7 @@ static int initialize_runtime( * system manager operation, because by default it starts with an empty ambient set. * * Preserve the ambient set for later use with sd-executor processes. */ - r = capability_get_ambient(original_ambient_set); + r = capability_get_ambient(saved_ambient_set); if (r < 0) log_warning_errno(r, "Failed to save ambient capabilities, ignoring: %m"); @@ -3011,7 +3011,7 @@ int main(int argc, char *argv[]) { usec_t before_startup, after_startup; static char systemd[] = "systemd"; const char *error_message = NULL; - uint64_t original_ambient_set; + uint64_t saved_ambient_set; int r, retval = EXIT_FAILURE; Manager *m = NULL; FDSet *fds = NULL; @@ -3286,7 +3286,7 @@ int main(int argc, char *argv[]) { first_boot, &saved_rlimit_nofile, &saved_rlimit_memlock, - &original_ambient_set, + &saved_ambient_set, &error_message); if (r < 0) goto finish; @@ -3308,7 +3308,7 @@ int main(int argc, char *argv[]) { m->timestamps[manager_timestamp_initrd_mangle(MANAGER_TIMESTAMP_SECURITY_START)] = security_start_timestamp; m->timestamps[manager_timestamp_initrd_mangle(MANAGER_TIMESTAMP_SECURITY_FINISH)] = security_finish_timestamp; - m->original_ambient_set = original_ambient_set; + m->saved_ambient_set = saved_ambient_set; set_manager_defaults(m); set_manager_settings(m); @@ -3385,7 +3385,7 @@ finish: fds, switch_root_dir, switch_root_init, - original_ambient_set, + saved_ambient_set, &error_message); /* This only returns if reexecution failed */ arg_serialization = safe_fclose(arg_serialization); diff --git a/src/core/manager.h b/src/core/manager.h index 62e1346a859..46cc4bca430 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -512,7 +512,7 @@ struct Manager { unsigned soft_reboots_count; /* Original ambient capabilities when we were initialized */ - uint64_t original_ambient_set; + uint64_t saved_ambient_set; }; static inline usec_t manager_default_timeout_abort_usec(Manager *m) { -- 2.47.3