1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 19:23:54 +02:00

Properly return false on builtins.pathExists /someNonAllowedPath

Follow-up from https://github.com/NixOS/nix/pull/5807 to fix https://github.com/NixOS/nix/pull/5807#issuecomment-1000135394
This commit is contained in:
regnat 2021-12-23 10:35:09 +01:00
parent 7feb741e00
commit dc89dfa7b3
2 changed files with 25 additions and 7 deletions

View file

@ -11,6 +11,9 @@ missingImpureErrorMsg=$(! nix eval --expr 'builtins.readFile ./pure-eval.sh' 2>&
echo "$missingImpureErrorMsg" | grep -q -- --impure || \
fail "The error message should mention the “--impure” flag to unblock users"
[[ $(nix eval --expr 'builtins.pathExists ./pure-eval.sh') == false ]] || \
fail "Calling 'pathExists' on a non-authorised path should return false"
(! nix eval --expr builtins.currentTime)
(! nix eval --expr builtins.currentSystem)