Blame SOURCES/0006-ipa-submit-Retry-without-ca-on-OptionError.patch

1495bf
From 301e56c06192649bc33ddbda77ac55c0fb69f2a0 Mon Sep 17 00:00:00 2001
1495bf
From: Nalin Dahyabhai <nalin@redhat.com>
1495bf
Date: Tue, 14 Jun 2016 15:59:10 -0400
1495bf
Subject: [PATCH] ipa-submit: Retry without "ca" on OptionError
1495bf
1495bf
Add a fallback for when the IPA server returns error 3005 ("OptionError")
1495bf
when we've tried to use the "ca" named argument in a request.  As we did
1495bf
with "profile_id" earlier, take a guess that it didn't understand the
1495bf
most recently-added option that we're setting, and retry without it set.
1495bf
---
1495bf
 src/ipa.c | 8 ++++++++
1495bf
 1 file changed, 8 insertions(+)
1495bf
1495bf
diff --git a/src/ipa.c b/src/ipa.c
1495bf
index f2736c6f37948df902b65157480fc0c29ec58c3e..f8abe609a603b614067e56ebe9935472b647ed99 100644
1495bf
--- a/src/ipa.c
1495bf
+++ b/src/ipa.c
1495bf
@@ -387,6 +387,14 @@ submit:
1495bf
 		switch (i / 1000) {
1495bf
 		case 2: /* authorization error - permanent */
1495bf
 		case 3: /* invocation error - permanent */
1495bf
+			if ((i == 3005) && (issuer != NULL)) {
1495bf
+				/* Most likely the server didn't understand the
1495bf
+				 * "ca" argument.  At least, at this
1495bf
+				 * point.  Randomly dropping arguments is not
1495bf
+				 * really an extensible solution, though. */
1495bf
+				issuer = NULL;
1495bf
+				goto submit;
1495bf
+			}
1495bf
 			if ((i == 3005) && (profile != NULL)) {
1495bf
 				/* Most likely the server didn't understand the
1495bf
 				 * "profile_id" argument.  At least, at this
1495bf
-- 
1495bf
2.9.0
1495bf