diff options
author | Gerald Carter <jerry@samba.org> | 2006-12-14 17:00:10 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:29 -0500 |
commit | db7bf9a6b6754b604ee44d28c564bab10c7b98a7 (patch) | |
tree | 0eb5c3b53cf3410e6667651d7e337f40cb9c0656 /source3/utils/net_dns.c | |
parent | 3ff4f4410ff71fc4c74b7546d0c0002918a32cf3 (diff) | |
download | samba-db7bf9a6b6754b604ee44d28c564bab10c7b98a7.tar.gz samba-db7bf9a6b6754b604ee44d28c564bab10c7b98a7.tar.bz2 samba-db7bf9a6b6754b604ee44d28c564bab10c7b98a7.zip |
r20173: DNS update fixes:
* Fix DNS updates for multi-homed hosts
* Child domains often don't have an NS record in
DNS so we have to fall back to looking up the the NS
records for the forest root.
* Fix compile warning caused by mismatched 'struct in_addr'
and 'in_addr_t' parameters called to DoDNSUpdate()
(This used to be commit 3486acd3c3ebefae8f98dcc72d1c3d6b06fffcc7)
Diffstat (limited to 'source3/utils/net_dns.c')
-rw-r--r-- | source3/utils/net_dns.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/source3/utils/net_dns.c b/source3/utils/net_dns.c index 81d7dd596a..16f50ae4cd 100644 --- a/source3/utils/net_dns.c +++ b/source3/utils/net_dns.c @@ -30,9 +30,9 @@ /********************************************************************* *********************************************************************/ -DNS_ERROR DoDNSUpdate(ADS_STRUCT *ads, char *pszServerName, +DNS_ERROR DoDNSUpdate(char *pszServerName, const char *pszDomainName, const char *pszHostName, - const struct in_addr *iplist, int num_addrs ) + const struct in_addr *iplist, size_t num_addrs ) { DNS_ERROR err; struct dns_connection *conn; @@ -74,7 +74,7 @@ DNS_ERROR DoDNSUpdate(ADS_STRUCT *ads, char *pszServerName, */ err = dns_create_update_request(mem_ctx, pszDomainName, pszHostName, - iplist[0].s_addr, &req); + iplist, num_addrs, &req); if (!ERR_DNS_IS_OK(err)) goto error; err = dns_update_transaction(mem_ctx, conn, req, &resp); @@ -89,9 +89,7 @@ DNS_ERROR DoDNSUpdate(ADS_STRUCT *ads, char *pszServerName, * Okay, we have to try with signing */ { - ADS_STRUCT *ads_s; gss_ctx_id_t gss_context; - int res; char *keyname; if (!(keyname = dns_generate_keyname( mem_ctx ))) { @@ -99,24 +97,6 @@ DNS_ERROR DoDNSUpdate(ADS_STRUCT *ads, char *pszServerName, goto error; } - if (!(ads_s = ads_init(ads->server.realm, ads->server.workgroup, - ads->server.ldap_server))) { - return ERROR_DNS_NO_MEMORY; - } - - /* kinit with the machine password */ - setenv(KRB5_ENV_CCNAME, "MEMORY:net_ads", 1); - asprintf( &ads_s->auth.user_name, "%s$", global_myname() ); - ads_s->auth.password = secrets_fetch_machine_password( - lp_workgroup(), NULL, NULL ); - ads_s->auth.realm = SMB_STRDUP( lp_realm() ); - res = ads_kinit_password( ads_s ); - ads_destroy(&ads_s); - if (res) { - err = ERROR_DNS_GSS_ERROR; - goto error; - } - err = dns_negotiate_sec_ctx( pszDomainName, pszServerName, keyname, &gss_context, DNS_SRV_ANY ); |