summaryrefslogtreecommitdiff
path: root/source4/setup/pwsettings
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-17 11:47:53 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-17 11:58:39 +0200
commit0a5ea25d21a9745508e118a20fca837e74b031df (patch)
treea1790a0d6036d08e897b4b98d7f5a097cf3b7166 /source4/setup/pwsettings
parent0a46fd630e38134a080214119e5712673687f7c0 (diff)
downloadsamba-0a5ea25d21a9745508e118a20fca837e74b031df.tar.gz
samba-0a5ea25d21a9745508e118a20fca837e74b031df.tar.bz2
samba-0a5ea25d21a9745508e118a20fca837e74b031df.zip
s4:python tools - Centralise the lookups for the default domain (root) in the call "domain_dn" from SamDB
Diffstat (limited to 'source4/setup/pwsettings')
-rwxr-xr-xsource4/setup/pwsettings12
1 files changed, 4 insertions, 8 deletions
diff --git a/source4/setup/pwsettings b/source4/setup/pwsettings
index a2708531a1..fc59f8c404 100755
--- a/source4/setup/pwsettings
+++ b/source4/setup/pwsettings
@@ -64,14 +64,10 @@ else:
samdb = SamDB(url=url, session_info=system_session(),
credentials=creds, lp=lp)
-res = samdb.search("", scope=ldb.SCOPE_BASE,
- expression="(defaultNamingContext=*)",
- attrs=["defaultNamingContext"])
-assert(len(res) == 1 and res[0]["defaultNamingContext"] is not None)
-domain_dn = res[0]["defaultNamingContext"][0]
-
-res = samdb.search(domain_dn, scope=ldb.SCOPE_BASE, attrs=["pwdProperties",
- "pwdHistoryLength", "minPwdLength", "minPwdAge", "maxPwdAge"])
+domain_dn = SamDB.domain_dn(samdb)
+res = samdb.search(domain_dn, scope=ldb.SCOPE_BASE,
+ attrs=["pwdProperties", "pwdHistoryLength", "minPwdLength", "minPwdAge",
+ "maxPwdAge"])
assert(len(res) == 1)
try:
pwd_props = int(res[0]["pwdProperties"][0])