diff -Nru tgt-1.0.63/debian/changelog tgt-1.0.63/debian/changelog --- tgt-1.0.63/debian/changelog 2016-03-30 06:34:21.000000000 +0000 +++ tgt-1.0.63/debian/changelog 2016-04-25 07:15:55.000000000 +0000 @@ -1,3 +1,10 @@ +tgt (1:1.0.63-1ubuntu2) yakkety; urgency=medium + + * debian/patches/util_strtoull_errno.patch by Stas Sergeev + - Fix errno handling for number * parsing (LP: #1547060) + + -- Ryan Harper Thu, 21 Apr 2016 09:13:09 -0500 + tgt (1:1.0.63-1ubuntu1) xenial; urgency=medium * Merge from Debian (LP: #1555700). Remaining changes: diff -Nru tgt-1.0.63/debian/patches/series tgt-1.0.63/debian/patches/series --- tgt-1.0.63/debian/patches/series 2016-03-30 06:20:59.000000000 +0000 +++ tgt-1.0.63/debian/patches/series 2016-04-25 07:15:44.000000000 +0000 @@ -3,3 +3,4 @@ use-dpkg-buildflags.patch do-not-build-html-manpages.patch fix-aio-detection.patch +util_strtoull_errno.patch diff -Nru tgt-1.0.63/debian/patches/util_strtoull_errno.patch tgt-1.0.63/debian/patches/util_strtoull_errno.patch --- tgt-1.0.63/debian/patches/util_strtoull_errno.patch 1970-01-01 00:00:00.000000000 +0000 +++ tgt-1.0.63/debian/patches/util_strtoull_errno.patch 2016-04-25 07:15:44.000000000 +0000 @@ -0,0 +1,37 @@ +Description: fix errno check in util.h preventing numeric arg parsing + From 3f3991ee3345f9728928711f6be7a0020568faf6 Mon Sep 17 00:00:00 2001 + From: Stas Sergeev + Date: Thu, 18 Feb 2016 18:35:23 +0300 + Subject: [PATCH] fix errno check + + errno can only be checked if the return value indicates an error. + The result of this bug is the following: + + ./tgtd -d 1 + -d argument value '1' invalid + Try `tgtd --help' for more information. + + As can be seen, it rejects the valid parameter because errno just + happens to be non-zero. +Author: Stas Sergeev +Origin: https://github.com/fujita/tgt/pull/18/commits/3f3991ee3345f9728928711f6be7a0020568faf6 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/tgt/+bug/1547060 +Last-Update: 20160421 + +--- + usr/util.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usr/util.h b/usr/util.h +index 0e34c35..019ff1c 100644 +--- a/usr/util.h ++++ b/usr/util.h +@@ -148,7 +148,7 @@ struct signalfd_siginfo { + unsigned long long ull_val; \ + ull_val = strtoull(str, &ptr, 0); \ + val = (typeof(val)) ull_val; \ +- if (errno || ptr == str) \ ++ if (ull_val == ULONG_MAX || ptr == str) \ + ret = EINVAL; \ + else if (val != ull_val) \ + ret = ERANGE; \