summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2016-07-08 17:33:12 +0300
committerGitHub <noreply@github.com>2016-07-08 17:33:12 +0300
commit224d3d826690152dfb4bc20b7efd06d69f5d9b17 (patch)
treea2ffdcdcc1c929a9f820d5ea5f423d4e088bff08 /src
parent4f952a3f07313e0373e568cb777cd90b27304b63 (diff)
parent84eada2f7fc1b9039f783653c592e52f5ccab48f (diff)
Merge pull request #3680 from joukewitteveen/pam-env
Follow up on #3503 (pass service env vars to PAM sessions)
Diffstat (limited to 'src')
-rw-r--r--src/core/execute.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 8cb18dbd5b..8c487b371f 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -835,7 +835,7 @@ static int setup_pam(
pam_handle_t *handle = NULL;
sigset_t old_ss;
int pam_code = PAM_SUCCESS, r;
- char **e = NULL;
+ char **nv, **e = NULL;
bool close_session = false;
pid_t pam_pid = 0, parent_pid;
int flags = 0;
@@ -870,8 +870,8 @@ static int setup_pam(
goto fail;
}
- STRV_FOREACH(e, *env) {
- pam_code = pam_putenv(handle, *e);
+ STRV_FOREACH(nv, *env) {
+ pam_code = pam_putenv(handle, *nv);
if (pam_code != PAM_SUCCESS)
goto fail;
}
@@ -1858,6 +1858,7 @@ static int exec_child(
*exit_status = EXIT_MEMORY;
return -ENOMEM;
}
+ accum_env = strv_env_clean(accum_env);
umask(context->umask);
@@ -2166,8 +2167,6 @@ static int exec_child(
return -ENOMEM;
}
- accum_env = strv_env_clean(accum_env);
-
if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) {
_cleanup_free_ char *line;