From 1bc4bd4c14e01788bdb4ed09b12eaf0abacab2c1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2005 02:10:08 +0000 Subject: r8570: delete all records in the old db when provisioning, rather than using sys.unlink(). This allows smbd to see the new db without restarting. (This used to be commit 71004aa165e88f5f448dc7d90ad11dea7143f0df) --- source4/scripting/libjs/provision.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index 7133e50b4c..5ce9c8886f 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -110,6 +110,30 @@ function hostname() } +/* + erase an ldb, removing all records +*/ +function ldb_erase(ldb) +{ + var attrs = new Array("dn"); + + /* delete the specials */ + ldb.del("@INDEXLIST"); + ldb.del("@ATTRIBUTES"); + ldb.del("@SUBCLASSES"); + ldb.del("@MODULES"); + + /* and the rest */ + var res = ldb.search("(|(objectclass=*)(dn=*))", attrs); + var i; + for (i=0;i