[PATCH] Improve Samba4's LDB consistancy

Andrew Bartlett abartlet at samba.org
Mon Oct 29 21:01:34 GMT 2007


On Mon, 2007-10-29 at 09:15 -0400, simo wrote:
> On Mon, 2007-10-29 at 22:21 +1100, Andrew Bartlett wrote:
> > +static int fix_dn(TALLOC_CTX *mem_ctx, 
> > +                 struct ldb_dn *newdn, struct ldb_dn *parent_dn, 
> > +                 struct ldb_dn **fixed_dn) 
> > +{
> > +       /* We need the attribute name in upper case */
> > +       char *upper_rdn_attr = strupper_talloc(*fixed_dn, 
> > +
> > ldb_dn_get_rdn_name(newdn));
> > +       if (!upper_rdn_attr) {
> > +               return LDB_ERR_OPERATIONS_ERROR;
> > +       }
> > +                                              
> > +       /* Fix up the DN to be in the standard form, taking particular
> > care to match the parent DN */
> > +       *fixed_dn = ldb_dn_copy(mem_ctx, parent_dn);
> > +
> > +       /* Create a new child */
> > +       if (ldb_dn_add_child_fmt(*fixed_dn, "X=X") == false) {
> > +               return LDB_ERR_OPERATIONS_ERROR;
> > +       }
> > +
> > +       /* And replace it with CN=foo (we need the attribute in upper
> > case */
> > +       return ldb_dn_set_component(*fixed_dn, 0, upper_rdn_attr,
> > +                                   *ldb_dn_get_rdn_val(newdn));
> > +}
> 
> Why are you changing the Attribute name case here?

This matches AD behaviour, all attribute names in the DN are in UPPER
CASE.  Previously we used the case as supplied by the client which added
the DN.

Andrew Bartlett

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.
-------------- 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/20071030/d252cb55/attachment.bin


More information about the samba-technical mailing list