From ce707aec0cd96f399d8486be43821464dba07878 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Thu, 26 Mar 2015 18:13:43 +1300 Subject: [PATCH] kcc: Change create_connection to properly query existing connections Originally it didn't correctly detect the right 'from server' continuing with any connection. Signed-off-by: Garming Sam Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- source4/scripting/bin/samba_kcc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc index 6ec528d6baf..dcac5aba688 100755 --- a/source4/scripting/bin/samba_kcc +++ b/source4/scripting/bin/samba_kcc @@ -1339,11 +1339,13 @@ class KCC(object): for cn in ldsa.connect_table.values(): rdsa = None + found = False for rdsa in rbhs_all: if cn.from_dnstr == rdsa.dsa_dnstr: + found = True break - if rdsa is None: + if rdsa is None or not found: continue DEBUG_DARK_YELLOW("rdsa is %s" % rdsa.dsa_dnstr) @@ -1462,12 +1464,15 @@ class KCC(object): for cn in ldsa.connect_table.values(): rdsa = None + found = False for rdsa in rbhs_all: if cn.from_dnstr == rdsa.dsa_dnstr: + found = True break - if rdsa is None: + if rdsa is None or not found: continue + DEBUG_DARK_YELLOW("round 2: rdsa is %s" % rdsa.dsa_dnstr) # IF (bit NTDSCONN_OPT_IS_GENERATED is clear in cn!options or -- 2.11.4.GIT