]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: rename original_ambient_set → saved_ambient_set
authorLennart Poettering <lennart@poettering.net>
Thu, 22 Aug 2024 16:18:41 +0000 (18:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 22 Aug 2024 16:21:56 +0000 (18:21 +0200)
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
src/core/main.c
src/core/manager.h

index c2735fc998c9535b2e567df1955c32bcbf09e07a..55cf9ef37963b564eac4c7994f9855aad05347ed 100644 (file)
@@ -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");
 
index 29723a9c66423150c413271ee0755f4752d73937..16ba8a5ebc97c5ecc905cb77388539fe8eca6a52 100644 (file)
@@ -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);
index 62e1346a859d9d3ffc4ef92ff8da4e1c4f573a35..46cc4bca430ff4b294e9e2647efcb3dd0a8c5687 100644 (file)
@@ -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) {