aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorAndrew Brooks <andrew.brooks@flightaware.com>2022-09-02 18:32:35 -0500
committerAndrew Brooks <andrew.brooks@flightaware.com>2022-09-02 18:32:35 -0500
commit1f041ac54f43093e4f4df1caa630d491ff51c3f8 (patch)
tree463edd6cf8237698a7a21b030757eae9374d067b /src/libstore/local-store.cc
parent0c7f213c87c11c6c0f6b2fa07ba96548f6ea85ad (diff)
Prevent tempdir from being GC-ed before addToStoreFromDump has renamed it
This fixes issue 6823 by placing the tempdir used in LocalStore::addToStoreFromDump outside the Nix store, where automatic GC is no longer a concern.
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index a272e4301..6abd52683 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -1388,7 +1388,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, std::string_view name
StringSource dumpSource { dump };
ChainSource bothSource { dumpSource, source };
- auto tempDir = createTempDir(realStoreDir, "add");
+ auto tempDir = createTempDir("", "add");
delTempDir = std::make_unique<AutoDelete>(tempDir);
tempPath = tempDir + "/x";