Blame SOURCES/0004-AD-user-without-override-receive-InternalServerError-with-API_4db18be_rhbz#1782572.patch

a6e2d8
From 4db18be5467c0b8f7633b281c724f469f907e573 Mon Sep 17 00:00:00 2001
a6e2d8
From: Florence Blanc-Renaud <flo@redhat.com>
a6e2d8
Date: Jan 13 2020 12:08:19 +0000
a6e2d8
Subject: AD user without override receive InternalServerError with API
a6e2d8
a6e2d8
a6e2d8
When ipa commands are used by an Active Directory user that
a6e2d8
does not have any idoverride-user set, they return the
a6e2d8
following error message which can be misleading:
a6e2d8
$ kinit aduser@ADDOMAIN.COM
a6e2d8
$ ipa ping
a6e2d8
ipa: ERROR: cannot connect to 'https://master.ipa.com/ipa/json': Internal Server Error
a6e2d8
a6e2d8
The fix properly handles ACIError exception received when
a6e2d8
creating the context, and now the following message can be seen:
a6e2d8
a6e2d8
$ kinit aduser@ADDOMAIN.COM
a6e2d8
$ ipa ping
a6e2d8
ipa: ERROR: cannot connect to 'https://master.ipa.com/ipa/json': Unauthorized
a6e2d8
a6e2d8
with the following log in /var/log/httpd/error_log:
a6e2d8
ipa: INFO: 401 Unauthorized: Insufficient access:  Invalid credentials
a6e2d8
a6e2d8
Fixes: https://pagure.io/freeipa/issue/8163
a6e2d8
a6e2d8
---
a6e2d8
a6e2d8
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
a6e2d8
index 0495557..194cbbc 100644
a6e2d8
--- a/ipaserver/rpcserver.py
a6e2d8
+++ b/ipaserver/rpcserver.py
a6e2d8
@@ -694,7 +694,7 @@ class KerberosWSGIExecutioner(WSGIExecutioner, KerberosSession):
a6e2d8
             status = HTTP_STATUS_SUCCESS
a6e2d8
             response = status.encode('utf-8')
a6e2d8
             start_response(status, self.headers)
a6e2d8
-            return self.marshal(None, e)
a6e2d8
+            return [self.marshal(None, e)]
a6e2d8
         finally:
a6e2d8
             destroy_context()
a6e2d8
         return response
a6e2d8