summaryrefslogtreecommitdiff
path: root/source4/setup/pwsettings
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-09-21 11:53:19 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-09-21 11:53:19 +0200
commitf0c080a484ad71ea3ecc38919178986e354501db (patch)
tree4ad2401f42c3da7fb926620a3d658f2e005b1d46 /source4/setup/pwsettings
parent0af3b06824825ee42ba0fe7414d774ace72292d0 (diff)
downloadsamba-f0c080a484ad71ea3ecc38919178986e354501db.tar.gz
samba-f0c080a484ad71ea3ecc38919178986e354501db.tar.bz2
samba-f0c080a484ad71ea3ecc38919178986e354501db.zip
s4:scripts - Reintroduce "-H" parameter
I removed it since on some scripts it was present, on others not - so I thought it wouldn't be really needed. This was a bad decision (pointed out by abartlet). So I reintroduce it on all scripts (to have consistent parameters).
Diffstat (limited to 'source4/setup/pwsettings')
-rwxr-xr-xsource4/setup/pwsettings9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/setup/pwsettings b/source4/setup/pwsettings
index 6a5e18ef59..0bb39d9757 100755
--- a/source4/setup/pwsettings
+++ b/source4/setup/pwsettings
@@ -39,6 +39,7 @@ parser.add_option_group(sambaopts)
parser.add_option_group(options.VersionOptions(parser))
credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
+parser.add_option("-H", help="LDB URL for database or target server", type=str)
parser.add_option("--quiet", help="Be quiet", action="store_true")
parser.add_option("--complexity",
help="The password complexity (on | off | default). Default is 'on'", type=str)
@@ -67,8 +68,12 @@ if len(args) == 0:
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
-samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
- credentials=creds, lp=lp)
+if opts.H is not None:
+ url = opts.H
+else:
+ url = lp.get("sam database")
+
+samdb = SamDB(url=url, session_info=system_session(), credentials=creds, lp=lp)
domain_dn = SamDB.domain_dn(samdb)
res = samdb.search(domain_dn, scope=ldb.SCOPE_BASE,