Skip to content

Commit

Permalink
Ensure that newer versions of Nix can communicate with older versions…
Browse files Browse the repository at this point in the history
… of the nix-daemon.
  • Loading branch information
nbp committed Aug 25, 2014
1 parent 5cd687c commit cea9f58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/libstore/remote-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/libstore/worker-protocol.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion src/nix-daemon/nix-daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathSet>(from);
Expand Down

0 comments on commit cea9f58

Please sign in to comment.