git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] http, imap-send: stop using CURLOPT_VERBOSE

From
Jeff King <peff@peff.net>
Date
May 12, 2020, 19:16 UTC
Message-ID
<20200512191610.GB54565@coredump.intra.peff.net>
In-Reply-To
<1df9e9deb7831b32694ea453759bf5d21952e165.1589218693.git.jonathantanmy@google.com>
On Mon, May 11, 2020 at 10:43:10AM -0700, Jonathan Tan wrote:
Show 12 quoted lines
> Whenever GIT_CURL_VERBOSE is set, teach Git to behave as if
> GIT_TRACE_CURL=1 and GIT_TRACE_CURL_NO_DATA=1 is set, instead of setting
> CURLOPT_VERBOSE.
> 
> This is to prevent inadvertent revelation of sensitive data. In
> particular, GIT_CURL_VERBOSE redacts neither the "Authorization" header
> nor any cookies specified by GIT_REDACT_COOKIES.
> 
> Unifying the tracing mechanism also has the future benefit that any
> improvements to the tracing mechanism will benefit both users of
> GIT_CURL_VERBOSE and GIT_TRACE_CURL, and we do not need to remember to
> implement any improvement twice.
Yeah, I think this is worth doing. The patch looks OK to me, though:
Show 5 quoted lines
> +void http_trace_curl_no_data(void)
> +{
> +	trace_override_envvar(&trace_curl, "1");
> +	trace_curl_data = 0;
> +}
Would:
  setenv("GIT_TRACE_CURL", "1", 0);
  setenv("GIT_TRACE_CURL_NO_DATA", "0", 0);

be simpler? Perhaps it makes the flow more convoluted as we'd go on to parse those variables, but it puts us on the same paths that we'd use if the user specified those things (and avoids the need for the special "override" function entirely).

Other than that nit, it seems very cleanly done.
-Peff
PS I sometimes find the normal trace a bit verbose, but I do still want
   to see data. Do others feel the same? Particularly I find the "SSL"
   lines totally worthless (I guess maybe you could be debugging ssl
   stuff, but that would be the exception, I'd think). Ditto the split
   of data into two lines: one with the size and one with the actual
   data.
   I dunno. I haven't been debugging any git-over-http stuff lately, so
   it hasn't been bothering me. But I definitely have written perl
   scripts to extract the data to a more readable format. Maybe it would
   be easier if it had a few more knobs.
Previous: Jonathan TanNext: Jonathan Tan
Message 5 of 21 in “Safer GIT_CURL_VERBOSE”
  1. 0/2 Safer GIT_CURL_VERBOSEJonathan Tan, May 11, 2020
  2. 1/2 t5551: test that GIT_TRACE_CURL redacts passwordJonathan Tan, May 11, 2020
  3. Jeff KingMay 12, 2020
  4. 2/2 http, imap-send: stop using CURLOPT_VERBOSEJonathan Tan, May 11, 2020
  5. Jeff KingMay 12, 2020
  6. Jonathan TanMay 12, 2020
  7. Jeff KingMay 12, 2020
  8. brian m. carlsonMay 12, 2020
  9. Junio C HamanoMay 13, 2020
  10. Jeff KingMay 13, 2020
  11. Junio C HamanoMay 13, 2020
  12. Daniel StenbergMay 13, 2020
  13. Jeff KingMay 13, 2020
  14. 0/3 Safer GIT_CURL_VERBOSEJonathan Tan, May 13, 2020
  15. 2/3 http: make GIT_TRACE_CURL auth redaction optionalJonathan Tan, May 13, 2020
  16. Junio C HamanoMay 13, 2020
  17. 1/3 t5551: test that GIT_TRACE_CURL redacts passwordJonathan Tan, May 13, 2020
  18. 3/3 http, imap-send: stop using CURLOPT_VERBOSEJonathan Tan, May 13, 2020
  19. Junio C HamanoMay 13, 2020
  20. Junio C HamanoMay 13, 2020
  21. Jeff KingMay 15, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.