mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
[Backport staging-24.05] stdenv: make sure the env-vars
file created is not world readable (#332347)
This commit is contained in:
commit
2487134aaf
@ -981,7 +981,13 @@ substituteAllInPlace() {
|
||||
# the environment used for building.
|
||||
dumpVars() {
|
||||
if [ "${noDumpEnvVars:-0}" != 1 ]; then
|
||||
export 2>/dev/null >| "$NIX_BUILD_TOP/env-vars" || true
|
||||
# On darwin, install(1) cannot be called with /dev/stdin or fd from process substitution
|
||||
# so first we create the file and then write to it
|
||||
# See https://github.com/NixOS/nixpkgs/issues/335016
|
||||
{
|
||||
install -m 0600 /dev/null "$NIX_BUILD_TOP/env-vars" &&
|
||||
export 2>/dev/null >| "$NIX_BUILD_TOP/env-vars"
|
||||
} || true
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user