aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2020-07-13 14:06:28 +0000
committerSteve Wills <swills@FreeBSD.org>2020-07-13 14:06:28 +0000
commitf491d87f18482d70651c920df54b8ebb0fff6f90 (patch)
tree9d393e3be7fcc4898a625e0438fcfd3bd12d69f2
parentf46b591e8c0ee4a046724d1822abed59c3d7cbcc (diff)
downloadports-f491d87f18482d70651c920df54b8ebb0fff6f90.tar.gz
ports-f491d87f18482d70651c920df54b8ebb0fff6f90.zip
net/syncthing: add patch to fix issue 6827
Notes
Notes: svn path=/head/; revision=542134
-rw-r--r--net/syncthing/Makefile1
-rw-r--r--net/syncthing/files/patch-171.diff20
2 files changed, 21 insertions, 0 deletions
diff --git a/net/syncthing/Makefile b/net/syncthing/Makefile
index c610f7646bb5..a1bfc9822045 100644
--- a/net/syncthing/Makefile
+++ b/net/syncthing/Makefile
@@ -2,6 +2,7 @@
PORTNAME= syncthing
PORTVERSION= 1.7.0
+PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= net
MASTER_SITES= https://github.com/syncthing/syncthing/releases/download/v${PORTVERSION}/
diff --git a/net/syncthing/files/patch-171.diff b/net/syncthing/files/patch-171.diff
new file mode 100644
index 000000000000..a47fa95b05aa
--- /dev/null
+++ b/net/syncthing/files/patch-171.diff
@@ -0,0 +1,20 @@
+--- syncthing/lib/scanner/blocks.go.orig
++++ syncthing/lib/scanner/blocks.go
+@@ -108,12 +108,12 @@ func Blocks(ctx context.Context, r io.Reader, blocksize int, sizehint int64, cou
+ return blocks, nil
+ }
+
+-// Validate quickly validates buf against the cryptohash hash (if len(hash)>0)
+-// and the 32-bit hash weakHash (if not zero). It is satisfied if either hash
+-// matches, or neither is given.
++// Validate quickly validates buf against the 32-bit weakHash, if not zero,
++// else against the cryptohash hash, if len(hash)>0. It is satisfied if
++// either hash matches or neither hash is given.
+ func Validate(buf, hash []byte, weakHash uint32) bool {
+- if weakHash != 0 {
+- return adler32.Checksum(buf) == weakHash
++ if weakHash != 0 && adler32.Checksum(buf) == weakHash {
++ return true
+ }
+
+ if len(hash) > 0 {