Skip to content

Instantly share code, notes, and snippets.

Created May 12, 2017 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/66bc2f580d50d09c7f3a880b21c6ce4e to your computer and use it in GitHub Desktop.
Save anonymous/66bc2f580d50d09c7f3a880b21c6ce4e to your computer and use it in GitHub Desktop.
0001-fix-build-with-librsync-1.0.0.patch
From 9e87364a6e37d3ad6ea3c09058811419e431c174 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Thu, 11 May 2017 20:01:05 -0400
Subject: [PATCH 1/1] fix build with librsync-1.0.0
---
.gitignore | 3 +++
PKGBUILD | 13 +++++++++++--
rdiff-backup-1.2.8-librsync-1.0.0.patch | 20 ++++++++++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 .gitignore
create mode 100644 rdiff-backup-1.2.8-librsync-1.0.0.patch
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d725ba4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.tar.*
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
index 7cb308d..bcfdd78 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,8 +15,17 @@ optdepends=('pylibacl: access control list support'
'pyxattr: extended attribute support')
provides=('rdiff-backup')
conflicts=('rdiff-backup')
-source=(http://savannah.nongnu.org/download/$_pkgname/$_pkgname-$pkgver.tar.gz)
-md5sums=('e3ec506c01e12b693adb79751daa7c63')
+source=(
+ http://savannah.nongnu.org/download/$_pkgname/$_pkgname-$pkgver.tar.gz
+ file://rdiff-backup-1.2.8-librsync-1.0.0.patch
+)
+md5sums=('e3ec506c01e12b693adb79751daa7c63'
+ 'dbaf7d800ec81d78f0881e7caa438d1b')
+
+prepare() {
+ cd "${srcdir}/$_pkgname-$pkgver"
+ patch -Np1 -i ../rdiff-backup-1.2.8-librsync-1.0.0.patch
+}
package() {
cd "${srcdir}"/$_pkgname-$pkgver
diff --git a/rdiff-backup-1.2.8-librsync-1.0.0.patch b/rdiff-backup-1.2.8-librsync-1.0.0.patch
new file mode 100644
index 0000000..0aabbf3
--- /dev/null
+++ b/rdiff-backup-1.2.8-librsync-1.0.0.patch
@@ -0,0 +1,20 @@
+Patch by Roman Tereshonkov and Kari Hautio for rdiff-backup <= 1.2.8 to avoid a build failure with
+librsync >= 1.0.0 (which is a security bugfix release). The discussion and solution finding can be
+found at https://bugs.launchpad.net/duplicity/+bug/1416344 (for duplicity).
+
+--- rdiff-backup-1.2.8/_librsyncmodule.c 2009-03-16 15:36:21.000000000 +0100
++++ rdiff-backup-1.2.8-librsync-1.0.0/_librsyncmodule.c 2015-03-02 00:54:24.000000000 +0100
+@@ -59,8 +59,13 @@
+ if (sm == NULL) return NULL;
+ sm->x_attr = NULL;
+
++#ifdef RS_DEFAULT_STRONG_LEN
+ sm->sig_job = rs_sig_begin((size_t)blocklen,
+ (size_t)RS_DEFAULT_STRONG_LEN);
++#else
++ sm->sig_job = rs_sig_begin((size_t)blocklen,
++ (size_t)8, RS_MD4_SIG_MAGIC);
++#endif
+ return (PyObject*)sm;
+ }
+
--
2.12.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment