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:
commit
da62528487
8 changed files with 256 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue