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.000000000 -0400 +++ torsocks-2.2.0/debian/changelog 2017-08-05 11:37:43.000000000 -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 <intrig...@debian.org> Sat, 05 Aug 2017 15:37:43 +0000 + 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.000000000 -0400 +++ torsocks-2.2.0/debian/gbp.conf 2017-08-05 11:37:43.000000000 -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.000000000 -0500 +++ torsocks-2.2.0/debian/patches/Fix-check_addr-to-return-either-0-or-1.patch 2017-08-05 11:37:43.000000000 -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&id=15465aa7ace1d5e6dbb58e7adf37933b48e20250 +From: David Goulet <dgou...@ev0ke.net> +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 <dgou...@ev0ke.net> +--- + 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(&config, 0x0, sizeof(config)); + ret = config_file_read(fixture("config4"), &config); +- ok(ret == -1 && ++ ok(ret == 0 && + config.conf_file.tor_address == NULL, + "TorAddress invalid IPv4 returns -1"); + + memset(&config, 0x0, sizeof(config)); + ret = config_file_read(fixture("config5"), &config); +- 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 = utils_is_address_ipv4("127.0.0.256"); +- ok(ret == -1, "Invalid IPv4 address"); ++ ok(ret == 0, "Invalid IPv4 address"); + + ret = utils_is_address_ipv4("::1"); +- ok(ret == -1, "Invalid IPv4 address when IPv6"); ++ ok(ret == 0, "Invalid IPv4 address when IPv6"); + } + + static void test_is_address_ipv6(void) +@@ -55,10 +55,10 @@ static void test_is_address_ipv6(void) + ok(ret == 1, "Valid IPv6 address"); + + ret = utils_is_address_ipv6("2001:DB8:0:0:8:800:200C:G"); +- ok(ret == -1, "Invalid IPv6 address"); ++ ok(ret == 0, "Invalid IPv6 address"); + + ret = utils_is_address_ipv6("192.168.0.1"); +- ok(ret == -1, "Invalid IPv6 address when IPv4"); ++ ok(ret == 0, "Invalid IPv6 address when IPv4"); + } + + static void test_localhost_resolve(void) diff -Nru torsocks-2.2.0/debian/patches/series torsocks-2.2.0/debian/patches/series --- torsocks-2.2.0/debian/patches/series 2016-10-19 16:48:08.000000000 -0400 +++ torsocks-2.2.0/debian/patches/series 2017-08-05 11:37:43.000000000 -0400 @@ -1 +1,2 @@ +Fix-check_addr-to-return-either-0-or-1.patch exclude_test_requiring_network.patch