From 8c4f6bcd672d7c4e85f28865ee7602554a187baf Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 19 Oct 2010 10:56:07 +0200 Subject: s4:samdb.py - use a more standard way to get to the domain realm/dns name We do always use the canonical name as a base if we don't have it around yet. --- source4/scripting/python/samba/samdb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index 60dc2fe87e..9497e55b39 100644 --- a/source4/scripting/python/samba/samdb.py +++ b/source4/scripting/python/samba/samdb.py @@ -274,7 +274,8 @@ member: %s user_dn = "CN=%s,%s,%s" % (cn, (userou or "CN=Users"), self.domain_dn()) - user_principal_name = "%s@%s" % (username, self.domain_dn().replace("DC=", "").replace(",", ".")) + dnsdomain = ldb.Dn(self, self.domain_dn()).canonical_str().replace("/", "") + user_principal_name = "%s@%s" % (username, dnsdomain) # The new user record. Note the reliance on the SAMLDB module which # fills in the default informations ldbmessage = {"dn": user_dn, -- cgit