* In the garbage collector, if deleting a path fails, try to fix its
ownership, then try again.
This commit is contained in:
parent
a0a43c3206
commit
ec23ecc64d
3 changed files with 31 additions and 6 deletions
|
|
@ -710,7 +710,18 @@ void deleteFromStore(const Path & _path, unsigned long long & bytesFreed)
|
|||
}
|
||||
txn.commit();
|
||||
|
||||
deletePath(path, bytesFreed);
|
||||
try {
|
||||
/* First try to delete it ourselves. */
|
||||
deletePath(path, bytesFreed);
|
||||
} catch (SysError & e) {
|
||||
/* If this failed due to a permission error, then try it with
|
||||
the setuid helper. */
|
||||
if (haveBuildUsers() && !amPrivileged()) {
|
||||
getOwnership(path);
|
||||
deletePath(path, bytesFreed);
|
||||
} else
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue