From 26384192d56d765a8ea4667fac7c9b7ad2e3d415 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Mon, 22 Jun 2015 16:38:29 +1200 Subject: [PATCH] KCC: NTDSConnection.load_connection() requires objectGUID If there is no GUID, that is an error, so we raise an exception instead of stepping around it. Signed-off-by: Douglas Bagnall Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- python/samba/kcc/kcc_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/samba/kcc/kcc_utils.py b/python/samba/kcc/kcc_utils.py index c99efa107a..e0b7221af0 100644 --- a/python/samba/kcc/kcc_utils.py +++ b/python/samba/kcc/kcc_utils.py @@ -890,10 +890,13 @@ class NTDSConnection(object): if "systemFlags" in msg: self.system_flags = int(msg["systemFlags"][0]) - if "objectGUID" in msg: + try: self.guid = \ misc.GUID(samdb.schema_format_value("objectGUID", msg["objectGUID"][0])) + except KeyError: + raise KCCError("Unable to find objectGUID in nTDSConnection " + "for (%s)" % (self.dnstr)) if "transportType" in msg: dsdn = dsdb_Dn(samdb, msg["transportType"][0]) -- 2.34.1