From d1e3bf01bce7d8502610532077f6f55c3df4de2c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 2 Dec 2015 18:13:33 +0100 Subject: daemon: Add 'buildMode' parameter to 'buildPaths' RPC --- src/nix-daemon/nix-daemon.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/nix-daemon/nix-daemon.cc') diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index e97d1dab17b2..c5e11afa1553 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -319,8 +319,17 @@ static void performOp(bool trusted, unsigned int clientVersion, case wopBuildPaths: { PathSet drvs = readStorePaths(from); + BuildMode mode = bmNormal; + if (GET_PROTOCOL_MINOR(clientVersion) >= 15) { + mode = (BuildMode)readInt(from); + + /* Repairing is not atomic, so disallowed for "untrusted" + clients. */ + if (mode == bmRepair && !trusted) + throw Error("repairing is not supported when building through the Nix daemon"); + } startWork(); - store->buildPaths(drvs); + store->buildPaths(drvs, mode); stopWork(); to << 1; break; -- cgit 1.4.1