stdenv: make sure the env-vars file created is not world readable

Under some circumstances this file might contain private information
that should not be accessible to everybody.
This commit is contained in:
Thomas Gerbet
2024-08-01 19:26:05 +02:00
parent a6ec55d1e6
commit c47a1e701d
+1 -1
View File
@@ -1044,7 +1044,7 @@ substituteAllInPlace() {
# the environment used for building.
dumpVars() {
if [ "${noDumpEnvVars:-0}" != 1 ]; then
export 2>/dev/null >| "$NIX_BUILD_TOP/env-vars" || true
install -m 0600 <(export 2>/dev/null) "$NIX_BUILD_TOP/env-vars" || true
fi
}