summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-02-18 14:33:58 +0100
committerKai Blin <kai@samba.org>2008-02-21 11:21:59 +0100
commit895874d9663ccb95883579d145018ec8a8add9c8 (patch)
treeaa1cab86c67be63d53622796b3c6e8f2a9a60263 /source4/scripting
parent2ca1aeb59be0267858c9cd46a04d37d982b79990 (diff)
downloadsamba-895874d9663ccb95883579d145018ec8a8add9c8.tar.gz
samba-895874d9663ccb95883579d145018ec8a8add9c8.tar.bz2
samba-895874d9663ccb95883579d145018ec8a8add9c8.zip
idmap: Handle uid->SID mapping
(This used to be commit 6ac6de8476ba036eb041e054bc37e4503dc2fde8)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/libjs/provision.js4
-rw-r--r--source4/scripting/python/samba/provision.py24
2 files changed, 28 insertions, 0 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index dc9eae8e72..3ba93debf9 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -389,6 +389,7 @@ function provision_default_paths(subobj)
paths.smbconf = lp.filename()
paths.shareconf = lp.get("private dir") + "/" + "share.ldb";
paths.samdb = lp.get("sam database");
+ paths.idmapdb = lp.get("idmap database");
paths.secrets = lp.get("secrets database");
paths.templates = lp.get("private dir") + "/" + "templates.ldb";
paths.keytab = "secrets.keytab";
@@ -679,6 +680,9 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
message("Setting up templates into " + paths.templates + "\n");
setup_ldb("provision_templates.ldif", info, paths.templates);
+ message("Setting up " + paths.idmapdb +"\n");
+ setup_ldb("idmap_init.ldif", info, paths.idmapdb);
+
message("Setting up sam.ldb partitions\n");
/* Also wipes the database */
setup_ldb("provision_partitions.ldif", info, paths.samdb);
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 3e88b68509..e3c47ff4a2 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -59,6 +59,7 @@ class ProvisionPaths:
self.hkpd = None
self.hkpt = None
self.samdb = None
+ self.idmapdb = None
self.secrets = None
self.keytab = None
self.dns_keytab = None
@@ -202,6 +203,7 @@ def provision_paths_from_lp(lp, dnsdomain):
paths.shareconf = os.path.join(private_dir, "share.ldb")
paths.samdb = os.path.join(private_dir, lp.get("sam database") or "samdb.ldb")
+ paths.idmapdb = os.path.join(private_dir, lp.get("idmap database") or "idmap.ldb")
paths.secrets = os.path.join(private_dir, lp.get("secrets database") or "secrets.ldb")
paths.templates = os.path.join(private_dir, "templates.ldb")
paths.dns = os.path.join(private_dir, dnsdomain + ".zone")
@@ -471,6 +473,24 @@ def setup_registry(path, setup_path, session_info, credentials, lp):
assert os.path.exists(provision_reg)
reg.diff_apply(provision_reg)
+def setup_idmapdb(path, setup_path, session_info, credentials, lp):
+ """Setup the idmap database.
+
+ :param path: path to the idmap database
+ :param setup_path: Function that returns a path to a setup file
+ :param session_info: Session information
+ :param credentials: Credentials
+ :param lp: Loadparm context
+ """
+ if os.path.exists(path):
+ os.unlink(path)
+
+ idmap_ldb = Ldb(path, session_info=session_info, credentials=credentials,
+ lp=lp)
+
+ idmap_ldb.erase()
+ idmap_ldb.load_ldif_file_add(setup_path("idmap_init.ldif"))
+ return idmap_ldb
def setup_samdb_rootdse(samdb, setup_path, schemadn, domaindn, hostname,
dnsdomain, realm, rootdn, configdn, netbiosname,
@@ -844,6 +864,10 @@ def provision(lp, setup_dir, message, paths, session_info,
setup_templatesdb(paths.templates, setup_path, session_info=session_info,
credentials=credentials, lp=lp)
+ message("Setting up idmap db")
+ setup_idmapdb(paths.idmapdb, setup_path, session_info=session_info,
+ credentials=credentials, lp=lp)
+
samdb = setup_samdb(paths.samdb, setup_path, session_info=session_info,
credentials=credentials, lp=lp, schemadn=schemadn,
configdn=configdn, domaindn=domaindn,