From 24d2107324982d8ad69fb89d13037ba591f49534 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 20 Jul 2005 11:43:23 +0000 Subject: 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) --- source4/scripting/libjs/provision.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'source4/scripting/libjs') 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"); -- cgit