summaryrefslogtreecommitdiff
path: root/source3/libaddns/dnsrecord.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-12-14 16:27:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:29 -0500
commitd879aa8f3617b256a16889d04a39a25b27f5bb39 (patch)
treef589ce978809a185c1981d944b423d54936f3c27 /source3/libaddns/dnsrecord.c
parent35a3773a6df72fc4031b90fb94010193966dbdc0 (diff)
downloadsamba-d879aa8f3617b256a16889d04a39a25b27f5bb39.tar.gz
samba-d879aa8f3617b256a16889d04a39a25b27f5bb39.tar.bz2
samba-d879aa8f3617b256a16889d04a39a25b27f5bb39.zip
r20170: Fix secure DNS updates to work against
Wnidows 2000 DNS which expects the TKEY payload to be in the answer section and not in the additional set of records (like Windows 2003 and the RFC). (This used to be commit a3b6734fdad5fd92dbec075ebcd8d7044aac45c2)
Diffstat (limited to 'source3/libaddns/dnsrecord.c')
-rw-r--r--source3/libaddns/dnsrecord.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/libaddns/dnsrecord.c b/source3/libaddns/dnsrecord.c
index 6dfb8edf5c..0cf4793935 100644
--- a/source3/libaddns/dnsrecord.c
+++ b/source3/libaddns/dnsrecord.c
@@ -356,12 +356,14 @@ DNS_ERROR dns_create_probe(TALLOC_CTX *mem_ctx, const char *zone,
DNS_ERROR dns_create_update_request(TALLOC_CTX *mem_ctx,
const char *domainname,
const char *hostname,
- in_addr_t ip_addr,
+ const in_addr_t *ip_addr,
+ size_t num_addrs,
struct dns_update_request **preq)
{
struct dns_update_request *req;
struct dns_rrec *rec;
DNS_ERROR err;
+ size_t i;
err = dns_create_update(mem_ctx, domainname, &req);
if (!ERR_DNS_IS_OK(err)) return err;
@@ -389,14 +391,18 @@ DNS_ERROR dns_create_update_request(TALLOC_CTX *mem_ctx,
if (!ERR_DNS_IS_OK(err)) goto error;
/*
- * .. and add our IP
+ * .. and add our IPs
*/
- err = dns_create_a_record(req, hostname, 3600, ip_addr, &rec);
- if (!ERR_DNS_IS_OK(err)) goto error;
+ for ( i=0; i<num_addrs; i++ ) {
+ err = dns_create_a_record(req, hostname, 3600, ip_addr[i], &rec);
+ if (!ERR_DNS_IS_OK(err))
+ goto error;
- err = dns_add_rrec(req, rec, &req->num_updates, &req->updates);
- if (!ERR_DNS_IS_OK(err)) goto error;
+ err = dns_add_rrec(req, rec, &req->num_updates, &req->updates);
+ if (!ERR_DNS_IS_OK(err))
+ goto error;
+ }
*preq = req;
return ERROR_DNS_SUCCESS;