diff options
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 254775cfbc..2fe9e39e68 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -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 */ |