aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-05-18 17:48:27 +0200
committereldritch horrors <pennae@lix.systems>2024-05-19 11:57:55 +0000
commit774c56094f3f3dcb1f25fe147c52604ad664bd5b (patch)
tree83e46e6118cd9162aada6beed792e786db84e814
parent139d31f87658c420622f6880a4bdfee8b522f87c (diff)
libstore: fix old RemoteStore::addToStore serializer
having the serializer write into `*conn` is not legal because we are in a sinkToSource that will be drained by the remote we're connected to. writing into `*conn` directly can break the framing protocol. it is unlikely this code was ever run: to protocol it caters to is from 2016(!) and thoroughly untested in-tree, and since it's been present since nix 2.17 and the 1.18 protocol broken here is nix 2.0 we might safely assume that daemons older than nix 2.1 are no longer used now see also #325 (though that wants <2.3 gone, this is sadly only <2.1) Change-Id: I9d674c18f6d802f61c5d85dfd9608587b73e70a5
-rw-r--r--src/libstore/remote-store.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 1cdfdb925..22d87b027 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -509,7 +509,8 @@ void RemoteStore::addToStore(const ValidPathInfo & info, Source & source,
sink
<< exportMagic
<< printStorePath(info.path);
- WorkerProto::write(*this, *conn, info.references);
+ WorkerProto::WriteConn nested { .to = sink, .version = conn->daemonVersion };
+ WorkerProto::write(*this, nested, info.references);
sink
<< (info.deriver ? printStorePath(*info.deriver) : "")
<< 0 // == no legacy signature