Commit: 1169dd3b50dfefa59b56cd1897bcd0b6c2ffb3be
Andrew Bartlett
abartlet at samba.org
Sun Nov 22 20:21:15 MST 2009
On Fri, 2009-11-20 at 21:49 +1100, tridge at samba.org wrote:
> Hi Kamen,
>
> > However, could you plese consider renaming this function to something
> > like ldb_msg_add_dn_string() (ldb_msg_add_string_dn()... whatever)
> > - this way it will be obvious it adds string representation of the DN,
> > not the DN itself.
>
> Is it ever valid to add a DN to a ldb_message as anything other than a
> string?
Yes, I think it should be ldb_msg_add_linearized_dn(). That would match
the current nomenclature of the ldb_dn.c code, and not add an extended
DN (which is another, quite valid DN form).
> > Also, not copying linearized DN string could lead to some very
> > tricky to resolve bugs. It seems replaces in ldb_map_inbound.c
> > are exactly this case - DN string is allocated in 'dn' context,
> > but the it is expected to live in 'ac->local_msg' context.
>
> I think you're right about this being a possible trap.
>
> How about we add ldb_msg_add_string_copy(), which will be like
> ldb_msg_add_string() but which uses strdup(), and make
> ldb_msg_add_dn() use that?
Perhaps just use ldb_msg_add_steal_string() and
ldb_dn_alloc_linearized()?
Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Cisco 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/pipermail/samba-technical/attachments/20091123/5a25cd7d/attachment.pgp>
More information about the samba-technical
mailing list