summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-08-14 09:37:50 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-08-17 09:51:00 +1000
commite7bae2eb0a103f9b8a26013017f510b7c6f8e4fc (patch)
tree368c4a1480af4610620ea6318da2aa94aa69f455 /source4
parent052da4e4d77ceb0307ad2477f2bc4a17334d6565 (diff)
downloadsamba-e7bae2eb0a103f9b8a26013017f510b7c6f8e4fc.tar.gz
samba-e7bae2eb0a103f9b8a26013017f510b7c6f8e4fc.tar.bz2
samba-e7bae2eb0a103f9b8a26013017f510b7c6f8e4fc.zip
s4: Re-add --ldapadminpass as an option to provision
This should make setting up LDAP servers more predictable. When not specified, it is random Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/provision.py14
-rwxr-xr-xsource4/setup/provision3
2 files changed, 12 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 12625d98d6..bcb6566998 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -969,7 +969,8 @@ def provision(setup_dir, message, session_info,
rootdn=None, domaindn=None, schemadn=None, configdn=None,
serverdn=None,
domain=None, hostname=None, hostip=None, hostip6=None,
- domainsid=None, adminpass=None, krbtgtpass=None, domainguid=None,
+ domainsid=None, adminpass=None, ldapadminpass=None,
+ krbtgtpass=None, domainguid=None,
policyguid=None, invocationid=None, machinepass=None,
dnspass=None, root=None, nobody=None, users=None,
wheel=None, backup=None, aci=None, serverrole=None,
@@ -998,6 +999,11 @@ def provision(setup_dir, message, session_info,
machinepass = glue.generate_random_str(12)
if dnspass is None:
dnspass = glue.generate_random_str(12)
+ if ldapadminpass is None:
+ #Make a new, random password between Samba and it's LDAP server
+ ldapadminpass=glue.generate_random_str(12)
+
+
root_uid = findnss_uid([root or "root"])
nobody_uid = findnss_uid([nobody or "nobody"])
users_gid = findnss_gid([users or "users"])
@@ -1062,6 +1068,7 @@ def provision(setup_dir, message, session_info,
names=names,
message=message, hostname=hostname,
root=root, schema=schema, ldap_backend_type=ldap_backend_type,
+ ldapadminpass=ldapadminpass,
ldap_backend_extra_port=ldap_backend_extra_port,
ol_mmr_urls=ol_mmr_urls,
slapd_path=slapd_path,
@@ -1258,7 +1265,7 @@ class ProvisionBackend(object):
def __init__(self, paths=None, setup_path=None, lp=None, credentials=None,
names=None, message=None,
hostname=None, root=None,
- schema=None,
+ schema=None, ldapadminpass=None,
ldap_backend_type=None, ldap_backend_extra_port=None,
ol_mmr_urls=None,
setup_ds_path=None, slapd_path=None,
@@ -1335,9 +1342,6 @@ class ProvisionBackend(object):
self.credentials.guess(lp)
self.ldap_backend_type = ldap_backend_type
- #Make a new, random password between Samba and it's LDAP server
- ldapadminpass=glue.generate_random_str(12)
-
if ldap_backend_type == "fedora-ds":
provision_fds_backend(self, paths=paths, setup_path=setup_path, names=names, message=message,
hostname=hostname, ldapadminpass=ldapadminpass, root=root,
diff --git a/source4/setup/provision b/source4/setup/provision
index 5686ee0e26..27a33122be 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -70,6 +70,8 @@ parser.add_option("--machinepass", type="string", metavar="PASSWORD",
help="choose machine password (otherwise random)")
parser.add_option("--dnspass", type="string", metavar="PASSWORD",
help="choose dns password (otherwise random)")
+parser.add_option("--ldapadminpass", type="string", metavar="PASSWORD",
+ help="choose password to set between Samba and it's LDAP backend (otherwise random)")
parser.add_option("--root", type="string", metavar="USERNAME",
help="choose 'root' unix username")
parser.add_option("--nobody", type="string", metavar="USERNAME",
@@ -188,6 +190,7 @@ provision(setup_dir, message,
serverrole=server_role,
ldap_backend_extra_port=opts.ldap_backend_extra_port,
ldap_backend_type=opts.ldap_backend_type,
+ ldapadminpass=opts.ldapadminpass,
ol_mmr_urls=opts.ol_mmr_urls,
slapd_path=opts.slapd_path,
setup_ds_path=opts.setup_ds_path,