Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-abartlet
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Apr 2008 15:35:32 +0000 (17:35 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Apr 2008 15:35:32 +0000 (17:35 +0200)
(This used to be commit eab5f6a7f5efa8608cb23af2cab8ab19f9f62485)

source4/selftest/samba4_tests.sh
source4/torture/winbind/struct_based.c
source4/winbind/wb_cmd_list_trustdom.c
source4/winbind/wb_connect_lsa.c
source4/winbind/wb_samba3_cmd.c
testprogs/blackbox/test_wbinfo.sh

index a021fff89231ad34f5cc878a08c2a15cd84a35e2..730846dae300d7d7536063a2299b2c1e03beb5b3 100755 (executable)
@@ -301,7 +301,7 @@ for t in $NBT_TESTS; do
        plansmbtorturetest "$t" dc //\$SERVER/_none_ -U\$USERNAME%\$PASSWORD 
 done
 
-WB_OPTS="--option=\"torture:strict mode=yes\""
+WB_OPTS="--option=\"torture:strict mode=no\""
 WB_OPTS="${WB_OPTS} --option=\"torture:timelimit=1\""
 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd separator=/\""
 WB_OPTS="${WB_OPTS} --option=\"torture:winbindd private pipe dir=\$WINBINDD_PRIV_PIPE_DIR\""
index 51ac0e622a12465a8ea9d2202c5faaed69d0ea43..87378aadb8a98baa65fed769591b8b052e5f09c2 100644 (file)
@@ -262,7 +262,7 @@ static bool torture_winbind_struct_check_machacc(struct torture_context *torture
 
        torture_assert_str_equal(torture,
                                 rep.data.auth.error_string,
-                                nt_errstr(NT_STATUS_OK),
+                                get_friendly_nt_error_msg(NT_STATUS_OK),
                                 "WINBINDD_CHECK_MACHACC ok: error_string");
 
        torture_assert_int_equal(torture,
@@ -295,6 +295,10 @@ static bool get_trusted_domains(struct torture_context *torture,
        DO_STRUCT_REQ_REP(WINBINDD_LIST_TRUSTDOM, &req, &rep);
 
        extra_data = (char *)rep.extra_data.data;
+       if (!extra_data) {
+               return true;
+       }
+
        torture_assert(torture, extra_data, "NULL trust list");
 
        while (next_token(&extra_data, line, "\n", sizeof(fstring))) {
@@ -356,7 +360,6 @@ static bool torture_winbind_struct_list_trustdom(struct torture_context *torture
        DO_STRUCT_REQ_REP(WINBINDD_LIST_TRUSTDOM, &req, &rep);
 
        list1 = (char *)rep.extra_data.data;
-       torture_assert(torture, list1, "NULL trust list");
 
        torture_comment(torture, "%s\n", list1);
 
@@ -368,7 +371,6 @@ static bool torture_winbind_struct_list_trustdom(struct torture_context *torture
        DO_STRUCT_REQ_REP(WINBINDD_LIST_TRUSTDOM, &req, &rep);
 
        list2 = (char *)rep.extra_data.data;
-       torture_assert(torture, list2, "NULL trust list");
 
        /*
         * The list_all_domains parameter should be ignored
@@ -381,7 +383,7 @@ static bool torture_winbind_struct_list_trustdom(struct torture_context *torture
        ok = get_trusted_domains(torture, &listd);
        torture_assert(torture, ok, "failed to get trust list");
 
-       for (i=0; listd[i].netbios_name; i++) {
+       for (i=0; listd && listd[i].netbios_name; i++) {
                if (i == 0) {
                        struct dom_sid *builtin_sid;
 
@@ -424,7 +426,7 @@ static bool torture_winbind_struct_domain_info(struct torture_context *torture)
        ok = get_trusted_domains(torture, &listd);
        torture_assert(torture, ok, "failed to get trust list");
 
-       for (i=0; listd[i].netbios_name; i++) {
+       for (i=0; listd && listd[i].netbios_name; i++) {
                struct winbindd_request req;
                struct winbindd_response rep;
                struct dom_sid *sid;
@@ -485,14 +487,14 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture)
        bool ok;
        bool strict = torture_setting_bool(torture, "strict mode", false);
        struct torture_trust_domain *listd = NULL;
-       uint32_t i;
+       uint32_t i, count = 0;
 
        torture_comment(torture, "Running WINBINDD_GETDCNAME (struct based)\n");
 
        ok = get_trusted_domains(torture, &listd);
        torture_assert(torture, ok, "failed to get trust list");
 
-       for (i=0; listd[i].netbios_name; i++) {
+       for (i=0; listd && listd[i].netbios_name; i++) {
                struct winbindd_request req;
                struct winbindd_response rep;
 
@@ -512,8 +514,13 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture)
                /* TODO: check rep.data.dc_name; */
                torture_comment(torture, "DOMAIN '%s' => DCNAME '%s'\n",
                                req.domain_name, rep.data.dc_name);
+               count++;
        }
 
+       if (strict) {
+               torture_assert(torture, count > 0,
+                              "WiNBINDD_GETDCNAME was not tested");
+       }
        return true;
 }
 
@@ -530,7 +537,7 @@ static bool torture_winbind_struct_dsgetdcname(struct torture_context *torture)
        ok = get_trusted_domains(torture, &listd);
        torture_assert(torture, ok, "failed to get trust list");
 
-       for (i=0; listd[i].netbios_name; i++) {
+       for (i=0; listd && listd[i].netbios_name; i++) {
                struct winbindd_request req;
                struct winbindd_response rep;
 
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 8ae330df3527c0c21b5c7f5f71e66ef148d2d6cb..7f1520a3b3d4a00ac77513bfdb530a142b3f0c45 100644 (file)
@@ -43,13 +43,14 @@ static void wbsrv_samba3_async_auth_epilogue(NTSTATUS status,
        struct winbindd_response *resp = &s3call->response;
        if (!NT_STATUS_IS_OK(status)) {
                resp->result = WINBINDD_ERROR;
-               WBSRV_SAMBA3_SET_STRING(resp->data.auth.nt_status_string,
-                                       nt_errstr(status));
-               WBSRV_SAMBA3_SET_STRING(resp->data.auth.error_string,
-                                       get_friendly_nt_error_msg(status));
        } else {
                resp->result = WINBINDD_OK;
        }
+       
+       WBSRV_SAMBA3_SET_STRING(resp->data.auth.nt_status_string,
+                               nt_errstr(status));
+       WBSRV_SAMBA3_SET_STRING(resp->data.auth.error_string,
+                               get_friendly_nt_error_msg(status));
 
        resp->data.auth.pam_error = nt_status_to_pam(status);
        resp->data.auth.nt_status = NT_STATUS_V(status);
index d993ed2ca7da00b4b9ff22ac2c0134fc40a7966e..ec8b9ebd443b20117cc096bea0f6247b09268fd6 100755 (executable)
@@ -144,9 +144,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"