]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: fix double Environment present in both context and runtime
authorIvan Kruglov <mail@ikruglov.com>
Wed, 9 Jul 2025 12:54:07 +0000 (05:54 -0700)
committerIvan Kruglov <mail@ikruglov.com>
Thu, 10 Jul 2025 19:08:11 +0000 (21:08 +0200)
src/core/varlink-manager.c
src/shared/varlink-io.systemd.Manager.c

index a54ee6ce3fd2120c79dc4aea12d78f50867750af..c1e1046835020e375a93d512972083dc732b2d7e 100644 (file)
@@ -44,7 +44,7 @@ static int manager_context_build_json(sd_json_variant **ret, const char *name, v
 
         return sd_json_buildo(
                         ASSERT_PTR(ret),
-                        JSON_BUILD_PAIR_STRV_NON_EMPTY("Environment", m->transient_environment),
+                        JSON_BUILD_PAIR_CALLBACK_NON_NULL("Environment", manager_environment_build_json, m),
                         SD_JSON_BUILD_PAIR_STRING("DefaultStandardOutput", exec_output_to_string(m->defaults.std_output)),
                         SD_JSON_BUILD_PAIR_STRING("DefaultStandardError", exec_output_to_string(m->defaults.std_error)),
                         SD_JSON_BUILD_PAIR_BOOLEAN("ServiceWatchdogs", m->service_watchdogs),
@@ -144,7 +144,6 @@ static int manager_runtime_build_json(sd_json_variant **ret, const char *name, v
                 SD_JSON_BUILD_PAIR_UNSIGNED("NInstalledJobs", m->n_installed_jobs),
                 SD_JSON_BUILD_PAIR_UNSIGNED("NFailedJobs", m->n_failed_jobs),
                 SD_JSON_BUILD_PAIR_REAL("Progress", manager_get_progress(m)),
-                JSON_BUILD_PAIR_CALLBACK_NON_NULL("Environment", manager_environment_build_json, m),
                 JSON_BUILD_PAIR_STRING_NON_EMPTY("WatchdogDevice", watchdog_get_device()),
                 JSON_BUILD_PAIR_DUAL_TIMESTAMP_NON_NULL("WatchdogLastPingTimestamp", watchdog_get_last_ping_as_dual_timestamp(&watchdog_last_ping)),
                 JSON_BUILD_PAIR_STRING_NON_EMPTY("ControlGroup", m->cgroup_root),
index d1ed8e22b4a874e61e89c986019b2e016f0b0c2b..a3cb2edc8350a838677ed94b694f1daadd7921d3 100644 (file)
@@ -20,7 +20,7 @@ static SD_VARLINK_DEFINE_STRUCT_TYPE(
 
 static SD_VARLINK_DEFINE_STRUCT_TYPE(
                 ManagerContext,
-                SD_VARLINK_FIELD_COMMENT("https://www.freedesktop.org/software/systemd/man/latest/systemd-system.conf.html#ManagerEnvironment="),
+                SD_VARLINK_FIELD_COMMENT("https://www.freedesktop.org/software/systemd/man/"PROJECT_VERSION_STR"/systemd-system.conf.html#ManagerEnvironment="),
                 SD_VARLINK_DEFINE_FIELD(Environment, SD_VARLINK_STRING, SD_VARLINK_ARRAY|SD_VARLINK_NULLABLE),
                 SD_VARLINK_FIELD_COMMENT("https://www.freedesktop.org/software/systemd/man/"PROJECT_VERSION_STR"/systemd-system.conf.html#DefaultStandardOutput="),
                 SD_VARLINK_DEFINE_FIELD(DefaultStandardOutput, SD_VARLINK_STRING, 0),
@@ -143,8 +143,6 @@ static SD_VARLINK_DEFINE_STRUCT_TYPE(
                 SD_VARLINK_DEFINE_FIELD(NFailedJobs, SD_VARLINK_INT, 0),
                 SD_VARLINK_FIELD_COMMENT("Boot progress as a floating point value between 0.0 and 1.0"),
                 SD_VARLINK_DEFINE_FIELD(Progress, SD_VARLINK_FLOAT, 0),
-                SD_VARLINK_FIELD_COMMENT("The manager environment variables"),
-                SD_VARLINK_DEFINE_FIELD(Environment, SD_VARLINK_STRING, SD_VARLINK_ARRAY),
                 SD_VARLINK_FIELD_COMMENT("The hardware watchdog device currently in use"),
                 SD_VARLINK_DEFINE_FIELD(WatchdogDevice, SD_VARLINK_STRING, SD_VARLINK_NULLABLE),
                 SD_VARLINK_FIELD_COMMENT("Timestamp when the hardware watchdog was last pinged"),