diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index bdd6891ac2f8..44f3845b45af 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -430,7 +430,8 @@ Path RemoteStore::addTextToStore(const string & name, const string & s, openConnection(); writeInt(wopAddTextToStore, to); - writeString(userName, to); + if (GET_PROTOCOL_MINOR(daemonVersion) >= 15) + writeString(userName, to); writeString(name, to); writeString(s, to); writeStrings(references, to); diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index c7d3a726ab4c..7561d511a805 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -6,7 +6,7 @@ namespace nix { #define WORKER_MAGIC_1 0x6e697863 #define WORKER_MAGIC_2 0x6478696f -#define PROTOCOL_VERSION 0x10e +#define PROTOCOL_VERSION 0x10f #define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00) #define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff) diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 01f0c3ccb67a..68e76b464c66 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -284,7 +284,9 @@ static void performOp(bool trusted, unsigned int clientVersion, } case wopAddTextToStore: { - string userName = readString(from); + string userName = publicUserName(); + if (GET_PROTOCOL_MINOR(clientVersion) >= 15) + userName = readString(from); string suffix = readString(from); string s = readString(from); PathSet refs = readStorePaths(from);