path: root/http.c
diff options
authorDavid Turner <>2016-10-04 14:53:52 (GMT)
committerJunio C Hamano <>2016-10-04 19:02:00 (GMT)
commit5275c3081c2b2c6166a2fc6b253a3acb20f8ae89 (patch)
treed470eeced10399672015dc9f561536dab728a8e0 /http.c
parent92d426662b0673adcd41995e6c2f0afcb9ad39af (diff)
http: http.emptyauth should allow empty (not just NULL) usernames
When using Kerberos authentication with newer versions of libcurl, CURLOPT_USERPWD must be set to a value, even if it is an empty value. The value is never sent to the server. Previous versions of libcurl did not require this variable to be set. One way that some users express the empty username/password is, which http.emptyauth was designed to support. Another, equivalent, URL is The latter leads to a username of zero-length, rather than a NULL username, but CURLOPT_USERPWD still needs to be set (if http.emptyauth is set). Do so. Signed-off-by: David Turner <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'http.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/http.c b/http.c
index 82ed542..bd0dba2 100644
--- a/http.c
+++ b/http.c
@@ -351,7 +351,7 @@ static int http_options(const char *var, const char *value, void *cb)
static void init_curl_http_auth(CURL *result)
- if (!http_auth.username) {
+ if (!http_auth.username || !*http_auth.username) {
if (curl_empty_auth)
curl_easy_setopt(result, CURLOPT_USERPWD, ":");