r23880: Don't crash when we run wbinfo -a against our own winbind when we are a DC.
authorAndrew Bartlett <abartlet@samba.org>
Sun, 15 Jul 2007 10:46:34 +0000 (10:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:01:07 +0000 (15:01 -0500)
Next step is to make it work...

Andrew Bartlett
(This used to be commit a1b6c9ecb9a6f17bcbabf81a8128398df6447490)

source4/winbind/wb_init_domain.c
source4/winbind/wb_pam_auth.c

index 6b8606bb0cc425406d63864015e1ed145d5a6f75..69ea9c7533c6fd163b80392d609873011dd50a23 100644 (file)
@@ -161,9 +161,10 @@ struct composite_context *wb_init_domain_send(TALLOC_CTX *mem_ctx,
        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 @@ static bool retry_with_schannel(struct init_domain_state *state,
                                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
index e29bb7c4729fd521e22ff8688f24572da8e96f37..fffb7c408c034d3542d383c931f4cc8d6791c0c7 100644 (file)
@@ -128,6 +128,7 @@ static void pam_auth_crap_recv_domain(struct composite_context *ctx)
        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);