From 74033a844fe57e3e91c71ae37f9a65f6b2f22aa9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Dec 2006 23:29:16 +0000 Subject: * Add indirect root registration to the protocol so that unprivileged processes can register indirect roots. Of course, there is still the problem that the garbage collector can only read the targets of the indirect roots when it's running as root... --- src/nix-worker/main.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nix-worker/main.cc') diff --git a/src/nix-worker/main.cc b/src/nix-worker/main.cc index c8abe14299..80db782e90 100644 --- a/src/nix-worker/main.cc +++ b/src/nix-worker/main.cc @@ -269,6 +269,15 @@ static void performOp(Source & from, Sink & to, unsigned int op) break; } + case wopAddIndirectRoot: { + Path path = absPath(readString(from)); + startWork(); + store->addIndirectRoot(path); + stopWork(); + writeInt(1, to); + break; + } + case wopSyncWithGC: { startWork(); store->syncWithGC(); @@ -473,6 +482,7 @@ void run(Strings args) else if (daemon) { if (setuidMode) throw Error("daemon cannot be started in setuid mode"); + chdir("/"); daemonLoop(); } -- cgit 1.4.1