From: Mike Ralphson Date: Thu, 12 Mar 2009 08:53:20 GMT Subject: Re: [PATCH][v2] http authentication via prompts (with correct line lengths) Message-ID: In-Reply-To: <7v63ihdgy6.fsf@gitster.siamese.dyndns.org> 2009/3/10 Junio C Hamano : > 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