summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-10-10 04:00:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:22 -0500
commited088e5ee0c6589171535b3c0cf9064a2d5f6792 (patch)
treec1a5abe51c839a1b41173da5d54319e858ed8ab0
parentfe3fc9c8d5f54c314a5d6b01e75ef8e8a8791063 (diff)
downloadsamba-ed088e5ee0c6589171535b3c0cf9064a2d5f6792.tar.gz
samba-ed088e5ee0c6589171535b3c0cf9064a2d5f6792.tar.bz2
samba-ed088e5ee0c6589171535b3c0cf9064a2d5f6792.zip
r19212: Make sure domains marked internal don't do
network queries. Jeremy. (This used to be commit e4d5e1d90b40fee1edc5cf0134b276645eea63bf)
-rw-r--r--source3/nsswitch/winbindd_cm.c23
-rw-r--r--source3/nsswitch/winbindd_util.c20
2 files changed, 29 insertions, 14 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index 45fce21450..f2d264b2b4 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -122,6 +122,12 @@ void set_domain_offline(struct winbindd_domain *domain)
TALLOC_FREE(domain->check_online_event);
}
+ if (domain->internal) {
+ DEBUG(3,("set_domain_offline: domain %s is internal - logic error.\n",
+ domain->name ));
+ return;
+ }
+
domain->online = False;
/* We only add the timeout handler that checks and
@@ -166,6 +172,12 @@ static void set_domain_online(struct winbindd_domain *domain)
DEBUG(10,("set_domain_online: called for domain %s\n",
domain->name ));
+ if (domain->internal) {
+ DEBUG(3,("set_domain_offline: domain %s is internal - logic error.\n",
+ domain->name ));
+ return;
+ }
+
if (get_global_winbindd_state_offline()) {
DEBUG(10,("set_domain_online: domain %s remaining globally offline\n",
domain->name ));
@@ -1197,6 +1209,12 @@ NTSTATUS init_dc_connection(struct winbindd_domain *domain)
{
NTSTATUS result;
+ /* Internal connections never use the network. */
+ if (domain->internal) {
+ domain->initialized = True;
+ return NT_STATUS_OK;
+ }
+
if (connection_ok(domain)) {
if (!domain->initialized) {
set_dc_type_and_flags(domain);
@@ -1237,11 +1255,6 @@ static void set_dc_type_and_flags( struct winbindd_domain *domain )
ZERO_STRUCT( ctr );
- if (domain->internal) {
- domain->initialized = True;
- return;
- }
-
if (!connection_ok(domain)) {
return;
}
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index 53fa3da536..b28d66e8bc 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -462,16 +462,18 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai
fstrcpy(domain->dcname, state->request.data.init_conn.dcname);
}
- if (strlen(domain->dcname) > 0) {
- if (!resolve_name(domain->dcname, &ipaddr, 0x20)) {
- DEBUG(2, ("Could not resolve DC name %s for domain %s\n",
- domain->dcname, domain->name));
- return WINBINDD_ERROR;
- }
+ if (!domain->internal) {
+ if (strlen(domain->dcname) > 0) {
+ if (!resolve_name(domain->dcname, &ipaddr, 0x20)) {
+ DEBUG(2, ("Could not resolve DC name %s for domain %s\n",
+ domain->dcname, domain->name));
+ return WINBINDD_ERROR;
+ }
- domain->dcaddr.sin_family = PF_INET;
- putip((char *)&(domain->dcaddr.sin_addr), (char *)&ipaddr);
- domain->dcaddr.sin_port = 0;
+ domain->dcaddr.sin_family = PF_INET;
+ putip((char *)&(domain->dcaddr.sin_addr), (char *)&ipaddr);
+ domain->dcaddr.sin_port = 0;
+ }
}
init_dc_connection(domain);