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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/3/10 Junio C Hamano <gitster@xxxxxxxxx>:
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux