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

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