Hi,

When adding a trust using trust-add with misconfigured DNS,
an improper LDAP entry might be returned. Log a proper error
message.

https://fedorahosted.org/freeipa/ticket/3690

--
Tomas Babej
Associate Software Engeneer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org

From e3b2ee90132fa6b7def846ee57841aabcea07c64 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Tue, 6 Aug 2013 12:15:22 +0200
Subject: [PATCH] Log proper error message when defaultNamingContext not found

When adding a trust using trust-add with misconfigured DNS,
an improper LDAP entry might be returned. Log a proper error
message.

https://fedorahosted.org/freeipa/ticket/3690
---
 ipaserver/dcerpc.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index 4b87a9e8c8e4a7e6433ab9f9f0dffb5dd82cdfd4..b156d215b29b9cc8e2a7c24f755b57c390fabb0d 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -790,9 +790,13 @@ class TrustDomainInstance(object):
             root_logger.error(
                 "LDAP error when connecting to %(host)s: %(error)s" %
                     dict(host=unicode(result.pdc_name), error=str(e)))
+        except KeyError:
+            root_logger.error("LDAP entry from {host} returned malformed. "
+                              "Your DNS might be misconfigured."
+                              .format(host=unicode(result.pdc_name)))
 
         if search_result:
-           self.info['sid'] = self.parse_naming_context(search_result)
+            self.info['sid'] = self.parse_naming_context(search_result)
         return True
 
     def parse_naming_context(self, context):
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to