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
Junio C Hamano <gitster@pobox.com>
Date
Mar 13, 2009, 05:53 UTC
Message-ID
<7vsklihsti.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<e2b179460903120153u5fdb58b6tf3027eea23673df0@mail.gmail.com>
Mike Ralphson <mike.ralphson@gmail.com> writes:
> 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).

Yeah, I did this as "How about doing it this way without adding a band-aid configuration options" demonstration, and meant to clean it up (rather, meant to wait for the original submitter to clean-up) before moving it forward, but I forgot. Sorry about that.

How does this look?

http://curl.haxx.se/libcurl/c/curl_easy_setopt.html seems to say "added in 7.X.Y" for some options but does say when CURLOPT_USERPWD was added, so I am assuming it was available even in very early versions...

-- >8 --
From 750d9305009a0f3fd14c0b5c5e62ae1eb2b18fda Mon Sep 17 00:00:00 2001
From: Junio C Hamano <gitster@pobox.com>
Date: Thu, 12 Mar 2009 22:34:43 -0700
Subject: [PATCH] http.c: CURLOPT_NETRC_OPTIONAL is not available in ancient versions of cURL

Besides, we have already called easy_setopt with the option before coming to this function if it was available, so there is no need to repeat it here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 http.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/http.c b/http.c
index b8f947e..2fc55d6 100644
--- a/http.c
+++ b/http.c
@@ -138,9 +138,7 @@ static int http_options(const char *var, const char *value, void *cb)
 
 static void init_curl_http_auth(CURL *result)
 {
-	if (!user_name)
-		curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
-	else {
+	if (user_name) {
 		struct strbuf up = STRBUF_INIT;
 		if (!user_pass)
 			user_pass = xstrdup(getpass("Password: "));
-- 
1.6.2.249.g770a0
Previous: Daniel StenbergNext: Daniel Stenberg
Message 15 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.