Blame SOURCES/0009-remote-curl-fall-back-to-Basic-auth-if-Negotiate-fai.patch

fdd391
From d6c38a748291246ebe2f7a9e966db24f4b4f839c Mon Sep 17 00:00:00 2001
fdd391
From: Petr Stodulka <pstodulk@redhat.com>
fdd391
Date: Wed, 13 Sep 2017 03:09:59 +0200
fdd391
Subject: [PATCH] remote-curl: fall back to Basic auth if Negotiate fails
fdd391
fdd391
See the upstream commit 4dbe66464
fdd391
---
fdd391
 http.c | 9 +++++++++
fdd391
 1 file changed, 9 insertions(+)
fdd391
fdd391
diff --git a/http.c b/http.c
fdd391
index e7c77c0..3320590 100644
fdd391
--- a/http.c
fdd391
+++ b/http.c
fdd391
@@ -60,6 +60,9 @@ static const char *user_agent;
fdd391
 
fdd391
 static struct credential cert_auth = CREDENTIAL_INIT;
fdd391
 static int ssl_cert_password_required;
fdd391
+#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
fdd391
+static unsigned long http_auth_methods = CURLAUTH_ANY;
fdd391
+#endif
fdd391
 
fdd391
 static struct curl_slist *pragma_header;
fdd391
 static struct curl_slist *no_pragma_header;
fdd391
@@ -572,6 +575,9 @@ struct active_request_slot *get_active_slot(void)
fdd391
 	curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0);
fdd391
 	curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
fdd391
 	curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1);
fdd391
+#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
fdd391
+	curl_easy_setopt(slot->curl, CURLOPT_HTTPAUTH, http_auth_methods);
fdd391
+#endif
fdd391
 	if (http_auth.password)
fdd391
 		init_curl_http_auth(slot->curl);
fdd391
 
fdd391
@@ -856,6 +862,9 @@ int handle_curl_result(struct slot_results *results)
fdd391
 			credential_reject(&http_auth);
fdd391
 			return HTTP_NOAUTH;
fdd391
 		} else {
fdd391
+#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
fdd391
+			http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
fdd391
+#endif
fdd391
 			credential_fill(&http_auth);
fdd391
 			return HTTP_REAUTH;
fdd391
 		}
fdd391
-- 
fdd391
2.13.5
fdd391