diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-05-31 20:12:59 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-05-31 20:12:59 +0200 |
commit | 7adb10d29b0041a93d1afeec197bf9af6e8b25b5 (patch) | |
tree | 780906be0c6f9c188c032c7e4229cb0eb32dc320 /src/libexpr | |
parent | 9169046e64cbffd85a445ebe4313b172a6681646 (diff) |
Fix reading the lockfile of a flake in a subdirectory
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops/flake.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc index af7d51834..235e10922 100644 --- a/src/libexpr/primops/flake.cc +++ b/src/libexpr/primops/flake.cc @@ -482,9 +482,12 @@ ResolvedFlake resolveFlake(EvalState & state, const FlakeRef & topRef, HandleLoc Flake flake = getFlake(state, topRef, allowedToUseRegistries(handleLockFile, true)); LockFile oldLockFile; - if (!recreateLockFile (handleLockFile)) { + if (!recreateLockFile(handleLockFile)) { // If recreateLockFile, start with an empty lockfile - oldLockFile = readLockFile(flake.sourceInfo.storePath + "/flake.lock"); // FIXME: symlink attack + // FIXME: symlink attack + oldLockFile = readLockFile( + state.store->toRealPath(flake.sourceInfo.storePath) + + "/" + flake.sourceInfo.resolvedRef.subdir + "/flake.lock"); } LockFile lockFile(oldLockFile); |