diff options
author | Sumit Bose <sbose@redhat.com> | 2011-06-27 10:03:03 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-06-30 14:09:10 -0400 |
commit | 7087d51975f4059591c04718def24ba7b753644c (patch) | |
tree | 3e0e03d57143394ceff8f059568a34237416af8a /src/providers/ipa | |
parent | ec425320a9bf42954a5a28b79cb567e3a9a58ecc (diff) | |
download | sssd-7087d51975f4059591c04718def24ba7b753644c.tar.gz sssd-7087d51975f4059591c04718def24ba7b753644c.tar.bz2 sssd-7087d51975f4059591c04718def24ba7b753644c.zip |
Add sockaddr_storage to sdap_service
Diffstat (limited to 'src/providers/ipa')
-rw-r--r-- | src/providers/ipa/ipa_common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index f4903094..89a8751b 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -593,6 +593,7 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server) TALLOC_CTX *tmp_ctx = NULL; struct ipa_service *service; struct resolv_hostent *srvaddr; + struct sockaddr_storage *sockaddr; char *address; const char *safe_address; char *new_uri; @@ -619,6 +620,13 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server) return; } + sockaddr = resolv_get_sockaddr_address(tmp_ctx, srvaddr, LDAP_PORT); + if (sockaddr == NULL) { + DEBUG(1, ("resolv_get_sockaddr_address failed.\n")); + talloc_free(tmp_ctx); + return; + } + address = resolv_get_string_address(tmp_ctx, srvaddr); if (address == NULL) { DEBUG(1, ("resolv_get_string_address failed.\n")); @@ -646,6 +654,8 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server) /* free old one and replace with new one */ talloc_zfree(service->sdap->uri); service->sdap->uri = new_uri; + talloc_zfree(service->sdap->sockaddr); + service->sdap->sockaddr = talloc_steal(service, sockaddr); talloc_zfree(service->krb5_service->address); service->krb5_service->address = talloc_steal(service, address); |