[SSSD] [PATCH] c-ares 1.7.0 related changes

Jakub Hrozek jhrozek at redhat.com
Mon Dec 7 19:03:22 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/02/2009 03:07 PM, Martin Nagy wrote:
> 
> I think we should just push these patches (after the review is done) and
> then disable them in the build & configure system like Stephen did for
> ELAPI (although FWIW, I think it would be nice to keep the tests
> running).
> 

OK, I just think this should be a separate patch - hence 0003.

>> [PATCH 1/2] Change ares usage to be c-ares 1.7.0 compatible
>> * Rename structure accordingly to ares upstream
>> * Use new ares parsing functions in the wrappers
>> * fix tests for ares 1.7
> 
>>From rewrite_talloc_srv_reply():
> +        if (ptr->host == NULL) {
> +            talloc_free(ptr);
>              return ENOMEM;
>          }
> +
> I believe this should be talloc_free(new_list), otherwise you might try
> to free a pointer pointing into middle of a talloc'ed memory. Also, is

Thanks, fixed.

> it wise to allocate an array for a linked list? I would recommend
> allocating each list item separately using mem_ctx and maybe provide a
> free function that would free all the items.

OK, each item is now allocated using talloc_zero in the loop. I just
think the other items including the SRV/TXT payload should be allocated
using new_list as a context, that way you can just talloc_free(new_list).

> 
> +        ptr = ptr->next;
> +        old_list = old_list->next;
> This is also bad, since ptr->next is not initialized.
> 

For whatever reason I thought talloc_array was using talloc_zero under
the hood. Using talloc_zero for every item separately now takes care of it.

> Same goes for rewrite_talloc_txt_reply().
> 

Also fixed.

>> [PATCH 2/2] Import ares 1.7.0 helpers
>> Synchronizes the bundled helpers with the changes done during the c-ares
>> 1.7.0 development in order for the SRV and TXT parsing routines to work
>> also with pre-1.7.0 ares versions.
> 
> Sorry, I didn't yet have time to review it, I will do it later (tomorrow
> probably).

The attached patch 0002 fixes the issue you outlined in the other reply
to the thread.

	Jakub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAksdUXQACgkQHsardTLnvCVifgCgnGX25X2yxF/FMLh9KtAiYnZB
lTEAnRrWvivyOrCEOrsZsBFfdIZ/dDhy
=Va/X
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Change-ares-usage-to-be-c-ares-1.7.0-compatible.patch
Type: text/x-patch
Size: 13677 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091207/117bfc8e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Import-ares-1.7.0-helpers.patch
Type: text/x-patch
Size: 22714 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091207/117bfc8e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Don-t-build-the-SRV-and-TXT-parsing-code-except-for-.patch
Type: text/x-patch
Size: 2225 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091207/117bfc8e/attachment-0002.bin>


More information about the sssd-devel mailing list