diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-22 16:39:56 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-22 16:39:56 +0100 |
commit | 4075a2ba982ea56ff925e0a33839f0760fd71911 (patch) | |
tree | 87d87734257f814b7960a843e54455c447f34a9e /source4/scripting/libjs | |
parent | 24da29746998de1001d18871dcbe8d37643667d5 (diff) | |
parent | 35c68316442808a135aafa864d19592108a4d879 (diff) | |
download | samba-4075a2ba982ea56ff925e0a33839f0760fd71911.tar.gz samba-4075a2ba982ea56ff925e0a33839f0760fd71911.tar.bz2 samba-4075a2ba982ea56ff925e0a33839f0760fd71911.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-python
(This used to be commit 2f57e25f8f692889d9e057e13256f8a24c5ec10c)
Diffstat (limited to 'source4/scripting/libjs')
-rw-r--r-- | source4/scripting/libjs/provision.js | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index 0da02ae276..0cca49dec9 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -170,7 +170,7 @@ function ldb_erase(info, ldb) /* and the rest */ attrs = new Array("dn"); var basedn = ""; - var res = ldb.search("(&(|(objectclass=*)(dn=*))(!(dn=@BASEINFO)))", basedn, ldb.SCOPE_SUBTREE, attrs); + var res = ldb.search("(&(|(objectclass=*)(distinguishedName=*))(!(distinguishedName=@BASEINFO)))", basedn, ldb.SCOPE_SUBTREE, attrs); var i; if (res.error != 0) { ldb_delete(info, ldb); @@ -180,7 +180,7 @@ function ldb_erase(info, ldb) ldb.del(res.msgs[i].dn); } - var res = ldb.search("(&(|(objectclass=*)(dn=*))(!(dn=@BASEINFO)))", basedn, ldb.SCOPE_SUBTREE, attrs); + var res = ldb.search("(&(|(objectclass=*)(distinguishedName=*))(!(distinguishedName=@BASEINFO)))", basedn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 0) { ldb_delete(info, ldb); return; @@ -207,8 +207,8 @@ function ldb_erase_partitions(info, ldb, ldapbackend) return; } for (j=0; j<res.msgs[0].namingContexts.length; j++) { - var anything = "(|(objectclass=*)(dn=*))"; - var attrs = new Array("dn"); + var anything = "(|(objectclass=*)(distinguishedName=*))"; + var attrs = new Array("distinguishedName"); var basedn = res.msgs[0].namingContexts[j]; var k; var previous_remaining = 1; @@ -398,9 +398,6 @@ function provision_default_paths(subobj) paths.named_conf = lp.get("private dir") + "/named.conf"; paths.winsdb = "wins.ldb"; paths.ldapdir = lp.get("private dir") + "/ldap"; - paths.ldap_basedn_ldif = paths.ldapdir + "/" + dnsdomain + ".ldif"; - paths.ldap_config_basedn_ldif = paths.ldapdir + "/" + dnsdomain + "-config.ldif"; - paths.ldap_schema_basedn_ldif = paths.ldapdir + "/" + dnsdomain + "-schema.ldif"; paths.s4_ldapi_socket = lp.get("private dir") + "/ldapi"; paths.phpldapadminconfig = lp.get("private dir") + "/phpldapadmin-config.php"; @@ -866,6 +863,12 @@ function provision_schema(subobj, message, tmp_schema_path, paths) /* This will erase anything in the tmp db */ var samdb = open_ldb(info, tmp_schema_path, true); + message("Setting up sam.ldb attributes\n"); + setup_add_ldif("provision_init.ldif", info, samdb, false); + + message("Setting up sam.ldb rootDSE\n"); + setup_add_ldif("provision_rootdse_add.ldif", info, samdb, false); + message("Adding schema container (permitted to fail)\n"); var add_ok = setup_add_ldif("provision_schema_basedn.ldif", info, samdb, true); message("Modifying schema container\n"); @@ -934,34 +937,6 @@ function provision_dns(subobj, message, paths, session_info, credentials) message("Please install the zone located in " + paths.dns + " into your DNS server. A sample BIND configuration snippit is at " + paths.named_conf + "\n"); } -/* Write out a DNS zone file, from the info in the current database */ -function provision_ldapbase(subobj, message, paths) -{ - var ok = provision_fix_subobj(subobj, paths); - assert(ok); - - message("Setting up LDAP base entry: " + subobj.DOMAINDN + " \n"); - var rdns = split(",", subobj.DOMAINDN); - subobj.EXTENSIBLEOBJECT = "objectClass: extensibleObject"; - - subobj.RDN_DC = substr(rdns[0], strlen("DC=")); - - sys.mkdir(paths.ldapdir, 0700); - - setup_file("provision_basedn.ldif", - message, paths.ldap_basedn_ldif, - subobj); - - setup_file("provision_configuration_basedn.ldif", - message, paths.ldap_config_basedn_ldif, - subobj); - - setup_file("provision_schema_basedn.ldif", - message, paths.ldap_schema_basedn_ldif, - subobj); - -} - /* guess reasonably default options for provisioning @@ -1038,14 +1013,13 @@ function provision_guess() subobj.DOMAINDN_LDB = "users.ldb"; subobj.CONFIGDN_LDB = "configuration.ldb"; subobj.SCHEMADN_LDB = "schema.ldb"; - subobj.DOMAINDN_MOD = "pdc_fsmo,password_hash"; - subobj.CONFIGDN_MOD = "naming_fsmo"; - subobj.SCHEMADN_MOD = "schema_fsmo"; + subobj.DOMAINDN_MOD = "pdc_fsmo,password_hash,instancetype"; + subobj.CONFIGDN_MOD = "naming_fsmo,instancetype"; + subobj.SCHEMADN_MOD = "schema_fsmo,instancetype"; subobj.DOMAINDN_MOD2 = ",objectguid"; subobj.CONFIGDN_MOD2 = ",objectguid"; subobj.SCHEMADN_MOD2 = ",objectguid"; - subobj.EXTENSIBLEOBJECT = "# no objectClass: extensibleObject for local ldb"; subobj.ACI = "# no aci for local ldb"; return subobj; |