mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Fix SourcePath::resolveSymlinks()
This fixes handling of symlinks that start with '..', and symlink targets that contain symlinks themselves.
This commit is contained in:
parent
9c6ede85fc
commit
f5c6b29940
2 changed files with 24 additions and 12 deletions
|
@ -35,3 +35,9 @@ nix-instantiate --eval -E 'assert 1 + 2 == 3; true'
|
|||
# Check that symlink cycles don't cause a hang.
|
||||
ln -sfn cycle.nix $TEST_ROOT/cycle.nix
|
||||
(! nix eval --file $TEST_ROOT/cycle.nix)
|
||||
|
||||
# Check that relative symlinks are resolved correctly.
|
||||
mkdir -p $TEST_ROOT/xyzzy $TEST_ROOT/foo
|
||||
ln -sfn ../xyzzy $TEST_ROOT/foo/bar
|
||||
printf 123 > $TEST_ROOT/xyzzy/default.nix
|
||||
[[ $(nix eval --impure --expr "import $TEST_ROOT/foo/bar") = 123 ]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue