From 603d32f595282394108c5c9460667b55bfa1430d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 30 Mar 2021 12:53:54 -0400 Subject: [PATCH] import tang-7-6.el8 --- ...s-unless-the-issue-was-with-with-tan.patch | 38 +++++++++++++++++++ SPECS/tang.spec | 11 ++++-- 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 SOURCES/0002-Exit-with-success-unless-the-issue-was-with-with-tan.patch diff --git a/SOURCES/0002-Exit-with-success-unless-the-issue-was-with-with-tan.patch b/SOURCES/0002-Exit-with-success-unless-the-issue-was-with-with-tan.patch new file mode 100644 index 0000000..f8c27a3 --- /dev/null +++ b/SOURCES/0002-Exit-with-success-unless-the-issue-was-with-with-tan.patch @@ -0,0 +1,38 @@ +From ea43ca02cf52d0455c6949683692a95e38ccdf70 Mon Sep 17 00:00:00 2001 +From: Sergio Correia +Date: Fri, 4 Dec 2020 09:05:19 -0300 +Subject: [PATCH 2/2] Exit with success unless the issue was with with tangd + itself + +When an HTTP parser error happens, tangd is currently exiting with an +error status, which may cause trouble in some scenarios [1]. + +However, we don't exit with an error in situations where we try requests +that do not exist, for instance. It makes sense to only exit with an +error when the error was with tangd itself, e.g.: when we are unable to +read the directory with the keys, not when the actual HTTP operation +does not succeed for some reason. + +Upstream: https://github.com/latchset/tang/pull/55 + +[1] https://bugzilla.redhat.com/show_bug.cgi?id=1828558 +--- + src/tangd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tangd.c b/src/tangd.c +index b569f38..d40201f 100644 +--- a/src/tangd.c ++++ b/src/tangd.c +@@ -225,7 +225,7 @@ main(int argc, char *argv[]) + if (parser.http_errno != 0) { + fprintf(stderr, "HTTP Parsing Error: %s\n", + http_errno_description(parser.http_errno)); +- return EXIT_FAILURE; ++ return EXIT_SUCCESS; + } + + memmove(req, &req[r], rcvd - r); +-- +2.27.0 + diff --git a/SPECS/tang.spec b/SPECS/tang.spec index 1cb7cb0..db2af33 100644 --- a/SPECS/tang.spec +++ b/SPECS/tang.spec @@ -1,12 +1,13 @@ Name: tang Version: 7 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Network Presence Binding Daemon License: GPLv3+ URL: https://github.com/latchset/%{name} Source0: https://github.com/latchset/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.bz2 Patch1: 0001-Move-key-generation-to-tang.patch +Patch2: 0002-Exit-with-success-unless-the-issue-was-with-with-tan.patch BuildRequires: gcc BuildRequires: autoconf @@ -27,6 +28,7 @@ BuildRequires: asciidoc BuildRequires: coreutils BuildRequires: grep BuildRequires: sed +BuildRequires: git-core %{?systemd_requires} Requires: coreutils @@ -40,8 +42,7 @@ Requires(pre): shadow-utils Tang is a small daemon for binding data to the presence of a third party. %prep -%setup -q -%patch1 -p1 +%autosetup -S git %build autoreconf -i @@ -88,6 +89,10 @@ exit 0 %{_mandir}/man1/tang-show-keys.1* %changelog +* Wed Jan 13 2021 Sergio Correia - 7-6 +- Exit with success unless the issue was with with tangd itself + Resolves: rhbz#1828558 + * Sun Dec 01 2019 Sergio Correia - 7-5 - Permissions of /var/db/tang set to 0700 - Home dir of user tang is /var/cache/tang