1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 15:48:00 +02:00

Improve symlink handling

This commit is contained in:
Eelco Dolstra 2022-05-17 13:56:26 +02:00
parent 2a53574675
commit df2aa29690
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 51 additions and 22 deletions

View file

@ -1376,7 +1376,8 @@ static void prim_storePath(EvalState & state, const PosIdx pos, Value * * args,
/* Resolve symlinks in path, unless path itself is a symlink
directly in the store. The latter condition is necessary so
e.g. nix-push does the right thing. */
if (!state.store->isStorePath(path.abs())) path = path.resolveSymlinks();
if (!state.store->isStorePath(path.abs()))
path = CanonPath(canonPath(path.abs(), true));
if (!state.store->isInStore(path.abs()))
throw EvalError({
.msg = hintfmt("path '%1%' is not in the Nix store", path),