mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
Merge pull request #10835 from poettering/transient-env-fix
fix flushing out of transient env vars from PID1's Manager object
This commit is contained in:
commit
f23ff5ba51
@ -767,8 +767,10 @@ static void set_manager_defaults(Manager *m) {
|
|||||||
m->default_tasks_accounting = arg_default_tasks_accounting;
|
m->default_tasks_accounting = arg_default_tasks_accounting;
|
||||||
m->default_tasks_max = arg_default_tasks_max;
|
m->default_tasks_max = arg_default_tasks_max;
|
||||||
|
|
||||||
manager_set_default_rlimits(m, arg_default_rlimit);
|
(void) manager_set_default_rlimits(m, arg_default_rlimit);
|
||||||
manager_transient_environment_add(m, arg_default_environment);
|
|
||||||
|
(void) manager_default_environment(m);
|
||||||
|
(void) manager_transient_environment_add(m, arg_default_environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_manager_settings(Manager *m) {
|
static void set_manager_settings(Manager *m) {
|
||||||
|
@ -600,7 +600,7 @@ static char** sanitize_environment(char **l) {
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int manager_default_environment(Manager *m) {
|
int manager_default_environment(Manager *m) {
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
m->transient_environment = strv_free(m->transient_environment);
|
m->transient_environment = strv_free(m->transient_environment);
|
||||||
@ -623,7 +623,7 @@ static int manager_default_environment(Manager *m) {
|
|||||||
m->transient_environment = strv_copy(environ);
|
m->transient_environment = strv_copy(environ);
|
||||||
|
|
||||||
if (!m->transient_environment)
|
if (!m->transient_environment)
|
||||||
return -ENOMEM;
|
return log_oom();
|
||||||
|
|
||||||
sanitize_environment(m->transient_environment);
|
sanitize_environment(m->transient_environment);
|
||||||
|
|
||||||
@ -3875,7 +3875,7 @@ int manager_transient_environment_add(Manager *m, char **plus) {
|
|||||||
|
|
||||||
a = strv_env_merge(2, m->transient_environment, plus);
|
a = strv_env_merge(2, m->transient_environment, plus);
|
||||||
if (!a)
|
if (!a)
|
||||||
return -ENOMEM;
|
return log_oom();
|
||||||
|
|
||||||
sanitize_environment(a);
|
sanitize_environment(a);
|
||||||
|
|
||||||
|
@ -442,6 +442,7 @@ void manager_clear_jobs(Manager *m);
|
|||||||
|
|
||||||
unsigned manager_dispatch_load_queue(Manager *m);
|
unsigned manager_dispatch_load_queue(Manager *m);
|
||||||
|
|
||||||
|
int manager_default_environment(Manager *m);
|
||||||
int manager_transient_environment_add(Manager *m, char **plus);
|
int manager_transient_environment_add(Manager *m, char **plus);
|
||||||
int manager_client_environment_modify(Manager *m, char **minus, char **plus);
|
int manager_client_environment_modify(Manager *m, char **minus, char **plus);
|
||||||
int manager_get_effective_environment(Manager *m, char ***ret);
|
int manager_get_effective_environment(Manager *m, char ***ret);
|
||||||
|
Loading…
Reference in New Issue
Block a user