1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

Merge pull request #13637 from NixOS/mergify/bp/2.29-maintenance/pr-13368

libstore: fix race condition when creating state directories (backport #13368)
This commit is contained in:
mergify[bot] 2025-07-31 01:49:39 +00:00 committed by GitHub
commit 2968e18d37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -130,7 +130,7 @@ LocalStore::LocalStore(ref<const Config> config)
Path gcRootsDir = config->stateDir + "/gcroots"; Path gcRootsDir = config->stateDir + "/gcroots";
if (!pathExists(gcRootsDir)) { if (!pathExists(gcRootsDir)) {
createDirs(gcRootsDir); createDirs(gcRootsDir);
createSymlink(profilesDir, gcRootsDir + "/profiles"); replaceSymlink(profilesDir, gcRootsDir + "/profiles");
} }
for (auto & perUserDir : {profilesDir + "/per-user", gcRootsDir + "/per-user"}) { for (auto & perUserDir : {profilesDir + "/per-user", gcRootsDir + "/per-user"}) {