samba-technical@lists.samba.org
[Top] [All Lists]

Re: svn commit: samba r17503 - in branches/SAMBA_4_0/source/lib/ldb: com

Subject: Re: svn commit: samba r17503 - in branches/SAMBA_4_0/source/lib/ldb: common include
From: Andrew Bartlett
Date: Sun, 13 Aug 2006 09:40:21 +1000
On Sat, 2006-08-12 at 15:20 +0000, idra@xxxxxxxxx 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
<Prev in Thread] Current Thread [Next in Thread>
  • Re: svn commit: samba r17503 - in branches/SAMBA_4_0/source/lib/ldb: common include, Andrew Bartlett <=