1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

r17503: Add a useful function to search for a DN

This commit is contained in:
Simo Sorce
2006-08-12 15:20:06 +00:00
committed by Gerald (Jerry) Carter
parent 009d090594
commit 8c6efd7b55
2 changed files with 17 additions and 0 deletions

View File

@ -377,6 +377,19 @@ const char *ldb_msg_find_string(const struct ldb_message *msg,
return (const char *)v->data;
}
struct ldb_dn *ldb_msg_find_dn(void *mem_ctx,
const struct ldb_message *msg,
const char *attr_name)
{
const struct ldb_val *v;
v = ldb_msg_find_ldb_val(msg, attr_name);
if (!v || !v->data) {
return NULL;
}
return ldb_dn_explode(mem_ctx, (const char *)v->data);
}
/*
sort the elements of a message by name
*/

View File

@ -1269,6 +1269,10 @@ const char *ldb_msg_find_string(const struct ldb_message *msg,
const char *attr_name,
const char *default_value);
struct ldb_dn *ldb_msg_find_dn(void *mem_ctx,
const struct ldb_message *msg,
const char *attr_name);
void ldb_msg_sort_elements(struct ldb_message *msg);
struct ldb_message *ldb_msg_copy_shallow(void *mem_ctx,