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

Jakub Hrozek jhrozek at redhat.com
Tue Dec 8 18:53:59 UTC 2009


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

On 12/08/2009 02:20 PM, Martin Nagy wrote:
> Unfortunately, that still doesn't solve the issue. These functions are
> surprisingly difficult to get right. The way the code is now, you don't
> link the list items. I also just noticed that we don't handle cases were
> *reply_list == NULL. Also, if we return in the middle of the function,
> we forget to free the original reply_list. Also,
> ares_free_data(reply_list); is wrong, because you're passing ares the
> double pointer, the correct way would be to pass *reply_list (and even
> better, simply old_list).
> 

Thank you for the review, the issues should be fixed now.

> Seeing as these functions are so much tricky, I propose one of the
> following to be done:
> 
> 1. Fix the issues outlined, create an extensive test similar to
> test_copy_hostent in resolv-test.c (for at least 2 items in the list).
> Include a special case in the test calling the function with NULL list,
> etc. Also don't forget about leak checks. Try running the test with
> mudflap to make sure we don't access any pointers that we shouldn't.
> This way, I'd be pretty confident that the code is good.

We discussed this on IRC with Martin - writing these tests is
nontrivial, because the a) the rewrite functions are static b) the ares
parsing functions allocate some private data which are freed in the
rewrite functions in our resolv code with ares_free_data.

We could work around this by shadowing ares_free_data with a dummy
function etc., but since we need these patches to build and rawhide, the
code seems to be working (for manual testing) and we currently don't use
the SRV and TXT parsing anywhere, this could be a post-1.0 task.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkseoLMACgkQHsardTLnvCUCtwCg0szmgyR3mkLTxBVrBI2Dggh7
4aMAnR8754TdW/Xqhz1fwIP43tWjQdIJ
=ybc7
-----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: 14177 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091208/7a778cba/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Import-ares-1.7.0-helpers.patch
Type: text/x-patch
Size: 22712 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091208/7a778cba/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: 2223 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091208/7a778cba/attachment-0002.bin>


More information about the sssd-devel mailing list