diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-01-15 09:03:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:51:12 -0500 |
commit | ba07f94438560830f9b4470ecd9577b8333475bf (patch) | |
tree | ed313d0169b2b2cfcf21844c1cbfdc29b1f317e9 /source4/scripting/libjs | |
parent | d59667fd2192920c8dd33cde8ff25fd5af0e00c3 (diff) | |
download | samba-ba07f94438560830f9b4470ecd9577b8333475bf.tar.gz samba-ba07f94438560830f9b4470ecd9577b8333475bf.tar.bz2 samba-ba07f94438560830f9b4470ecd9577b8333475bf.zip |
r12945: Try to move closer to getting Samba3 import working again.
There still a few things to work out
Andrew Bartlett
(This used to be commit 701558b5fe917555416eb0d100ef756f8ef7cf65)
Diffstat (limited to 'source4/scripting/libjs')
-rw-r--r-- | source4/scripting/libjs/upgrade.js | 26 |
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) { |