summaryrefslogtreecommitdiff
path: root/src/providers/ipa
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-03-04 12:44:21 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-03-11 09:22:41 -0500
commit03e7e62d439a2ef21f3c1c074a593a15606a0e1e (patch)
tree2c2bc856f9d3821c08687368f07866acc077b5e8 /src/providers/ipa
parent29752834fbf3a19e4e117668abfce4e4c7c48ee4 (diff)
downloadsssd-03e7e62d439a2ef21f3c1c074a593a15606a0e1e.tar.gz
sssd-03e7e62d439a2ef21f3c1c074a593a15606a0e1e.tar.bz2
sssd-03e7e62d439a2ef21f3c1c074a593a15606a0e1e.zip
Write the IP address of the KDC to the kdcinfo file
Diffstat (limited to 'src/providers/ipa')
-rw-r--r--src/providers/ipa/ipa_common.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c
index 92da9d17..a50b63b9 100644
--- a/src/providers/ipa/ipa_common.c
+++ b/src/providers/ipa/ipa_common.c
@@ -24,6 +24,8 @@
#include <netdb.h>
#include <ctype.h>
+#include <arpa/inet.h>
+
#include "providers/ipa/ipa_common.h"
struct dp_option ipa_basic_opts[] = {
@@ -472,9 +474,15 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server)
return;
}
- address = talloc_asprintf(service, "%s", srvaddr->h_name);
- if (!address) {
- DEBUG(1, ("Failed to copy address ...\n"));
+ address = talloc_zero_size(service, 128);
+ if (address == NULL) {
+ DEBUG(1, ("talloc_zero failed.\n"));
+ return;
+ }
+
+ if (inet_ntop(srvaddr->h_addrtype, srvaddr->h_addr_list[0],
+ address, 128) == NULL) {
+ DEBUG(1, ("inet_ntop failed [%d][%s].\n", errno, strerror(errno)));
return;
}