Skip to content

Commit 5275c30

Browse files
novalisgitster
authored andcommitted
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 http://:@gitserver.example.com, which http.emptyauth was designed to support. Another, equivalent, URL is http://@gitserver.example.com. 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92d4266 commit 5275c30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static int http_options(const char *var, const char *value, void *cb)
351351

352352
static void init_curl_http_auth(CURL *result)
353353
{
354-
if (!http_auth.username) {
354+
if (!http_auth.username || !*http_auth.username) {
355355
if (curl_empty_auth)
356356
curl_easy_setopt(result, CURLOPT_USERPWD, ":");
357357
return;

0 commit comments

Comments
 (0)