From a7f9d9c5b8e77e0530ace68bd2ed4a7c374bf0fa Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 25 Jul 2005 01:17:09 +0000 Subject: 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) --- source4/dsdb/samdb/ldb_modules/samldb.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/samldb.c') 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); -- cgit