From 16d039504763139f1221c3ff4643d1a5cb2bdc87 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 29 Oct 2007 21:25:26 +0100 Subject: r25750: Update the objectclass module to improve consistency in Samba4. The aim here is to ensure that if we have CN=Users,DC=samba,DC=example,DC=com that we cannot have a DN of the form cn=admin ,cn=useRS,DC=samba,DC=example,DC=com This module pulls apart the DN, fixes up the relative DN part, and searches for the parent to copy the base from. I've used the objectclass module, as I intend to also validate the placement of child objects, by reading the allowedChildClasses virtual attribute. In the future, I'll also force the attribute names to be consistant (using the case from the schema). Andrew Bartlett (This used to be commit c0a0c69ac5a81cfcb7c7d5ba38db59f8686c30ab) --- source4/scripting/libjs/provision.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index ef43ed721d..5ca7be99e5 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -631,6 +631,16 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda message("Erasing data from partitions\n"); ldb_erase_partitions(info, samdb, ldapbackend); + // (hack) Reload, now we have the partitions and rootdse loaded. + var commit_ok = samdb.transaction_commit(); + if (!commit_ok) { + info.message("samdb commit failed: " + samdb.errstring() + "\n"); + assert(commit_ok); + } + samdb.close(); + + samdb = open_ldb(info, paths.samdb, false); + message("Adding DomainDN: " + subobj.DOMAINDN + " (permitted to fail)\n"); var add_ok = setup_add_ldif("provision_basedn.ldif", info, samdb, true); message("Modifying DomainDN: " + subobj.DOMAINDN + "\n"); @@ -951,20 +961,21 @@ function provision_guess() // // Some Known ordering constraints: // - rootdse must be first, as it makes redirects from "" -> cn=rootdse - // - samldb must be before password_hash, because password_hash checks - // that the objectclass is of type person (filled in by samldb) + // - objectclass must be before password_hash, because password_hash checks + // that the objectclass is of type person (filled in by the objectclass + // module when expanding the objectclass list) // - partition must be last // - each partition has its own module list then modules_list = new Array("rootdse", - "kludge_acl", "paged_results", "server_sort", "extended_dn", "asq", "samldb", - "operational", - "objectclass", "rdn_name", + "objectclass", + "kludge_acl", + "operational", "subtree_rename", "linked_attributes", "show_deleted", -- cgit