Merge pull request #10594 from poettering/env-reload-fix

change handling of environment block of PID1's manager object
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-11-07 12:49:13 +01:00
committed by GitHub
30 changed files with 201 additions and 120 deletions
+1 -1
View File
@@ -742,7 +742,7 @@ int ask_password_agent(
if (passphrase[0] == '+') {
/* An empty message refers to the empty password */
if (n == 1)
l = strv_new("", NULL);
l = strv_new("");
else
l = strv_parse_nulstr(passphrase+1, n-1);
explicit_bzero_safe(passphrase, n);
+1 -1
View File
@@ -1113,7 +1113,7 @@ int config_parse_join_controllers(
controllers = new(char**, 2);
if (!controllers)
return log_oom();
controllers[0] = strv_new(NULL, NULL);
controllers[0] = strv_new(NULL);
if (!controllers[0])
return log_oom();
controllers[1] = NULL;
+1 -1
View File
@@ -2446,7 +2446,7 @@ int unit_file_add_dependency(
l = &i->required_by;
strv_free(*l);
*l = strv_new(target_info->name, NULL);
*l = strv_new(target_info->name);
if (!*l)
return -ENOMEM;
}
+5 -10
View File
@@ -137,8 +137,7 @@ int xdg_user_dirs(char ***ret_config_dirs, char ***ret_data_dirs) {
data_dirs = strv_split(e, ":");
else
data_dirs = strv_new("/usr/local/share",
"/usr/share",
NULL);
"/usr/share");
if (!data_dirs)
return -ENOMEM;
@@ -616,8 +615,7 @@ int lookup_paths_init(
SYSTEM_DATA_UNIT_PATH,
"/usr/lib/systemd/system",
STRV_IFNOTNULL(flags & LOOKUP_PATHS_SPLIT_USR ? "/lib/systemd/system" : NULL),
STRV_IFNOTNULL(generator_late),
NULL);
STRV_IFNOTNULL(generator_late));
break;
case UNIT_FILE_GLOBAL:
@@ -640,8 +638,7 @@ int lookup_paths_init(
"/usr/local/lib/systemd/user",
USER_DATA_UNIT_PATH,
"/usr/lib/systemd/user",
STRV_IFNOTNULL(generator_late),
NULL);
STRV_IFNOTNULL(generator_late));
break;
case UNIT_FILE_USER:
@@ -891,16 +888,14 @@ char **generator_binary_paths(UnitFileScope scope) {
return strv_new("/run/systemd/system-generators",
"/etc/systemd/system-generators",
"/usr/local/lib/systemd/system-generators",
SYSTEM_GENERATOR_PATH,
NULL);
SYSTEM_GENERATOR_PATH);
case UNIT_FILE_GLOBAL:
case UNIT_FILE_USER:
return strv_new("/run/systemd/user-generators",
"/etc/systemd/user-generators",
"/usr/local/lib/systemd/user-generators",
USER_GENERATOR_PATH,
NULL);
USER_GENERATOR_PATH);
default:
assert_not_reached("Hmm, unexpected scope.");
+5 -5
View File
@@ -73,7 +73,7 @@ int parse_sleep_config(const char *verb, bool *ret_allow, char ***ret_modes, cha
if (suspend_state)
states = TAKE_PTR(suspend_state);
else
states = strv_new("mem", "standby", "freeze", NULL);
states = strv_new("mem", "standby", "freeze");
} else if (streq(verb, "hibernate")) {
allow = allow_hibernate != 0;
@@ -81,12 +81,12 @@ int parse_sleep_config(const char *verb, bool *ret_allow, char ***ret_modes, cha
if (hibernate_mode)
modes = TAKE_PTR(hibernate_mode);
else
modes = strv_new("platform", "shutdown", NULL);
modes = strv_new("platform", "shutdown");
if (hibernate_state)
states = TAKE_PTR(hibernate_state);
else
states = strv_new("disk", NULL);
states = strv_new("disk");
} else if (streq(verb, "hybrid-sleep")) {
allow = allow_hybrid_sleep > 0 ||
@@ -95,12 +95,12 @@ int parse_sleep_config(const char *verb, bool *ret_allow, char ***ret_modes, cha
if (hybrid_mode)
modes = TAKE_PTR(hybrid_mode);
else
modes = strv_new("suspend", "platform", "shutdown", NULL);
modes = strv_new("suspend", "platform", "shutdown");
if (hybrid_state)
states = TAKE_PTR(hybrid_state);
else
states = strv_new("disk", NULL);
states = strv_new("disk");
} else if (streq(verb, "suspend-then-hibernate")) {
allow = allow_s2h > 0 ||