git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Kyle J. McKay" <mackyle@gmail.com>
To: git@vger.kernel.org
Cc: "David Aguilar" <davvid@gmail.com>, "Petr Baudis" <pasky@ucw.cz>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Richard Hartmann" <richih.mailinglist@gmail.com>,
	"Jeff King" <peff@peff.net>,
	"Daniel Knittl-Frank" <knittl89@googlemail.com>,
	"Jan Krüger" <jk@jk.gs>, "Alejandro Mery" <amery@geeks.cl>,
	"Aaron Schrab" <aaron@schrab.com>
Subject: [PATCH v5 2/5] http.c: fix parsing of GIT_SSL_CERT_PASSWORD_PROTECTED variable
Date: Mon, 15 Jul 2013 02:50:59 -0700	[thread overview]
Message-ID: <41e6c55e7d5ad8bcae6db7d53c846f3@f74d39fa044aa309eaea14b9f57fe79> (raw)
In-Reply-To: <506e5f642a838b95e0dd5b1f0fa1cfe@f74d39fa044aa309eaea14b9f57fe79>

The existing code triggers whenever GIT_SSL_CERT_PASSWORD_PROTECTED
is defined.  Setting GIT_SSL_CERT_PASSWORD_PROTECTED to a false
value could not be used to override the http.sslCertPasswordProtected
setting once it had been turned on.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
---
 http.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/http.c b/http.c
index e65661e..9542a59 100644
--- a/http.c
+++ b/http.c
@@ -403,11 +403,10 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
 		curl_ftp_no_epsv = 1;
 
 	if (url) {
+		int pwdreq = git_env_bool("GIT_SSL_CERT_PASSWORD_PROTECTED", -1);
 		credential_from_url(&http_auth, url);
-		if (!ssl_cert_password_required &&
-		    getenv("GIT_SSL_CERT_PASSWORD_PROTECTED") &&
-		    !prefixcmp(url, "https://"))
-			ssl_cert_password_required = 1;
+		if (pwdreq != -1 && !prefixcmp(url, "https://"))
+			ssl_cert_password_required = pwdreq;
 	}
 
 #ifndef NO_CURL_EASY_DUPHANDLE
-- 
1.8.3

  parent reply	other threads:[~2013-07-15  9:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15  9:50 [PATCH v5 0/5] config: add support for http.<url>.* settings Kyle J. McKay
2013-07-15  9:50 ` [PATCH v5 1/5] http.c: fix parsing of http.sslCertPasswordProtected variable Kyle J. McKay
2013-07-15  9:50 ` Kyle J. McKay [this message]
2013-07-15  9:51 ` [PATCH v5 3/5] config: add support for http.<url>.* settings Kyle J. McKay
2013-07-15  9:51 ` [PATCH v5 4/5] config: improve " Kyle J. McKay
2013-07-15 23:12   ` Eric Sunshine
2013-07-16  9:53     ` Kyle J. McKay
2013-07-16 10:01       ` Eric Sunshine
2013-07-15  9:51 ` [PATCH v5 5/5] tests: add new test for the url_normalize function Kyle J. McKay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41e6c55e7d5ad8bcae6db7d53c846f3@f74d39fa044aa309eaea14b9f57fe79 \
    --to=mackyle@gmail.com \
    --cc=aaron@schrab.com \
    --cc=amery@geeks.cl \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jk@jk.gs \
    --cc=knittl89@googlemail.com \
    --cc=pasky@ucw.cz \
    --cc=peff@peff.net \
    --cc=richih.mailinglist@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).