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

Re: [PATCH][v2] http authentication via prompts (with correct line lengths)

From
Mike Ralphson <mike.ralphson@gmail.com>
Date
Mar 12, 2009, 08:53 UTC
Message-ID
<e2b179460903120153u5fdb58b6tf3027eea23673df0@mail.gmail.com>
In-Reply-To
<7v63ihdgy6.fsf@gitster.siamese.dyndns.org>
2009/3/10 Junio C Hamano <gitster@pobox.com>:
Show 30 quoted lines
> diff --git a/http.c b/http.c
> index f4f0bf6..3d5caa6 100644
> --- a/http.c
> +++ b/http.c
> @@ -25,6 +25,7 @@ static long curl_low_speed_limit = -1;
>  static long curl_low_speed_time = -1;
>  static int curl_ftp_no_epsv;
>  static const char *curl_http_proxy;
> +static char *user_name, *user_pass;
>
>  static struct curl_slist *pragma_header;
>
> @@ -135,6 +136,20 @@ static int http_options(const char *var, const char *value, void *cb)
>        return git_default_config(var, value, cb);
>  }
>
> +static void init_curl_http_auth(CURL *result)
> +{
> +       if (!user_name)
> +               curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
> +       else {
> +               struct strbuf up = STRBUF_INIT;
> +               if (!user_pass)
> +                       user_pass = xstrdup(getpass("Password: "));
> +               strbuf_addf(&up, "%s:%s", user_name, user_pass);
> +               curl_easy_setopt(result, CURLOPT_USERPWD,
> +                                strbuf_detach(&up, NULL));
> +       }
> +}
> +

Elsewhere we seem to protect use of CURL_NETRC_OPTIONAL by checking for LIBCURL_VERSION_NUM >= 0x070907. I have an ancient curl here (curl-7.9.3-2ssl) which doesn't seem to have this option, so building next is broken on AIX for me from this morning (c33976cb).

Is there a specific minimum version of curl we want to continue supporting?
Mike
Previous: Junio C HamanoNext: Daniel Stenberg
Message 11 of 20 in “[v2] http authentication via prompts (with correct line lengths)”
  1. [v2] http authentication via prompts (with correct line lengths)Mike Gaffney, Mar 10, 2009
  2. Junio C HamanoMar 10, 2009
  3. Johannes SchindelinMar 10, 2009
  4. Mike GaffneyMar 10, 2009
  5. Johannes SchindelinMar 10, 2009
  6. Mike GaffneyMar 10, 2009
  7. Mike GaffneyMar 10, 2009
  8. Junio C HamanoMar 10, 2009
  9. Daniel StenbergMar 10, 2009
  10. Junio C HamanoMar 10, 2009
  11. Mike RalphsonMar 12, 2009
  12. Daniel StenbergMar 12, 2009
  13. Mike RalphsonMar 12, 2009
  14. Daniel StenbergMar 12, 2009
  15. Junio C HamanoMar 13, 2009
  16. Daniel StenbergMar 13, 2009
  17. Mike RalphsonMar 13, 2009
  18. Junio C HamanoMar 14, 2009
  19. Mike GaffneyMar 13, 2009
  20. Junio C HamanoMar 14, 2009

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.