summaryrefslogtreecommitdiff
path: root/source4/scripting/libjs/upgrade.js
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/libjs/upgrade.js')
-rw-r--r--source4/scripting/libjs/upgrade.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/source4/scripting/libjs/upgrade.js b/source4/scripting/libjs/upgrade.js
index a8f717badc..161195a60d 100644
--- a/source4/scripting/libjs/upgrade.js
+++ b/source4/scripting/libjs/upgrade.js
@@ -513,13 +513,18 @@ function upgrade_smbconf(oldconf,mark)
return newconf;
}
-function upgrade(subobj, samba3, message, paths)
+function upgrade(subobj, samba3, message, paths, session_info, credentials)
{
var ret = 0;
var lp = loadparm_init();
var samdb = ldb_init();
+ samdb.session_info = session_info;
+ samdb.credentials = credentials;
var ok = samdb.connect(paths.samdb);
- assert(ok);
+ if (!ok) {
+ info.message("samdb connect failed: " + samdb.errstring() + "\n");
+ assert(ok);
+ }
message("Writing configuration\n");
var newconf = upgrade_smbconf(samba3.configuration,true);
@@ -528,11 +533,17 @@ function upgrade(subobj, samba3, message, paths)
message("Importing account policies\n");
var ldif = upgrade_sam_policy(samba3,subobj.BASEDN);
ok = samdb.modify(ldif);
- assert(ok);
-
+ if (!ok) {
+ message("samdb load failed: " + samdb.errstring() + "\n");
+ assert(ok);
+ }
var regdb = ldb_init();
ok = regdb.connect(paths.hklm);
- assert(ok);
+ if (!ok) {
+ message("registry connect: " + regdb.errstring() + "\n");
+ assert(ok);
+ }
+
ok = regdb.modify(sprintf("
dn: value=RefusePasswordChange,key=Parameters,key=Netlogon,key=Services,key=CurrentControlSet,key=System,HIVE=NONE
replace: type
@@ -540,7 +551,10 @@ type: 4
replace: data
data: %d
", samba3.policy.refuse_machine_password_change));
- assert(ok);
+ if (!ok) {
+ message("registry load failed: " + regdb.errstring() + "\n");
+ assert(ok);
+ }
message("Importing users\n");
for (var i in samba3.samaccounts) {