Dne pondělí 16 července 2012 16:01:46, Pavel Březina napsal(a):
Expects that patch from "resolv_gethostbyname_send:
talloc_strdup
hostname on state" thread is applied.
Nack,
please don't use talloc_realloc () in sdap_sudo_get_hostnames_send(), it's
confusing. Allocating an array for three elements with talloc_zero_array()
will save you couple lines of code (all those reallocs and NULL assignments).
This is of course based on two observations I've made in the code are that
before allocation:
- the state->hostnames is NULL when calling sdap_sudo_get_hostnames_send()
- in there is no error, the state->hostnames will contain two records and NULL
You are not checking if talloc_strdup() calls returned non-NULL pointer.
I suspect you should use CONFDB_DOMAIN_RESOLV_OP_TIMEOUT instead of
CONFDB_DOMAIN_RESOLV_TIMEOUT. I'm not sure though, please take a look at
data_provider_fo.c:106 and provide a comment.
Functionally the patch is fine, I tried both with hostname being fqdn and
simple name.
Thanks
Jan