Author: abartlet Date: 2007-07-15 10:46:34 +0000 (Sun, 15 Jul 2007) New Revision: 23880
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23880 Log: Don't crash when we run wbinfo -a against our own winbind when we are a DC. Next step is to make it work... Andrew Bartlett Modified: branches/SAMBA_4_0/source/winbind/wb_init_domain.c branches/SAMBA_4_0/source/winbind/wb_pam_auth.c Changeset: Modified: branches/SAMBA_4_0/source/winbind/wb_init_domain.c =================================================================== --- branches/SAMBA_4_0/source/winbind/wb_init_domain.c 2007-07-15 09:42:43 UTC (rev 23879) +++ branches/SAMBA_4_0/source/winbind/wb_init_domain.c 2007-07-15 10:46:34 UTC (rev 23880) @@ -161,9 +161,10 @@ state->domain->netlogon_pipe = NULL; if ((!cli_credentials_is_anonymous(state->domain->schannel_creds)) && - ((lp_server_role() == ROLE_DOMAIN_MEMBER) && - (dom_sid_equal(state->domain->info->sid, - state->service->primary_sid)))) { + ((lp_server_role() == ROLE_DOMAIN_MEMBER) || + (lp_server_role() == ROLE_DOMAIN_CONTROLLER)) && + (dom_sid_equal(state->domain->info->sid, + state->service->primary_sid))) { state->domain->netlogon_binding->flags |= DCERPC_SCHANNEL; /* For debugging, it can be a real pain if all the traffic is encrypted */ @@ -233,6 +234,7 @@ void (*continuation)(struct composite_context *)) { struct composite_context *ctx; + state->ctx->status = NT_STATUS_OK; if (state->domain->netlogon_binding->flags & DCERPC_SCHANNEL && !(binding->flags & DCERPC_SCHANNEL)) { /* Opening a policy handle failed, perhaps it was Modified: branches/SAMBA_4_0/source/winbind/wb_pam_auth.c =================================================================== --- branches/SAMBA_4_0/source/winbind/wb_pam_auth.c 2007-07-15 09:42:43 UTC (rev 23879) +++ branches/SAMBA_4_0/source/winbind/wb_pam_auth.c 2007-07-15 10:46:34 UTC (rev 23880) @@ -128,6 +128,7 @@ struct wbsrv_domain *domain; state->ctx->status = wb_sid2domain_recv(ctx, &domain); + if (!composite_is_ok(state->ctx)) return; state->creds_state = cli_credentials_get_netlogon_creds(domain->schannel_creds);