summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-03 17:56:09 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-06 20:47:41 +0200
commit430491b2df9e3512a98a88aa279f04a91c12be92 (patch)
tree54b6a964a7c1cd54424406cbd04376a1f0082c7a /source4
parentcadf774f8b8af2aedcdd359acf51695e9f4b04db (diff)
downloadsamba-430491b2df9e3512a98a88aa279f04a91c12be92.tar.gz
samba-430491b2df9e3512a98a88aa279f04a91c12be92.tar.bz2
samba-430491b2df9e3512a98a88aa279f04a91c12be92.zip
s4:rdn_name LDB module - remove "rdn_name_find_attribute"
It does exactly the same as "ldb_msg_find_element".
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/modules/rdn_name.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index 3a4068daf2..ee5ab9a4fd 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -46,19 +46,6 @@ struct rename_context {
struct ldb_reply *ares;
};
-static struct ldb_message_element *rdn_name_find_attribute(const struct ldb_message *msg, const char *name)
-{
- unsigned int i;
-
- for (i = 0; i < msg->num_elements; i++) {
- if (ldb_attr_cmp(name, msg->elements[i].name) == 0) {
- return &msg->elements[i];
- }
- }
-
- return NULL;
-}
-
static int rdn_name_add_callback(struct ldb_request *req,
struct ldb_reply *ares)
{
@@ -130,7 +117,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
rdn_val = ldb_val_dup(msg, ldb_dn_get_rdn_val(msg->dn));
/* Perhaps someone above us tried to set this? */
- if ((attribute = rdn_name_find_attribute(msg, "name")) != NULL ) {
+ if ((attribute = ldb_msg_find_element(msg, "name")) != NULL ) {
attribute->num_values = 0;
}
@@ -144,7 +131,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- attribute = rdn_name_find_attribute(msg, rdn_name);
+ attribute = ldb_msg_find_element(msg, rdn_name);
if (!attribute) {
/* add entry with normalised RDN information if possible */
if (a->name != NULL) {