diff -r -c samba-3.0.25a/source/utils/net_ads.c samba-3.0.25a-patched/source/utils/net_ads.c *** samba-3.0.25a/source/utils/net_ads.c 2007-03-20 23:25:40.000000000 +0100 --- samba-3.0.25a-patched/source/utils/net_ads.c 2007-06-19 17:34:20.000000000 +0200 *************** *** 1292,1297 **** --- 1292,1298 ---- { struct dns_rr_ns *nameservers = NULL; int ns_count = 0; + int i; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; DNS_ERROR dns_err; fstring dns_server; *************** *** 1299,1308 **** char *root_domain = NULL; if ( (dnsdomain = strchr_m( machine_name, '.')) == NULL ) { ! d_printf("No DNS domain configured for %s. " ! "Unable to perform DNS Update.\n", machine_name); ! status = NT_STATUS_INVALID_PARAMETER; ! goto done; } dnsdomain++; --- 1300,1311 ---- char *root_domain = NULL; if ( (dnsdomain = strchr_m( machine_name, '.')) == NULL ) { ! if ( (dnsdomain = lp_realm()) == NULL ) { ! d_printf("Neither DNS domain nor REALM configured for %s. " ! "Unable to perform DNS Update.\n", machine_name); ! status = NT_STATUS_INVALID_PARAMETER; ! goto done; ! } } dnsdomain++; *************** *** 1347,1356 **** status = ads_dns_lookup_ns( ctx, root_domain, &nameservers, &ns_count ); if ( !NT_STATUS_IS_OK(status) || (ns_count == 0)) { ! DEBUG(3,("net_ads_join: Failed to find name server for the %s " ! "realm\n", ads->config.realm)); ! goto done; ! } dnsdomain = root_domain; --- 1350,1359 ---- status = ads_dns_lookup_ns( ctx, root_domain, &nameservers, &ns_count ); if ( !NT_STATUS_IS_OK(status) || (ns_count == 0)) { ! DEBUG(3,("net_ads_join: Failed to find name server for the %s " ! "realm\n", ads->config.realm)); ! goto done; ! } dnsdomain = root_domain; *************** *** 1359,1367 **** /* Now perform the dns update - we'll try non-secure and if we fail, we'll follow it up with a secure update */ ! fstrcpy( dns_server, nameservers[0].hostname ); - dns_err = DoDNSUpdate(dns_server, dnsdomain, machine_name, addrs, num_addrs); if (!ERR_DNS_IS_OK(dns_err)) { status = NT_STATUS_UNSUCCESSFUL; } --- 1362,1374 ---- /* Now perform the dns update - we'll try non-secure and if we fail, we'll follow it up with a secure update */ ! for (i=0;i