diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-10-16 03:53:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:21:08 -0500 |
commit | 8afbf3a0ef63dfc5553e7de8dc498685d8fd2bc7 (patch) | |
tree | 0769290a24458408048cd3ec79d6f37d54da3898 | |
parent | 064b605fab5393a1f9856d06ff56994676d57541 (diff) | |
download | samba-8afbf3a0ef63dfc5553e7de8dc498685d8fd2bc7.tar.gz samba-8afbf3a0ef63dfc5553e7de8dc498685d8fd2bc7.tar.bz2 samba-8afbf3a0ef63dfc5553e7de8dc498685d8fd2bc7.zip |
r19318: Because we don't test the vampire code in SWAT very regularly, it bit-rotted.
Fix up interfaces and interaction between the two..
Andrew Bartlett
(This used to be commit 9b77d285d8cd8999547c0d17e97681d236acbdb0)
-rw-r--r-- | source4/scripting/libjs/provision.js | 6 | ||||
-rw-r--r-- | swat/install/vampire.esp | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index 2dc6bb522b..05e6726244 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -368,10 +368,12 @@ function provision_default_paths(subobj) /* setup reasonable name mappings for sam names to unix names */ -function setup_name_mappings(info, subobj, ldb) +function setup_name_mappings(info, ldb) { var lp = loadparm_init(); var attrs = new Array("objectSid"); + var subobj = info.subobj; + res = ldb.search("objectSid=*", subobj.BASEDN, ldb.SCOPE_BASE, attrs); assert(res.length == 1 && res[0].objectSid != undefined); var sid = res[0].objectSid; @@ -525,7 +527,7 @@ function provision(subobj, message, blank, paths, session_info, credentials) message("Setting up sam.ldb users and groups\n"); setup_add_ldif("provision_users.ldif", info, samdb, false); - if (setup_name_mappings(info, subobj, samdb) == false) { + if (setup_name_mappings(info, samdb) == false) { return false; } diff --git a/swat/install/vampire.esp b/swat/install/vampire.esp index 437cbda32c..9ce874cd18 100644 --- a/swat/install/vampire.esp +++ b/swat/install/vampire.esp @@ -58,18 +58,22 @@ if (form['submit'] == "Migrate") { writefln("You need to set 'server role' to 'member server' before starting the migration process"); } else { var creds = credentials_init(); + var samdb; creds.set_username(form.ADMIN); creds.set_password(form.ADMINPASS); creds.set_domain(form.DOMAIN); creds.set_realm(form.REALM); var info = new Object(); - info.message = writefln; - var paths = provision_default_paths(subobj); var session_info = session.authinfo.session_info; var credentials = session.authinfo.credentials; + info.credentials = credentials; + info.session_info = session_info; + info.message = writefln; + info.subobj = subobj; + /* Setup a basic database structure, but don't setup any users */ if (!provision(subobj, writefln, true, paths, session_info, credentials)) { @@ -86,7 +90,10 @@ if (form['submit'] == "Migrate") { } else if (!provision_dns(subobj, writefln, paths, session.authinfo.session_info, session.authinfo.credentials)) { writefln("DNS Provision failed!"); - } else if (!setup_name_mappings(info, subobj, session_info, credentials)) { + } else if (!(samdb = open_ldb(info, paths.samdb, false))) { + writefln("Opening " + paths.samdb + " failed!"); + info.samdb = samdb; + } else if (!setup_name_mappings(info, samdb)) { writefln("Setup of name mappings failed!"); } else { var zonepath = paths.dns; |