torture-lsa: Allow rpc.lsa.trusted.domains to run successfully
authorAndrew Bartlett <abartlet@samba.org>
Tue, 10 Mar 2015 03:04:30 +0000 (16:04 +1300)
committerGünther Deschner <gd@samba.org>
Fri, 27 Mar 2015 00:26:15 +0000 (01:26 +0100)
We need to create a new binding, as the old binding has the wrong pipe in it (lsa, not netlogon).

Otherwise, we try to bind using the LSA UUID on the netlogon pipe, and Samba rejects that

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/torture/rpc/lsa.c

index c0bdad7e30138955ca4e916e20b306f52939d9ed..c2d11c65c8b9db21403d5cfd84e30cba9adcee83 100644 (file)
@@ -2783,6 +2783,8 @@ static bool check_dom_trust_pw(struct dcerpc_pipe *p,
 {
        struct cli_credentials *credentials;
        char *dummy;
+       const char *binding = torture_setting_string(tctx, "binding", NULL);
+       struct dcerpc_binding *b2;
        struct netlogon_creds_CredentialState *creds;
        struct dcerpc_pipe *p2;
        NTSTATUS status;
@@ -2804,7 +2806,10 @@ static bool check_dom_trust_pw(struct dcerpc_pipe *p,
                                        trusted_dom_name, CRED_SPECIFIED);
        cli_credentials_set_secure_channel_type(credentials, SEC_CHAN_DOMAIN);
 
-       status = dcerpc_pipe_connect_b(tctx, &p2, p->binding,
+       status = dcerpc_parse_binding(tctx, binding, &b2);
+       torture_assert_ntstatus_ok(tctx, status, "Bad binding string");
+
+       status = dcerpc_pipe_connect_b(tctx, &p2, b2,
                                       &ndr_table_netlogon,
                                       cli_credentials_init_anon(tctx),
                                       tctx->ev, tctx->lp_ctx);