mirror of
https://github.com/systemd/systemd
synced 2024-07-21 10:17:21 +00:00
core: set $CREDENTIALS_DIRECTORY only when we set up credentials
It is not necessary to set the environment variable on an execution step we do not support credentials.
This commit is contained in:
parent
7d202fb35d
commit
fbaf3b23ae
|
@ -2041,7 +2041,9 @@ static int build_environment(
|
|||
our_env[n_env++] = x;
|
||||
}
|
||||
|
||||
if (exec_context_has_credentials(c) && p->prefix[EXEC_DIRECTORY_RUNTIME]) {
|
||||
if (exec_context_has_credentials(c) &&
|
||||
p->prefix[EXEC_DIRECTORY_RUNTIME] &&
|
||||
FLAGS_SET(p->flags, EXEC_WRITE_CREDENTIALS)) {
|
||||
x = strjoin("CREDENTIALS_DIRECTORY=", p->prefix[EXEC_DIRECTORY_RUNTIME], "/credentials/", u->id);
|
||||
if (!x)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Reference in a new issue