summaryrefslogtreecommitdiff
path: root/source4/scripting/libjs
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-29 20:18:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:56 -0500
commitc9ace93ce22fed9e1b4e44a853e23bf66cf99184 (patch)
treeba89ee82e66f1b9ca217e05e7413e9bb9d496561 /source4/scripting/libjs
parentd4f22109ee5b939d34fe11ad4cef29d22fd82cc8 (diff)
downloadsamba-c9ace93ce22fed9e1b4e44a853e23bf66cf99184.tar.gz
samba-c9ace93ce22fed9e1b4e44a853e23bf66cf99184.tar.bz2
samba-c9ace93ce22fed9e1b4e44a853e23bf66cf99184.zip
r9756: One-way upgrade from Samba3->Samba4 basically works now
Still need to polish some rough edges (This used to be commit a8f309aa812533f57a90410722dfb342c8cf3b48)
Diffstat (limited to 'source4/scripting/libjs')
-rw-r--r--source4/scripting/libjs/provision.js5
-rw-r--r--source4/scripting/libjs/upgrade.js16
2 files changed, 8 insertions, 13 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index e166f3101f..b43d435ca9 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -217,6 +217,8 @@ function provision(subobj, message, blank)
subobj.HOSTNAME = strlower(subobj.HOSTNAME);
subobj.DOMAIN = strupper(subobj.DOMAIN);
subobj.NETBIOSNAME = strupper(subobj.HOSTNAME);
+ var rdns = split(",", subobj.BASEDN);
+ subobj.RDN_DC = substr(rdns[0], strlen("DC="));
data = add_foreign(data, "S-1-5-7", "Anonymous", "${NOBODY}");
data = add_foreign(data, "S-1-1-0", "World", "${NOGROUP}");
@@ -297,9 +299,8 @@ function provision_guess()
subobj.DNSNAME = sprintf("%s.%s",
strlower(subobj.HOSTNAME),
subobj.DNSDOMAIN);
- subobj.BASEDN = "DC=" + join(",DC=", split(".", subobj.REALM));
rdn_list = split(".", subobj.REALM);
- subobj.RDN_DC = rdn_list[0];
+ subobj.BASEDN = "DC=" + join(",DC=", rdn_list);
return subobj;
}
diff --git a/source4/scripting/libjs/upgrade.js b/source4/scripting/libjs/upgrade.js
index c8539c9fcb..682721e931 100644
--- a/source4/scripting/libjs/upgrade.js
+++ b/source4/scripting/libjs/upgrade.js
@@ -241,7 +241,7 @@ function upgrade_provision(samba3)
} else {
println("Can't find domain secrets for '" + domainname + "'; using random SID and GUID");
subobj.DOMAINGUID = randguid();
- subobj.DOMAINSID = randguid();
+ subobj.DOMAINSID = randsid();
}
if (hostsec) {
@@ -270,7 +270,6 @@ function upgrade_provision(samba3)
subobj.DNSDOMAIN);
subobj.BASEDN = "DC=" + join(",DC=", split(".", subobj.REALM));
rdn_list = split(".", subobj.REALM);
- subobj.RDN_DC = rdn_list[0];
return subobj;
}
@@ -403,7 +402,6 @@ function upgrade(subobj, samba3, message)
message("Importing account policies\n");
var ldif = upgrade_sam_policy(samba3,subobj.BASEDN);
- ldifprint(ldif);
ok = samdb.modify(ldif);
assert(ok);
@@ -411,31 +409,28 @@ function upgrade(subobj, samba3, message)
message("Importing users\n");
for (var i in samba3.samaccounts) {
- message("Importing user '" + samba3.samaccounts[i].username + "'\n");
+ message("... " + samba3.samaccounts[i].username + "\n");
var ldif = upgrade_sam_account(samba3.samaccounts[i],subobj.BASEDN);
- ldifprint(ldif);
ok = samdb.add(ldif);
assert(ok);
}
message("Importing groups\n");
for (var i in samba3.groupmappings) {
- message("Importing group '" + samba3.groupmappings[i].username + "'\n");
+ message("... " + samba3.groupmappings[i].nt_name + "\n");
var ldif = upgrade_sam_group(samba3.groupmappings[i],subobj.BASEDN);
- ldifprint(ldif);
ok = samdb.add(ldif);
assert(ok);
}
message("Importing registry data\n");
- var hives = new Array("hkcr","hkcu","hklm","hkpd");
+ var hives = new Array("hkcr","hkcu","hklm","hkpd","hku","hkpt");
for (var i in hives) {
- println("... " + hives[i]);
+ message("... " + hives[i] + "\n");
var regdb = ldb_init();
ok = regdb.connect(hives[i] + ".ldb");
assert(ok);
var ldif = upgrade_registry(samba3.registry, hives[i]);
- ldifprint(ldif);
ok = regdb.add(ldif);
assert(ok);
}
@@ -446,7 +441,6 @@ function upgrade(subobj, samba3, message)
assert(ok);
var ldif = upgrade_wins(samba3);
- ldifprint(ldif);
ok = winsdb.add(ldif);
assert(ok);