diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-05-24 20:45:05 -0600 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-06-16 19:15:08 -0700 |
commit | c22a7f50cb4a476f0c276d8e0d2194da5144ce92 (patch) | |
tree | 2fe48d0c3c57c90394c9f834306c4cac67a10360 /src/libstore/remote-store.cc | |
parent | 985ce8a865e39857e5c582588ccf5eed90fd0fc8 (diff) |
libstore: refuse to serialise ancient protocols
We don't want to deal with these at all, let's stop doing so.
(marking this one as the fix commit since its immediate predecessors
aren't the complete fix)
Fixes: https://git.lix.systems/lix-project/lix/issues/325
Change-Id: Ieea1b0b8ac0f903d1e24e5b3e63cfe12eeec119d
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 82181b921..d445cbcb6 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -466,7 +466,7 @@ void RemoteStore::addToStore(const ValidPathInfo & info, Source & source, sink << exportMagic << printStorePath(info.path); - WorkerProto::WriteConn nested { .to = sink, .version = conn->daemonVersion }; + WorkerProto::WriteConn nested { sink, conn->daemonVersion }; WorkerProto::write(*this, nested, info.references); sink << (info.deriver ? printStorePath(*info.deriver) : "") @@ -511,14 +511,13 @@ void RemoteStore::addMultipleToStore( RepairFlag repair, CheckSigsFlag checkSigs) { + auto remoteVersion = getProtocol(); + auto source = sinkToSource([&](Sink & sink) { sink << pathsToCopy.size(); for (auto & [pathInfo, pathSource] : pathsToCopy) { WorkerProto::Serialise<ValidPathInfo>::write(*this, - WorkerProto::WriteConn { - .to = sink, - .version = 16, - }, + WorkerProto::WriteConn {sink, remoteVersion}, pathInfo); pathSource->drainInto(sink); } |