* 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...
This commit is contained in:
parent
0d40f6d7bb
commit
74033a844f
7 changed files with 42 additions and 6 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue