From 551f36fe90550b1816227e8e1bf7d4080d5a5241 Mon Sep 17 00:00:00 2001 From: troup <> Date: Mon, 9 Apr 2007 20:42:03 +0000 Subject: [PATCH] When checking for collisons in ud-mailgate, check for both tab and space suffixed hostnames since we accept either as input. --- ud-mailgate | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ud-mailgate b/ud-mailgate index 9907222..d8dfbff 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -222,7 +222,12 @@ def DoDNS(Str,Attrs,DnRecord): # Check for collisions global l; - Rec = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"dnsZoneEntry="+G[0]+" *",["uid"]); + # [JT 20070409 - search for both tab and space suffixed hostnames + # since we accept either. It'd probably be better to parse the + # incoming string in order to construct what we feed LDAP rather + # than just passing it through as is.] + filter = "(|(dnsZoneEntry=%s *)(dnsZoneEntry=%s *))" % (G[0], G[0]) + Rec = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,filter,["uid"]); for x in Rec: if GetAttr(x,"uid") != GetAttr(DnRecord,"uid"): return "DNS entry is already owned by " + GetAttr(x,"uid") -- 2.20.1