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

From: Junio C Hamano <[email-masked]>
Date: Tue, 10 Mar 2009 01:35:04 -0700

Daniel Stenberg <[email-masked]> writes:

> On Mon, 9 Mar 2009, Junio C Hamano wrote:
>
>> The version of libcurl on my box is 7.18.something, and it does not
>> seem to ask for password when the URL has only username but not
>> colon-password. I also expected it to ask for password when
>> $HOME/.netrc has login but not password for a given machine, but
>> that does not seem to happen either. Perhaps the version is too old.
>
> No, that's entirely expected. libcurl has no "prompt the user if no
> password was given" logic but instead delegates that work to the
> application.
>
> There was once functionality for this (removed in October 2003) but it
> was broken and violated internal guidelines so we cut out and threw
> that code away.
>
> More recently there have been people interested in re-implementing
> this "the right way" but so far it hasn't been made and thus the
> application is left to perform this task.

It's always nice to find _the_ area expert around ;-)

I somehow misread the description on CURLOPT_NETRC that appears in
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html:

	libcurl uses a user name (and supplied or prompted password)
	supplied with CURLOPT_USERPWD in preference to any of the options
	controlled by this parameter.

especially the "or prompted password" part to mean that unless supplied to
the library by the caller the library would prompt the user and obtain the
password.

Thanks for clarification.