diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-02-25 12:58:09 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-02-25 12:58:09 +0100 |
commit | 584c4a518f4d18452b6515db132e4f75fba733a1 (patch) | |
tree | bbe367f36f092f233d7aefb61d75d5d1e1e85031 /source4/scripting | |
parent | 03ab8f9d79f2a06b357b2f5d392ea8b5be263c5e (diff) | |
parent | 71943b209b181e1e4a65ab477b83780add7051ae (diff) | |
download | samba-584c4a518f4d18452b6515db132e4f75fba733a1.tar.gz samba-584c4a518f4d18452b6515db132e4f75fba733a1.tar.bz2 samba-584c4a518f4d18452b6515db132e4f75fba733a1.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-gmake3
Conflicts:
source/build/smb_build/header.pm
source/build/smb_build/makefile.pm
source/lib/ldb/include/ldb_private.h
(This used to be commit 1a646af0647f021d99473a8991c35e616a423ea6)
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/ejs/smbscript.c | 2 | ||||
-rw-r--r-- | source4/scripting/libjs/provision.js | 4 | ||||
-rw-r--r-- | source4/scripting/python/config.m4 | 2 | ||||
-rw-r--r-- | source4/scripting/python/samba/provision.py | 24 |
4 files changed, 29 insertions, 3 deletions
diff --git a/source4/scripting/ejs/smbscript.c b/source4/scripting/ejs/smbscript.c index a4f2e1cd43..9ed4aa490f 100644 --- a/source4/scripting/ejs/smbscript.c +++ b/source4/scripting/ejs/smbscript.c @@ -61,8 +61,6 @@ int main(int argc, const char **argv) lp_load(lp_ctx, dyn_CONFIGFILE); } - ldb_global_init(); - gensec_init(lp_ctx); mprSetCtx(mem_ctx); 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/config.m4 b/source4/scripting/python/config.m4 index 908efd1588..2142cd9abd 100644 --- a/source4/scripting/python/config.m4 +++ b/source4/scripting/python/config.m4 @@ -54,7 +54,7 @@ fi if test x$PYTHON != x then - DISTUTILS_CFLAGS=`$PYTHON -c "from distutils import sysconfig; print '-I%s -I%s %s' % (sysconfig.get_python_inc(), sysconfig.get_python_inc(plat_specific=True), sysconfig.get_config_var('CFLAGS'))"` + DISTUTILS_CFLAGS=`$PYTHON -c "from distutils import sysconfig; print '-I%s -I%s %s' % (sysconfig.get_python_inc(), sysconfig.get_python_inc(plat_specific=1), sysconfig.get_config_var('CFLAGS'))"` DISTUTILS_LDFLAGS=`$PYTHON -c "from distutils import sysconfig; print '%s %s -lpython%s -L%s' % (sysconfig.get_config_var('LIBS'), sysconfig.get_config_var('SYSLIBS'), sysconfig.get_config_var('VERSION'), sysconfig.get_config_var('LIBPL'))"` TRY_LINK_PYTHON($DISTUTILS_LDFLAGS, $DISTUTILS_CFLAGS) fi 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, |