svn commit: samba r17503 - in
branches/SAMBA_4_0/source/lib/ldb: common include
Andrew Bartlett
abartlet at samba.org
Sat Aug 12 23:40:21 GMT 2006
On Sat, 2006-08-12 at 15:20 +0000, idra at samba.org wrote:
> Author: idra
> Date: 2006-08-12 15:20:06 +0000 (Sat, 12 Aug 2006)
> New Revision: 17503
>
> WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17503
>
> Log:
>
> Add a useful function to search for a DN
This function name is rather confusing (it doesn't for example return
the existing DN of a msg). Could we have instead
ldb_msg_attribute2dn()?
> Modified:
> branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c
> branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
>
>
> Changeset:
> Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c
> ===================================================================
> --- branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c 2006-08-12 10:42:17 UTC (rev 17502)
> +++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c 2006-08-12 15:20:06 UTC (rev 17503)
> @@ -377,6 +377,19 @@
> 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
> */
>
> Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
> ===================================================================
> --- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-08-12 10:42:17 UTC (rev 17502)
> +++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-08-12 15:20:06 UTC (rev 17503)
> @@ -1269,6 +1269,10 @@
> 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,
>
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Red Hat Inc. http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20060813/c2de911d/attachment.bin
More information about the samba-technical
mailing list