Bug#870911: stretch-pu: package torsocks/2.2.0-1+deb9u1

2017-08-08 Thread intrigeri
Adam D. Barratt:
> Control: tags -1 + pending

> On Tue, 2017-08-08 at 12:00 -0400, Adam D. Barratt wrote:
>> Please go ahead.

> Uploaded and flagged for acceptance.

Thanks!



Bug#870911: stretch-pu: package torsocks/2.2.0-1+deb9u1

2017-08-08 Thread Adam D. Barratt
Control: tags -1 + pending

On Tue, 2017-08-08 at 12:00 -0400, Adam D. Barratt wrote:
> Control: tags -1 + confirmed
> 
> On Sun, 2017-08-06 at 08:32 -0400, intrigeri wrote:
> > A few Debian users let me know that the upgrade to Stretch broke some 
> > important
> > use cases of torsocks (most notably, the way some ISPs have set up
> > SMTP-over-Tor-Onion-Services between their email servers); the upstream 
> > author
> > (X-Debbugs-Cc'ed) says a great number of people also complained about 
> > various
> > bugs that share the same root cause.
> > 
> > I would like to fix this in Stretch.
> 
> Please go ahead.

Uploaded and flagged for acceptance.

Regards,

Adam



Bug#870911: stretch-pu: package torsocks/2.2.0-1+deb9u1

2017-08-08 Thread Adam D. Barratt
Control: tags -1 + confirmed

On Sun, 2017-08-06 at 08:32 -0400, intrigeri wrote:
> A few Debian users let me know that the upgrade to Stretch broke some 
> important
> use cases of torsocks (most notably, the way some ISPs have set up
> SMTP-over-Tor-Onion-Services between their email servers); the upstream author
> (X-Debbugs-Cc'ed) says a great number of people also complained about various
> bugs that share the same root cause.
> 
> I would like to fix this in Stretch.

Please go ahead.

Regards,

Adam



Bug#870911: stretch-pu: package torsocks/2.2.0-1+deb9u1

2017-08-06 Thread intrigeri
Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian@packages.debian.org
Usertags: pu

Hi!

A few Debian users let me know that the upgrade to Stretch broke some important
use cases of torsocks (most notably, the way some ISPs have set up
SMTP-over-Tor-Onion-Services between their email servers); the upstream author
(X-Debbugs-Cc'ed) says a great number of people also complained about various
bugs that share the same root cause.

I would like to fix this in Stretch.

To my request, the upstream author has started maintaining a maint-2.2.x branch
with only fixes to such serious bugs. Currently that branch has one single
commit, that fixes the root cause of the aforementioned issues. One of the
affected users (X-Debbugs-Cc'ed) has tested it and confirms the fix works
for him.

Can I upload to stretch-pu with the attached debdiff?

Cheers,
-- 
intrigeri
diff -Nru torsocks-2.2.0/debian/changelog torsocks-2.2.0/debian/changelog
--- torsocks-2.2.0/debian/changelog 2016-10-19 16:48:08.0 -0400
+++ torsocks-2.2.0/debian/changelog 2017-08-05 11:37:43.0 -0400
@@ -1,3 +1,14 @@
+torsocks (2.2.0-1+deb9u1) stretch; urgency=medium
+
+  * Fix-check_addr-to-return-either-0-or-1.patch: new patch, from upstream
+maint-0.2.x branch, to fix a serious bug reported many times upstream
+and to me (privately) since the Stretch release
+(http://bugs.torproject.org/20871).
+  * Adjust debian/gbp.conf to ease working on our Git branch dedicated
+to Stretch.
+
+ -- intrigeri   Sat, 05 Aug 2017 15:37:43 +
+
 torsocks (2.2.0-1) unstable; urgency=medium
 
   * New upstream release (Closes: #805741)
diff -Nru torsocks-2.2.0/debian/gbp.conf torsocks-2.2.0/debian/gbp.conf
--- torsocks-2.2.0/debian/gbp.conf  2016-10-19 16:48:08.0 -0400
+++ torsocks-2.2.0/debian/gbp.conf  2017-08-05 11:37:43.0 -0400
@@ -1,4 +1,4 @@
 [DEFAULT]
 pristine-tar = True
-debian-branch = master
+debian-branch = stretch
 upstream-branch = upstream
diff -Nru 
torsocks-2.2.0/debian/patches/Fix-check_addr-to-return-either-0-or-1.patch 
torsocks-2.2.0/debian/patches/Fix-check_addr-to-return-either-0-or-1.patch
--- torsocks-2.2.0/debian/patches/Fix-check_addr-to-return-either-0-or-1.patch  
1969-12-31 19:00:00.0 -0500
+++ torsocks-2.2.0/debian/patches/Fix-check_addr-to-return-either-0-or-1.patch  
2017-08-05 11:37:43.0 -0400
@@ -0,0 +1,97 @@
+Bug: http://bugs.torproject.org/20871
+Origin: upstream, 
https://gitweb.torproject.org/torsocks.git/commit/?h=maint-2.2.x=15465aa7ace1d5e6dbb58e7adf37933b48e20250
+From: David Goulet 
+Date: Fri, 24 Feb 2017 11:02:13 -0500
+Subject: Fix check_addr() to return either 0 or 1
+
+This function is used by utils_is_address_ipv4/6 and has to return 0 on
+error or 1 on success.
+
+Fixes #20871
+
+Signed-off-by: David Goulet 
+---
+ src/common/utils.c| 11 ++-
+ tests/unit/test_config-file.c |  4 ++--
+ tests/unit/test_utils.c   |  8 
+ 3 files changed, 12 insertions(+), 11 deletions(-)
+
+diff --git a/src/common/utils.c b/src/common/utils.c
+index 82479af..8fe9c6e 100644
+--- a/src/common/utils.c
 b/src/common/utils.c
+@@ -45,8 +45,8 @@ static const char *localhost_names_v6[] = {
+ };
+ 
+ /*
+- * Return 1 if the given IP belongs in the af domain else return a negative
+- * value.
++ * Return 1 if the given IP belongs in the af domain else return 0 if the
++ * given ip is not a valid address or the af value is unknown.
+  */
+ static int check_addr(const char *ip, int af)
+ {
+@@ -56,9 +56,10 @@ static int check_addr(const char *ip, int af)
+   assert(ip);
+ 
+   ret = inet_pton(af, ip, buf);
+-  if (ret != 1) {
+-  ret = -1;
+-  }
++  if (ret == -1) {
++/* Possible if the af value is unknown to inet_pton. */
++ret = 0;
++  }
+ 
+   return ret;
+ }
+diff --git a/tests/unit/test_config-file.c b/tests/unit/test_config-file.c
+index 59e3115..b48094c 100644
+--- a/tests/unit/test_config-file.c
 b/tests/unit/test_config-file.c
+@@ -104,13 +104,13 @@ static void test_config_file_read_invalid_values(void)
+ 
+   memset(, 0x0, sizeof(config));
+   ret = config_file_read(fixture("config4"), );
+-  ok(ret == -1 &&
++  ok(ret == 0 &&
+   config.conf_file.tor_address == NULL,
+   "TorAddress invalid IPv4 returns -1");
+ 
+   memset(, 0x0, sizeof(config));
+   ret = config_file_read(fixture("config5"), );
+-  ok(ret == -1 &&
++  ok(ret == 0 &&
+   config.conf_file.tor_address == NULL,
+   "TorAddress invalid IPv6 returns -1");
+ 
+diff --git a/tests/unit/test_utils.c b/tests/unit/test_utils.c
+index dc5b0ca..95469d8 100644
+--- a/tests/unit/test_utils.c
 b/tests/unit/test_utils.c
+@@ -36,10 +36,10 @@ static void test_is_address_ipv4(void)
+   ok(ret == 1, "Valid IPv4 address");
+ 
+   ret =