mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user