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:
+3
-1
@@ -2041,7 +2041,9 @@ static int build_environment(
|
|||||||
our_env[n_env++] = x;
|
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);
|
x = strjoin("CREDENTIALS_DIRECTORY=", p->prefix[EXEC_DIRECTORY_RUNTIME], "/credentials/", u->id);
|
||||||
if (!x)
|
if (!x)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user