[SCM] Samba Shared Repository - branch master updated
Andrew Tridgell
tridge at samba.org
Sun Sep 19 15:49:26 MDT 2010
The branch, master has been updated
via 01371d9 s4-rodc: override client site from cldap response
via 8beed36 s4-dns: fixed the dns_domain_info_type for netlogon DNS calls
via 6642ae9 s4-dns: added --all-names option to samba_dnsupdate
via 94694ec s4-libnet: use the right domain name in libnet_lookup
via 1555659 s4-cldap: improved debug msgs in finddcs_cldap()
from dfedbae testtools: Import newer upstream revision.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 01371d968e09719e3034a919eddf3c90a48a71e4
Author: Andrew Tridgell <tridge at samba.org>
Date: Sun Sep 19 13:20:33 2010 -0700
s4-rodc: override client site from cldap response
commit 8beed3679d09e0c89a081ef6b32536cf57419521
Author: Andrew Tridgell <tridge at samba.org>
Date: Sun Sep 19 13:02:40 2010 -0700
s4-dns: fixed the dns_domain_info_type for netlogon DNS calls
w2k8r2 does check this field (WSPP docs need an update)
commit 6642ae9703e4ccb1fdfefa81a6da5b5fa52b53ad
Author: Andrew Tridgell <tridge at samba.org>
Date: Sun Sep 19 13:02:05 2010 -0700
s4-dns: added --all-names option to samba_dnsupdate
this forces the re-registration of all names
commit 94694ecf4e3c8df4d3818d24916125f9e85ec6a9
Author: Andrew Tridgell <tridge at samba.org>
Date: Sun Sep 19 12:31:58 2010 -0700
s4-libnet: use the right domain name in libnet_lookup
commit 1555659e7801c1f924dcd58d1c277dbe1191deb0
Author: Andrew Tridgell <tridge at samba.org>
Date: Sun Sep 19 12:31:33 2010 -0700
s4-cldap: improved debug msgs in finddcs_cldap()
-----------------------------------------------------------------------
Summary of changes:
source4/libcli/finddcs_cldap.c | 8 +++++---
source4/libnet/libnet_lookup.c | 5 +----
source4/scripting/bin/samba_dnsupdate | 20 ++++++++++++++++----
source4/scripting/python/samba/join.py | 2 ++
4 files changed, 24 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/libcli/finddcs_cldap.c b/source4/libcli/finddcs_cldap.c
index b8cc5cb..b7a8324 100644
--- a/source4/libcli/finddcs_cldap.c
+++ b/source4/libcli/finddcs_cldap.c
@@ -167,7 +167,7 @@ static void finddcs_cldap_next_server(struct finddcs_cldap_state *state)
if (state->srv_addresses[state->srv_address_index] == NULL) {
tevent_req_nterror(state->req, NT_STATUS_OBJECT_NAME_NOT_FOUND);
- DEBUG(2,("No matching CLDAP server found\n"));
+ DEBUG(2,("finddcs: No matching CLDAP server found\n"));
return;
}
@@ -248,10 +248,12 @@ static void finddcs_cldap_name_resolved(struct composite_context *ctx)
status = resolve_name_recv(ctx, state, &address);
if (tevent_req_nterror(state->req, status)) {
- DEBUG(2,("No matching NBT <1c> server found\n"));
+ DEBUG(2,("finddcs: No matching NBT <1c> server found\n"));
return;
}
+ DEBUG(4,("finddcs: Found NBT <1c> server at %s\n", address));
+
state->srv_addresses = talloc_array(state, const char *, 2);
if (tevent_req_nomem(state->srv_addresses, state->req)) {
return;
@@ -281,7 +283,7 @@ static void finddcs_cldap_srv_resolved(struct composite_context *ctx)
status = resolve_name_multiple_recv(ctx, state, &state->srv_addresses);
if (tevent_req_nterror(state->req, status)) {
- DEBUG(2,("Failed to find SRV record for %s\n", state->srv_name));
+ DEBUG(2,("finddcs: Failed to find SRV record for %s\n", state->srv_name));
return;
}
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index 3677c2a..6b8ab6e 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -195,10 +195,7 @@ struct tevent_req *libnet_LookupDCs_send(struct libnet_context *ctx,
struct finddcs finddcs_io;
ZERO_STRUCT(finddcs_io);
- finddcs_io.in.domain_name = lpcfg_realm(ctx->lp_ctx);
- if (strcmp(finddcs_io.in.domain_name, "") == 0) {
- finddcs_io.in.domain_name = lpcfg_workgroup(ctx->lp_ctx);
- }
+ finddcs_io.in.domain_name = io->in.domain_name;
finddcs_io.in.minimum_dc_flags = NBT_SERVER_LDAP | NBT_SERVER_DS | NBT_SERVER_WRITABLE;
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 4dafe79..d3abcb1 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -49,6 +49,7 @@ sambaopts = options.SambaOptions(parser)
parser.add_option_group(sambaopts)
parser.add_option_group(options.VersionOptions(parser))
parser.add_option("--verbose", action="store_true")
+parser.add_option("--all-names", action="store_true")
parser.add_option("--all-interfaces", action="store_true")
parser.add_option("--use-file", type="string", help="Use a file, rather than real DNS calls")
@@ -255,11 +256,22 @@ def rodc_dns_update(d, t):
if opts.verbose:
print "Calling netlogon RODC update for %s" % d
+ typemap = {
+ netlogon.NlDnsLdapAtSite : netlogon.NlDnsInfoTypeNone,
+ netlogon.NlDnsGcAtSite : netlogon.NlDnsDomainNameAlias,
+ netlogon.NlDnsDsaCname : netlogon.NlDnsDomainNameAlias,
+ netlogon.NlDnsKdcAtSite : netlogon.NlDnsInfoTypeNone,
+ netlogon.NlDnsDcAtSite : netlogon.NlDnsInfoTypeNone,
+ netlogon.NlDnsRfc1510KdcAtSite : netlogon.NlDnsInfoTypeNone,
+ netlogon.NlDnsGenericGcAtSite : netlogon.NlDnsDomainNameAlias
+ }
+
w = winbind.winbind("irpc:winbind_server", lp)
dns_names = netlogon.NL_DNS_NAME_INFO_ARRAY()
dns_names.count = 1
name = netlogon.NL_DNS_NAME_INFO()
name.type = t
+ name.dns_domain_info_type = typemap[t]
name.priority = 0
name.weight = 0
if d.port is not None:
@@ -272,8 +284,8 @@ def rodc_dns_update(d, t):
ret_names = w.DsrUpdateReadOnlyServerDnsRecords(site_name, default_ttl, dns_names)
if ret_names.names[0].status != 0:
print("Failed to set DNS entry: %s (status %u)" % (d, ret_names.names[0].status))
- except:
- print("Error setting DNS entry: %s" % d)
+ except RuntimeError, reason:
+ print("Error setting DNS entry of type %u: %s: %s" % (t, d, reason))
def call_rodc_update(d):
@@ -286,7 +298,7 @@ def call_rodc_update(d):
# map the DNS request to a netlogon update type
map = {
- netlogon.NlDnsLdapAtSite : '_ldap._tcp.${SITE}._sites.${DNSDOMAIN}',
+ netlogon.NlDnsLdapAtSite : '_ldap._tcp.${SITE}._sites.${DNSDOMAIN}',
netlogon.NlDnsGcAtSite : '_ldap._tcp.${SITE}._sites.gc._msdcs.${DNSDOMAIN}',
netlogon.NlDnsDsaCname : '${NTDSGUID}._msdcs.${DNSFOREST}',
netlogon.NlDnsKdcAtSite : '_kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}',
@@ -337,7 +349,7 @@ for d in dns_list:
# now check if the entries already exist on the DNS server
for d in dns_list:
- if not check_dns_name(d):
+ if opts.all_names or not check_dns_name(d):
update_list.append(d)
if len(update_list) == 0:
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index 2cb1e3d..679dc5b 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -69,6 +69,8 @@ def join_rodc(server=None, creds=None, lp=None, site=None, netbios_name=None,
def find_dc(ctx, domain):
'''find a writeable DC for the given domain'''
ctx.cldap_ret = ctx.net.finddc(domain, nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS | nbt.NBT_SERVER_WRITABLE)
+ if ctx.cldap_ret.client_site is not None and ctx.cldap_ret.client_site != "":
+ ctx.site = ctx.cldap_ret.client_site
return ctx.cldap_ret.pdc_dns_name;
--
Samba Shared Repository
More information about the samba-cvs
mailing list