Package: twinkle
Version: 1:1.9.0+dfsg-3
Followup-For: Bug #821234
User: [email protected]
Usertags: origin-ubuntu yakkety ubuntu-patch
Dear Maintainer,
In Ubuntu, the attached patch was applied to achieve the following:
* debian/patches/ucommon-7.0.patch: Grab patch from upstream Git to fix
FTBFS with uCommon 7.0.
Thanks for considering the patch.
Logan Rosen
-- System Information:
Debian Release: stretch/sid
APT prefers xenial-updates
APT policy: (500, 'xenial-updates'), (500, 'xenial-security'), (500,
'xenial'), (100, 'xenial-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.4.0-21-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL
set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru twinkle-1.9.0+dfsg/debian/patches/series twinkle-1.9.0+dfsg/debian/patches/series
--- twinkle-1.9.0+dfsg/debian/patches/series 2016-01-12 05:37:32.000000000 -0500
+++ twinkle-1.9.0+dfsg/debian/patches/series 2016-05-05 19:02:53.000000000 -0400
@@ -13,3 +13,4 @@
historyform-disable-editing.patch
historyform-show-call-details-of-current-item.patch
fix-conflicting-definition-of-socklen_t-on-gnu-hurd.patch
+ucommon-7.0.patch
diff -Nru twinkle-1.9.0+dfsg/debian/patches/ucommon-7.0.patch twinkle-1.9.0+dfsg/debian/patches/ucommon-7.0.patch
--- twinkle-1.9.0+dfsg/debian/patches/ucommon-7.0.patch 1969-12-31 19:00:00.000000000 -0500
+++ twinkle-1.9.0+dfsg/debian/patches/ucommon-7.0.patch 2016-05-05 19:02:00.000000000 -0400
@@ -0,0 +1,78 @@
+From 60e8be6ad116896bdd612b7e6aaa5623dc303a4e Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <[email protected]>
+Date: Thu, 7 Jan 2016 14:48:02 +0100
+Subject: [PATCH] fix build with ucommon 7.0
+
+New version of ucommon adds some restriction to Digest class which
+break the way twinkle is using it:
+
+- proper initialization using constructor is needed
+- c_str() method is gone; fortunately, str() result can be used to
+ initialize std::string instead
+
+Neither of these changes breaks build with ucommon 6.x.
+---
+ src/parser/request.cpp | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/parser/request.cpp b/src/parser/request.cpp
+index 550a011..348d679 100644
+--- a/src/parser/request.cpp
++++ b/src/parser/request.cpp
+@@ -207,19 +207,19 @@ bool t_request::authorize_md5(const t_digest_challenge &dchlg,
+ A2 = method2str(method, unknown_method) + ":" + uri.encode();
+ A2 += ":";
+ if (body) {
+- digest_t MD5body = "md5";
++ digest_t MD5body("md5");
+ MD5body.puts(body->encode().c_str());
+- A2 += std::string(MD5body.c_str());
++ A2 += std::string(MD5body.str());
+ } else {
+- digest_t MD5body = "md5";
++ digest_t MD5body("md5");
+ MD5body.puts("");
+- A2 += std::string(MD5body.c_str());
++ A2 += std::string(MD5body.str());
+ }
+ }
+ // RFC 2716 3.2.2.1
+ // Caculate digest
+- digest_t MD5A1 = "md5";
+- digest_t MD5A2 = "md5";
++ digest_t MD5A1("md5");
++ digest_t MD5A2("md5");
+
+ MD5A1.puts(A1.c_str());
+ MD5A2.puts(A2.c_str());
+@@ -227,24 +227,24 @@ bool t_request::authorize_md5(const t_digest_challenge &dchlg,
+ std::string x;
+
+ if (cmp_nocase(qop, QOP_AUTH) == 0 || cmp_nocase(qop, QOP_AUTH_INT) == 0) {
+- x = std::string(MD5A1.c_str());
++ x = std::string(MD5A1.str());
+ x += ":";
+ x += dchlg.nonce + ":";
+ x += int2str(nc, "%08x") + ":";
+ x += cnonce + ":";
+ x += qop + ":";
+- x += std::string(MD5A2.c_str());
++ x += std::string(MD5A2.str());
+ } else {
+- x = std::string(MD5A1.c_str());
++ x = std::string(MD5A1.str());
+ x += ":";
+ x += dchlg.nonce + ":";
+- x += std::string(MD5A2.c_str());
++ x += std::string(MD5A2.str());
+ }
+
+- digest_t digest = "md5";
++ digest_t digest("md5");
+ digest.puts(x.c_str());
+
+- resp = std::string(digest.c_str());
++ resp = std::string(digest.str());
+
+ return true;
+ }