Merge pull request #13368 from wolfgangwalther/race-state-creation

libstore: fix race condition when creating state directories
This commit is contained in:
Eelco Dolstra authored and GitHub committed 2025-06-17 11:33:29 +02:00
commit bb32fcdf30
1 file changed
+1 -1
+1 -1
View File
@@ -133,7 +133,7 @@ LocalStore::LocalStore(ref<const Config> config)
Path gcRootsDir = config->stateDir + "/gcroots";
if (!pathExists(gcRootsDir)) {
createDirs(gcRootsDir);
createSymlink(profilesDir, gcRootsDir + "/profiles");
replaceSymlink(profilesDir, gcRootsDir + "/profiles");
}
for (auto & perUserDir : {profilesDir + "/per-user", gcRootsDir + "/per-user"}) {