1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

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 commit is contained in:
Andrew Bartlett
2007-10-29 21:25:26 +01:00
committed by Stefan Metzmacher
parent cd64094787
commit c0a0c69ac5
3 changed files with 394 additions and 100 deletions

View File

@@ -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",