1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 13:51:16 +02:00

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

libstore: fix race condition when creating state directories
This commit is contained in:
Eelco Dolstra 2025-06-17 11:33:29 +02:00 committed by GitHub
commit bb32fcdf30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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"}) {