s4:torture/samba3rpc: let rpc.authcontext be more robust against low level code chang...
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Sep 2013 11:15:38 +0000 (13:15 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Oct 2013 19:48:46 +0000 (08:48 +1300)
Some code uses the low level smbXcli_session structure instead of
the smbcli_session structure and doesn't 'see' updates to the
smbcli_session structure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/rpc/samba3rpc.c

index 432e9d5350956e20d7ed6c71a8ce7d12f721236a..6c96b9d7cf8411b36b58ac58719803db5786fc1d 100644 (file)
@@ -63,6 +63,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
        struct policy_handle handle;
        struct lsa_Close close_handle;
        struct smbcli_session *tmp;
+       uint16_t tmp_vuid;
        struct smbcli_session *session2;
        struct smbcli_state *cli;
        struct dcerpc_pipe *lsa_pipe;
@@ -179,10 +180,13 @@ bool torture_bind_authcontext(struct torture_context *torture)
        session2->vuid = setup.out.vuid;
 
        tmp = cli->tree->session;
+       tmp_vuid = smb1cli_session_current_id(tmp->smbXcli);
+       smb1cli_session_set_id(tmp->smbXcli, session2->vuid);
        cli->tree->session = session2;
 
        status = dcerpc_lsa_OpenPolicy2_r(lsa_handle, mem_ctx, &openpolicy);
 
+       smb1cli_session_set_id(tmp->smbXcli, tmp_vuid);
        cli->tree->session = tmp;
        talloc_free(lsa_pipe);
        lsa_pipe = NULL;