summaryrefslogtreecommitdiff
path: root/source4/scripting/libjs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-07-20 11:43:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:50 -0500
commit24d2107324982d8ad69fb89d13037ba591f49534 (patch)
tree580b56039438112db1fea6fc20416044aa045d5d /source4/scripting/libjs
parent79a87c55fe076fcc1b0196561a7d7715f456ea0f (diff)
downloadsamba-24d2107324982d8ad69fb89d13037ba591f49534.tar.gz
samba-24d2107324982d8ad69fb89d13037ba591f49534.tar.bz2
samba-24d2107324982d8ad69fb89d13037ba591f49534.zip
r8650: Use the timestamps and a new objectguid module rather than placing
boilerplate attributes in every entry in provision.ldif. The next step will be to use templates. Andrew Bartlett (This used to be commit 940ed9827f5ab83b668a60a2b0110567dd54c3e2)
Diffstat (limited to 'source4/scripting/libjs')
-rw-r--r--source4/scripting/libjs/provision.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index 894b42ceb7..db71392d8c 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -113,7 +113,7 @@ function hostip()
}
/*
- return current time as a ldap time string
+ return next USN in the sequence
*/
function nextusn()
{
@@ -160,14 +160,19 @@ function ldb_erase(ldb)
*/
function setup_ldb(ldif, dbname, subobj)
{
+ var erase = true;
var extra = "";
var ldb = ldb_init();
var lp = loadparm_init();
- if (arguments.length == 4) {
+ if (arguments.length >= 4) {
extra = arguments[3];
}
+ if (arguments.length == 5) {
+ erase = arguments[4];
+ }
+
var dbfile = dbname;
var src = lp.get("setup directory") + "/" + ldif;
@@ -178,7 +183,9 @@ function setup_ldb(ldif, dbname, subobj)
var ok = ldb.connect(dbfile);
assert(ok);
- ldb_erase(ldb);
+ if (erase) {
+ ldb_erase(ldb);
+ }
ok = ldb.add(data);
assert(ok);
@@ -237,8 +244,10 @@ function provision(subobj, message)
}
message("Setting up hklm.ldb\n");
setup_ldb("hklm.ldif", "hklm.ldb", subobj);
- message("Setting up sam.ldb\n");
- setup_ldb("provision.ldif", "sam.ldb", subobj, data);
+ message("Setting up sam.ldb attributes\n");
+ setup_ldb("provision_init.ldif", "sam.ldb", subobj);
+ message("Setting up sam.ldb data\n");
+ setup_ldb("provision.ldif", "sam.ldb", subobj, data, false);
message("Setting up rootdse.ldb\n");
setup_ldb("rootdse.ldif", "rootdse.ldb", subobj);
message("Setting up secrets.ldb\n");