diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-07-25 01:17:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:30:00 -0500 |
commit | a7f9d9c5b8e77e0530ace68bd2ed4a7c374bf0fa (patch) | |
tree | 96bb2ff20365611d7587d79aaaa41791c135c59e /source4/dsdb | |
parent | 77e52a4e2c4587785930491695486b2d8b26b509 (diff) | |
download | samba-a7f9d9c5b8e77e0530ace68bd2ed4a7c374bf0fa.tar.gz samba-a7f9d9c5b8e77e0530ace68bd2ed4a7c374bf0fa.tar.bz2 samba-a7f9d9c5b8e77e0530ace68bd2ed4a7c374bf0fa.zip |
r8740: Extend the rdn_name module to handle adding the rdn as an attribute. ie:
dn: cn=foo,ou=bar
objectClass: person
implies
dn: cn=foo,ou=bar
objectClass: person
cn: foo
(as well as a pile more default attributes)
We also correct the case in the attirbute to match that in the DN
(win2k3 behaviour) and I have a testsuite (in ejs) to prove it.
This module also found a bug in our provision.ldif, so and reduces
code complexity in the samdb module.
Andrew Bartlett
(This used to be commit 0cc58f5c3cce12341ad0f7a90cdd85a3fab786b3)
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samldb.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index f0f44cf4d5..7b82621c8d 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -410,17 +410,6 @@ static struct ldb_message *samldb_fill_group_object(struct ldb_module *module, c return NULL; } - if ((attribute = samldb_find_attribute(msg2, "cn", NULL)) != NULL) { - if (strcasecmp(rdn->value.data, attribute->values[0].data) != 0) { - ldb_debug(module->ldb, LDB_DEBUG_FATAL, "samldb_fill_group_object: Bad Attribute Syntax for CN\n"); - return NULL; - } - } else { /* FIXME: remove this if ldb supports natively aliasing between the rdn and the "cn" attribute */ - if ( ldb_msg_add_value(module->ldb, msg2, "cn", &rdn->value)) { - return NULL; - } - } - if ((attribute = samldb_find_attribute(msg2, "objectSid", NULL)) == NULL ) { struct dom_sid *sid = samldb_get_new_sid(module, msg2, msg2->dn); if (sid == NULL) { @@ -481,7 +470,7 @@ static struct ldb_message *samldb_fill_user_or_computer_object(struct ldb_module return NULL; } if (strcasecmp(rdn->name, "cn") != 0) { - ldb_debug(module->ldb, LDB_DEBUG_FATAL, "samldb_fill_user_or_computer_object: Bad RDN (%s) for group!\n", rdn->name); + ldb_debug(module->ldb, LDB_DEBUG_FATAL, "samldb_fill_user_or_computer_object: Bad RDN (%s) for user/computer!\n", rdn->name); return NULL; } @@ -490,17 +479,6 @@ static struct ldb_message *samldb_fill_user_or_computer_object(struct ldb_module return NULL; } - if ((attribute = samldb_find_attribute(msg2, "cn", NULL)) != NULL) { - if (strcasecmp(rdn->value.data, attribute->values[0].data) != 0) { - ldb_debug(module->ldb, LDB_DEBUG_FATAL, "samldb_fill_group_object: Bad Attribute Syntax for CN\n"); - return NULL; - } - } else { /* FIXME: remove this if ldb supports natively aliasing between the rdn and the "cn" attribute */ - if ( ldb_msg_add_value(module->ldb, msg2, "cn", &rdn->value)) { - return NULL; - } - } - if ((attribute = samldb_find_attribute(msg2, "objectSid", NULL)) == NULL ) { struct dom_sid *sid; sid = samldb_get_new_sid(module, msg2, msg2->dn); |