summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-19 10:56:07 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-19 09:21:04 +0000
commit8c4f6bcd672d7c4e85f28865ee7602554a187baf (patch)
tree22683de1503af504b2ce3afb9cd763d91042b1c2 /source4
parent87fd2fd1574d4cb52aef216e632e9899a01b2940 (diff)
downloadsamba-8c4f6bcd672d7c4e85f28865ee7602554a187baf.tar.gz
samba-8c4f6bcd672d7c4e85f28865ee7602554a187baf.tar.bz2
samba-8c4f6bcd672d7c4e85f28865ee7602554a187baf.zip
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.
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/samdb.py3
1 files changed, 2 insertions, 1 deletions
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,