1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Merge pull request from GHSA-2ffj-w4mj-pg37

Copy built outputs
This commit is contained in:
Eelco Dolstra 2024-03-07 11:56:24 +01:00 committed by GitHub
commit da62528487
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 256 additions and 1 deletions

View file

@ -2544,6 +2544,12 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
[&](const DerivationOutput::CAFixed & dof) {
auto & wanted = dof.ca.hash;
// Replace the output by a fresh copy of itself to make sure
// that there's no stale file descriptor pointing to it
Path tmpOutput = actualPath + ".tmp";
renameFile(actualPath, tmpOutput);
copyFile(tmpOutput, actualPath, true);
auto newInfo0 = newInfoFromCA(DerivationOutput::CAFloating {
.method = dof.ca.method,
.hashAlgo = wanted.algo,