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