summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-25 11:47:44 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-25 11:47:44 +0100
commit6c2d4f2806bae8072d61ba8795832d9a9e75573e (patch)
tree21dcc2344e5b4c57b422b0316660a1022422dd9b /source4/scripting
parentdcb04065cda7fc7f23c494ec138af6b882651f20 (diff)
downloadsamba-6c2d4f2806bae8072d61ba8795832d9a9e75573e.tar.gz
samba-6c2d4f2806bae8072d61ba8795832d9a9e75573e.tar.bz2
samba-6c2d4f2806bae8072d61ba8795832d9a9e75573e.zip
python/provision: Reload secrets when necessary, fix unix names in mappings.
Pair programmed with Andrew. (This used to be commit 04fe8c8aefae8da8966954d0654c37adf2d0361d)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/provision.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 0e498f65e5..4d99cd9cd9 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -193,7 +193,7 @@ def provision_paths_from_lp(lp, dnsdomain, private_dir=None):
paths.secrets = os.path.join(private_dir, lp.get("secrets database") or "secrets.ldb")
paths.templates = os.path.join(private_dir, "templates.ldb")
paths.keytab = os.path.join(private_dir, "secrets.keytab")
- paths.dns_keytab = os.path.join(private_dir, "dns.keytab")
+ paths.dns_keytab = "dns.keytab"
paths.dns = os.path.join(private_dir, dnsdomain + ".zone")
paths.winsdb = os.path.join(private_dir, "wins.ldb")
paths.s4_ldapi_path = os.path.join(private_dir, "ldapi")
@@ -407,6 +407,8 @@ def setup_secretsdb(path, setup_path, session_info, credentials, lp):
lp=lp)
secrets_ldb.erase()
secrets_ldb.load_ldif_file_add(setup_path("secrets_init.ldif"))
+ secrets_ldb = Ldb(path, session_info=session_info, credentials=credentials,
+ lp=lp)
secrets_ldb.load_ldif_file_add(setup_path("secrets.ldif"))
return secrets_ldb
@@ -695,18 +697,18 @@ def provision(lp, setup_dir, message, paths, session_info,
if dnspass is None:
dnspass = misc.random_password(12)
if root is None:
- root = findnss(pwd.getpwnam, "root")[4]
+ root = findnss(pwd.getpwnam, "root")[0]
if nobody is None:
- nobody = findnss(pwd.getpwnam, "nobody")[4]
+ nobody = findnss(pwd.getpwnam, "nobody")[0]
if nogroup is None:
- nogroup = findnss(grp.getgrnam, "nogroup", "nobody")[2]
+ nogroup = findnss(grp.getgrnam, "nogroup", "nobody")[0]
if users is None:
users = findnss(grp.getgrnam, "users", "guest", "other", "unknown",
- "usr")[2]
+ "usr")[0]
if wheel is None:
- wheel = findnss(grp.getgrnam, "wheel", "root", "staff", "adm")[2]
+ wheel = findnss(grp.getgrnam, "wheel", "root", "staff", "adm")[0]
if backup is None:
- backup = findnss(grp.getgrnam, "backup", "wheel", "root", "staff")[2]
+ backup = findnss(grp.getgrnam, "backup", "wheel", "root", "staff")[0]
if aci is None:
aci = "# no aci for local ldb"
if serverrole is None: