Commit: 1169dd3b50dfefa59b56cd1897bcd0b6c2ffb3be

tridge at samba.org tridge at samba.org
Fri Nov 20 03:49:39 MST 2009


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?

 > 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?

Cheers, Tridge


More information about the samba-technical mailing list