s3:rpc_transport_np: handle trans rdata like the output of a normal read
[Samba/cd1.git] / source4 / torture / rpc / bind.c
blob73978e4cec909f08307468873665bc311b129f4f
1 /*
2 Unix SMB/CIFS implementation.
4 dcerpc torture tests
6 Copyright (C) Andrew Tridgell 2003
7 Copyright (C) Andrew Bartlett <abartlet@samba.org 2004
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "includes.h"
24 #include "librpc/gen_ndr/ndr_lsa_c.h"
25 #include "lib/cmdline/popt_common.h"
26 #include "torture/rpc/rpc.h"
29 This test is 'bogus' in that it doesn't actually perform to the
30 spec. We need to deal with other things inside the DCERPC layer,
31 before we could have multiple binds.
33 We should never pass this test, until such details are fixed in our
34 client, and it looks like multible binds are never used anyway.
38 bool torture_multi_bind(struct torture_context *torture)
40 struct dcerpc_pipe *p;
41 struct dcerpc_binding *binding;
42 TALLOC_CTX *mem_ctx;
43 NTSTATUS status;
44 bool ret;
46 mem_ctx = talloc_init("torture_multi_bind");
48 status = torture_rpc_binding(torture, &binding);
49 if (!NT_STATUS_IS_OK(status)) {
50 talloc_free(mem_ctx);
51 return false;
54 status = torture_rpc_connection(torture, &p, &ndr_table_lsarpc);
56 if (!NT_STATUS_IS_OK(status)) {
57 talloc_free(mem_ctx);
58 return false;
61 status = dcerpc_pipe_auth(mem_ctx, &p, binding, &ndr_table_lsarpc, cmdline_credentials,
62 torture->lp_ctx);
64 if (NT_STATUS_IS_OK(status)) {
65 printf("(incorrectly) allowed re-bind to uuid %s - %s\n",
66 GUID_string(mem_ctx, &ndr_table_lsarpc.syntax_id.uuid), nt_errstr(status));
67 ret = false;
68 } else {
69 printf("\n");
70 ret = true;
73 talloc_free(mem_ctx);
75 return ret;