From c22a7f50cb4a476f0c276d8e0d2194da5144ce92 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 24 May 2024 20:45:05 -0600 Subject: 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 --- src/libstore/worker-protocol.hh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libstore/worker-protocol.hh') diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index cc083a551..5f24c189f 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -72,6 +72,10 @@ struct WorkerProto struct ReadConn { Source & from; Version version; + + ReadConn(Source & from, Version version) : from(from), version(version) { + assert(version >= MIN_SUPPORTED_WORKER_PROTO_VERSION); + } }; /** @@ -81,6 +85,10 @@ struct WorkerProto struct WriteConn { Sink & to; Version version; + + WriteConn(Sink & to, Version version) : to(to), version(version) { + assert(version >= MIN_SUPPORTED_WORKER_PROTO_VERSION); + } }; /** -- cgit v1.2.3