1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r19212: Make sure domains marked internal don't do

network queries.
Jeremy.
This commit is contained in:
Jeremy Allison 2006-10-10 04:00:42 +00:00 committed by Gerald (Jerry) Carter
parent 81a9dc4b9f
commit e4d5e1d90b
2 changed files with 29 additions and 14 deletions

View File

@ -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;
}

View File

@ -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);