summaryrefslogtreecommitdiff
path: root/source4/scripting/libjs/upgrade.js
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-31 02:39:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:35:04 -0500
commitf58a74aabab3d5c0d1185ac2f77a5f54feb781e9 (patch)
tree79d531450d96f07da379fdd72fb40d1221570627 /source4/scripting/libjs/upgrade.js
parent40f85ace04abad7460d0f0afe9211c4280482c6c (diff)
downloadsamba-f58a74aabab3d5c0d1185ac2f77a5f54feb781e9.tar.gz
samba-f58a74aabab3d5c0d1185ac2f77a5f54feb781e9.tar.bz2
samba-f58a74aabab3d5c0d1185ac2f77a5f54feb781e9.zip
r9816: Work on testsuite for upgrade
Add 'paths' object to provision code. (This used to be commit 488d737fb0ebbc2535d0ec17c14f0dc1eaf2a578)
Diffstat (limited to 'source4/scripting/libjs/upgrade.js')
-rw-r--r--source4/scripting/libjs/upgrade.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/source4/scripting/libjs/upgrade.js b/source4/scripting/libjs/upgrade.js
index 0e12d7c345..4fe6b8cc1e 100644
--- a/source4/scripting/libjs/upgrade.js
+++ b/source4/scripting/libjs/upgrade.js
@@ -403,17 +403,17 @@ function upgrade_smbconf(oldconf,mark)
return newconf;
}
-function upgrade(subobj, samba3, message)
+function upgrade(subobj, samba3, message, paths)
{
var ret = 0;
var lp = loadparm_init();
var samdb = ldb_init();
- var ok = samdb.connect("sam.ldb");
+ var ok = samdb.connect(paths.samdb);
assert(ok);
message("Writing configuration\n");
var newconf = upgrade_smbconf(samba3.configuration,true);
- newconf.save(lp.get("config file"));
+ newconf.save(paths.smbconf);
message("Importing account policies\n");
var ldif = upgrade_sam_policy(samba3,subobj.BASEDN);
@@ -474,11 +474,12 @@ dn: @MAP=samba3sam
message("Importing registry data\n");
var hives = new Array("hkcr","hkcu","hklm","hkpd","hku","hkpt");
for (var i in hives) {
- message("... " + hives[i] + "\n");
+ var hn = hives[i];
+ message("... " + hn + "\n");
var regdb = ldb_init();
- ok = regdb.connect(hives[i] + ".ldb");
+ ok = regdb.connect(paths[hn]);
assert(ok);
- var ldif = upgrade_registry(samba3.registry, hives[i]);
+ var ldif = upgrade_registry(samba3.registry, hn);
for (var j in ldif) {
message("... ... " + j);
ok = regdb.add(ldif[j]);
@@ -492,7 +493,7 @@ dn: @MAP=samba3sam
message("Importing WINS data\n");
var winsdb = ldb_init();
- ok = winsdb.connect("wins.ldb");
+ ok = winsdb.connect(paths.winsdb);
assert(ok);
ldb_erase(winsdb);
@@ -500,8 +501,5 @@ dn: @MAP=samba3sam
ok = winsdb.add(ldif);
assert(ok);
- message("Reloading smb.conf\n");
- lp.reload();
-
return ret;
}