zbackup: fix

The upstream proposed fix doesn't apply cleanly, so here's a version
that does.
This commit is contained in:
Harrison Houghton 2021-10-18 20:48:57 -04:00
parent a3f85aedb1
commit 3b46f18b02
2 changed files with 22 additions and 1 deletions

View file

@ -1,4 +1,8 @@
{ lib, stdenv, fetchFromGitHub, cmake, zlib, openssl, protobuf, protobufc, lzo, libunwind }:
{ lib, stdenv, fetchFromGitHub, fetchpatch
, cmake, protobufc
, libunwind, lzo, openssl, protobuf, zlib
}:
stdenv.mkDerivation rec {
pname = "zbackup";
version = "1.4.4";
@ -10,6 +14,12 @@ stdenv.mkDerivation rec {
hash = "sha256-9Fk4EhEeQ2J4Kirc7oad4CzmW70Mmza6uozd87qfgZI=";
};
patches = [
# compare with https://github.com/zbackup/zbackup/pull/158;
# but that doesn't apply cleanly to this version
./protobuf-api-change.patch
];
buildInputs = [ zlib openssl protobuf lzo libunwind ];
nativeBuildInputs = [ cmake protobufc ];

View file

@ -0,0 +1,11 @@
--- a/backup_restorer.cc
+++ b/backup_restorer.cc
@@ -48,7 +48,7 @@
// TODO: this disables size checks for each separate message. Figure a better
// way to do this while keeping them enabled. It seems we need to create an
// instance of CodedInputStream for each message, but it might be expensive
- cis.SetTotalBytesLimit( backupData.size(), -1 );
+ cis.SetTotalBytesLimit( backupData.size() );
// Used when emitting chunks
string chunk;