* Allow unprivileged users to run the garbage collector and to do

`nix-store --delete'.  But unprivileged users are not allowed to
  ignore liveness.
* `nix-store --delete --ignore-liveness': ignore the runtime roots as
  well.
This commit is contained in:
Eelco Dolstra 2006-12-05 02:18:46 +00:00
parent 29cf434a35
commit a9c4f66cfb
16 changed files with 106 additions and 56 deletions

View file

@ -3,7 +3,6 @@
#include "globals.hh"
#include "misc.hh"
#include "gc.hh"
#include "archive.hh"
#include "shared.hh"
#include "dotgraph.hh"
@ -573,7 +572,7 @@ static void opGC(Strings opFlags, Strings opArgs)
PathSet result;
PrintFreed freed(action == gcDeleteDead || action == gcReturnDead,
action == gcReturnDead);
collectGarbage(action, PathSet(), false, result, freed.bytesFreed);
store->collectGarbage(action, PathSet(), false, result, freed.bytesFreed);
if (action != gcDeleteDead) {
for (PathSet::iterator i = result.begin(); i != result.end(); ++i)
@ -601,7 +600,7 @@ static void opDelete(Strings opFlags, Strings opArgs)
PathSet dummy;
PrintFreed freed(true, false);
collectGarbage(gcDeleteSpecific, pathsToDelete, ignoreLiveness,
store->collectGarbage(gcDeleteSpecific, pathsToDelete, ignoreLiveness,
dummy, freed.bytesFreed);
}