ms_schema: Allow for CN=X and DC=X replacements
authorGarming Sam <garming@catalyst.net.nz>
Mon, 19 Sep 2016 01:52:54 +0000 (13:52 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Dec 2017 07:20:14 +0000 (08:20 +0100)
These occur in the newer 2012 and 2016 schemas.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/ms_schema.py

index 245ce3f..a9575b0 100644 (file)
@@ -162,6 +162,10 @@ def fix_dn(dn):
         dn = dn.replace("\n ", "")
         dn = dn.replace(" ", "")
         return dn.replace("CN=Schema,CN=Configuration,<RootDomainDN>", "${SCHEMADN}")
+    elif dn.endswith("DC=X"):
+        return dn.replace("CN=Schema,CN=Configuration,DC=X", "${SCHEMADN}")
+    elif dn.endswith("CN=X"):
+        return dn.replace("CN=Schema,CN=Configuration,CN=X", "${SCHEMADN}")
     else:
         return dn