diff options
author | Simo Sorce <idra@samba.org> | 2006-10-16 12:05:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:21:11 -0500 |
commit | 794a7f52235bbd7aa87629f47d2bf6a65835a615 (patch) | |
tree | 9e4f4bea5ea394908be51ed896280b3ee268eff6 /source4 | |
parent | d9cb938dcd73f10fb36838a5edaee1690628ec1b (diff) | |
download | samba-794a7f52235bbd7aa87629f47d2bf6a65835a615.tar.gz samba-794a7f52235bbd7aa87629f47d2bf6a65835a615.tar.bz2 samba-794a7f52235bbd7aa87629f47d2bf6a65835a615.zip |
r19334: Commit commented provisioning code to activate the schema
(This used to be commit 57ee79c15579d1bbe7c0d3202b84a06b75320e40)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/libjs/provision.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index 05e6726244..2eac2b731c 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -282,6 +282,25 @@ function setup_add_ldif(ldif, info, ldb, failok) return add_ok; } +function setup_modify_ldif(ldif, info, ldb, failok) +{ + var lp = loadparm_init(); + var src = lp.get("setup directory") + "/" + ldif; + + var data = sys.file_load(src); + data = substitute_var(data, info.subobj); + + var mod_ok = ldb.modify(data); + if (!mod_ok) { + info.message("ldb load failed: " + ldb.errstring() + "\n"); + if (!failok) { + assert(mod_ok); + } + } + return mod_ok; +} + + function setup_ldb(ldif, info, dbname) { var erase = true; @@ -524,6 +543,19 @@ function provision(subobj, message, blank, paths, session_info, credentials) return true; } +// message("Activate schema module"); +// setup_modify_ldif("schema_activation.ldif", info, samdb, false); +// +// // (hack) Reload, now we have the schema loaded. +// var commit_ok = samdb.transaction_commit(); +// if (!commit_ok) { +// info.message("samdb commit failed: " + samdb.errstring() + "\n"); +// assert(commit_ok); +// } +// samdb.close(); +// +// samdb = open_ldb(info, paths.samdb, false); +// message("Setting up sam.ldb users and groups\n"); setup_add_ldif("provision_users.ldif", info, samdb, false); |