1607083519.v7-11-g23d4e9f.exit-with-success-unless-the-issue-was-with-with-tangd-itself.patch 1.1 KB

123456789101112131415161718192021222324252627
  1. Subject: Exit with success unless the issue was with with tangd itself
  2. Origin: v7-11-g23d4e9f <https://github.com/latchset/tang/commit/v7-11-g23d4e9f>
  3. Upstream-Author: Sergio Correia <scorreia@redhat.com>
  4. Date: Fri Dec 4 09:05:19 2020 -0300
  5. When an HTTP parser error happens, tangd is currently exiting with an
  6. error status, which may cause trouble in some scenarios [1].
  7. However, we don't exit with an error in situations where we try requests
  8. that do not exist, for instance. It makes sense to only exit with an
  9. error when the error was with tangd itself, e.g.: when we are unable to
  10. read the directory with the keys, not when the actual HTTP operation
  11. does not succeed for some reason.
  12. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1828558
  13. --- a/src/tangd.c
  14. +++ b/src/tangd.c
  15. @@ -205,7 +205,7 @@
  16. if (parser.http_errno != 0) {
  17. fprintf(stderr, "HTTP Parsing Error: %s\n",
  18. http_errno_description(parser.http_errno));
  19. - return EXIT_FAILURE;
  20. + return EXIT_SUCCESS;
  21. }
  22. memmove(req, &req[r], rcvd - r);