[Freeipa-devel] [PATCH 0141] Generalize attribute_name<->rdata_type conversions

Petr Spacek pspacek at redhat.com
Fri May 10 14:57:37 UTC 2013

On 6.5.2013 17:40, Tomas Hozza wrote:
> On 04/08/2013 07:45 PM, Petr Spacek wrote:
>> Generalize attribute_name<->rdata_type conversions.
>> Attribute names are generated on-the-fly: String "Record" is appended
>> to textual representation of DNS RDATA type.
>> String "Record" is cut down from the attribute name during
>> attribute name to rdata type conversion.
>>  From now, the plugin doesn't add artificial limitation to supported
>> record types.
> ACK.
> The patch looks good. (I didn't do functional test)
> Cosmetic issue:
> I think it would be good to dynamically allocate "mod_type" in LDAPMod
> in every case and include the "mod_type" memory freeing in
> free_ldapmod() function. Now one has to be be careful when it is
> statically or dynamically allocated. Before it was static in every case.

It is good idea. This version of the patch contains ldap_mod_create() function 
which allocates the whole structure including mod_type of fixed size. All 
writes to mod_type checks the array length, so it should not cause any harm.

The function modify_soa_record() still uses statically allocated LDAPMod 
structure with statically allocated strings for mod_type, but the LDAPMod 
structure never leave this function. There are no calls to ldap_mod_create() 
and ldap_mod_free(), so I think it is obvious.

Tbabej, please try to dynamically update some A records with sync_ptr enabled. 
(And of course the support for some new type, like TLSA.)

Thank you!

Petr^2 Spacek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bind-dyndb-ldap-pspacek-0141-2-Generalize-attribute_name-rdata_type-conversions.patch
Type: text/x-patch
Size: 10661 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20130510/ad7aeb55/attachment.bin>

More information about the Freeipa-devel mailing list