about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-07T23·27+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-07T23·27+0000
commit6833e8bbe89dc61bda59a1e04c01415501ad4133 (patch)
treea053486be8689a83792478580396f012347acb4f /src/libstore/build.cc
parente24d0201c29b09483944b462bd62b71a90c99c97 (diff)
* When keeping the temporary build directory (-K), change the owner
  back to the Nix account.

Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 0d2879cc94a5..9f3420c684b6 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1698,10 +1698,13 @@ void DerivationGoal::initChild()
 void DerivationGoal::deleteTmpDir(bool force)
 {
     if (tmpDir != "") {
-        if (keepFailed && !force)
+        if (keepFailed && !force) {
 	    printMsg(lvlError, 
 		format("builder for `%1%' failed; keeping build directory `%2%'")
                 % drvPath % tmpDir);
+            if (buildUser.enabled() && !amPrivileged())
+                getOwnership(tmpDir);
+        }
         else
             deletePathWrapped(tmpDir);
         tmpDir = "";