summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
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,