Browse Source

Cherry-pick "Exit with success unless the issue was with with tangd itself"

Christoph Biedl 3 years ago
parent
commit
aaa82d315c

+ 27 - 0
debian/patches/cherry-pick/1607083519.v7-11-g23d4e9f.exit-with-success-unless-the-issue-was-with-with-tangd-itself.patch

@@ -0,0 +1,27 @@
+Subject: Exit with success unless the issue was with with tangd itself
+Origin: v7-11-g23d4e9f <https://github.com/latchset/tang/commit/v7-11-g23d4e9f>
+Upstream-Author: Sergio Correia <scorreia@redhat.com>
+Date: Fri Dec 4 09:05:19 2020 -0300
+
+    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.
+
+    [1] https://bugzilla.redhat.com/show_bug.cgi?id=1828558
+
+--- a/src/tangd.c
++++ b/src/tangd.c
+@@ -205,7 +205,7 @@
+         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);

+ 1 - 0
debian/patches/series

@@ -7,6 +7,7 @@ cherry-pick/1606480249.v7-6-g6090505.add-functions-for-key-manipulation.patch
 cherry-pick/1606480958.v7-7-gc71df1d.add-tests-for-key-manipulation-functions.patch
 cherry-pick/1606525324.v7-8-g7119454.move-key-handling-to-tang-itself.patch
 cherry-pick/1607020014.v7-10-g321c5cd.keys-return-null-if-jose-jwk-pub-fails.patch
+cherry-pick/1607083519.v7-11-g23d4e9f.exit-with-success-unless-the-issue-was-with-with-tangd-itself.patch
 
 # patches for upstream
 for-upstream/2018-08-11.use-asciidoctor-to-build-manpages.patch