Fix wbinfo --trusted-domains.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Apr 2008 14:10:16 +0000 (16:10 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Apr 2008 14:10:16 +0000 (16:10 +0200)
The problems here were that we did not bind to the LSA pipe, and we
did not consider it possible to have 0 trusted domains.

Andrew Bartlett
(This used to be commit 86694d429d62940882ac9b7af83b3e7d00e67c5a)

source4/winbind/wb_cmd_list_trustdom.c
source4/winbind/wb_connect_lsa.c
testprogs/blackbox/test_wbinfo.sh

index 83bd517a02315ea93f6e689c312fab203cbe5b89..8d0c1bd947c17eff426f5cf5ed69b6fe7e74433f 100644 (file)
@@ -143,7 +143,8 @@ static void cmd_list_trustdoms_recv_doms(struct rpc_request *req)
        state->domains = talloc_realloc(state, state->domains,
                                        struct wb_dom_info *,
                                        state->num_domains);
-       if (composite_nomem(state->domains, state->ctx)) return;
+       if (state->num_domains && 
+           composite_nomem(state->domains, state->ctx)) return;
 
        for (i=0; i<state->r.out.domains->count; i++) {
                int j = i+old_num_domains;
index 61b123a5020c9c8e1b79e5584dd15b80a85a1aca..a728f8abe4545116ed99ff3ac950a4f8fe750872 100644 (file)
@@ -62,8 +62,11 @@ struct composite_context *wb_init_lsa_send(TALLOC_CTX *mem_ctx,
 
        /* this will make the secondary connection on the same IPC$ share, 
           secured with SPNEGO or NTLMSSP */
-       ctx = dcerpc_secondary_connection_send(domain->netlogon_pipe,
-                                              domain->lsa_binding);
+       ctx = dcerpc_secondary_auth_connection_send(domain->netlogon_pipe,
+                                                   domain->lsa_binding,
+                                                   &ndr_table_lsarpc,
+                                                   domain->libnet_ctx->cred,
+                                                   domain->libnet_ctx->lp_ctx);
        composite_continue(state->ctx, ctx, init_lsa_recv_pipe, state);
        return result;
        
@@ -79,8 +82,8 @@ static void init_lsa_recv_pipe(struct composite_context *ctx)
                talloc_get_type(ctx->async.private_data,
                                struct init_lsa_state);
 
-       state->ctx->status = dcerpc_secondary_connection_recv(ctx, 
-                                                             &state->lsa_pipe);
+       state->ctx->status = dcerpc_secondary_auth_connection_recv(ctx, state,
+                                                                  &state->lsa_pipe);
        if (!composite_is_ok(state->ctx)) return;
                        
        state->handle = talloc(state, struct policy_handle);
index b309b302dd33d21c6101f278db73e0d702b91944..1ece5a60f24cee6990ddb40434a46681cc962828 100755 (executable)
@@ -157,9 +157,8 @@ testfail "wbinfo -Y against $TARGET using invalid SID" $wbinfo -Y "S-1-22-1-3000
 
 testit "wbinfo -t against $TARGET" $wbinfo -t || failed=`expr $failed + 1`
 
-# this does not work
-knownfail "wbinfo -m against $TARGET" $wbinfo -m || failed=`expr $failed + 1`
-knownfail "wbinfo --all-domains against $TARGET" $wbinfo --all-domains || failed=`expr $failed + 1`
+testit "wbinfo  --trusted-domains against $TARGET" $wbinfo --trusted-domains || failed=`expr $failed + 1`
+testit "wbinfo --all-domains against $TARGET" $wbinfo --all-domains || failed=`expr $failed + 1`
 testit "wbinfo --own-domain against $TARGET" $wbinfo --own-domain || failed=`expr $failed + 1`
 
 echo "test: wbinfo --own-domain against $TARGET check output"