2 Unix SMB/CIFS implementation.
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 2 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, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 This test is 'bogus' in that it doesn't actually perform to the
28 spec. We need to deal with other things inside the DCERPC layer,
29 before we could have multiple binds.
31 We should never pass this test, until such details are fixed in our
32 client, and it looks like multible binds are never used anyway.
36 BOOL torture_multi_bind(int dummy)
38 struct dcerpc_pipe *p;
39 const char *domain = lp_parm_string(-1, "torture", "userdomain");
40 const char *username = lp_parm_string(-1, "torture", "username");
41 const char *password = lp_parm_string(-1, "torture", "password");
42 const char *pipe_uuid = DCERPC_LSARPC_UUID;
43 uint32_t pipe_version = DCERPC_LSARPC_VERSION;
44 struct dcerpc_binding b;
45 struct dcerpc_binding *binding;
46 const char *binding_string = lp_parm_string(-1, "torture", "binding");
51 mem_ctx = talloc_init("torture_multi_bind");
53 status = dcerpc_parse_binding(mem_ctx, binding_string, &b);
54 if (!NT_STATUS_IS_OK(status)) {
55 DEBUG(0,("Failed to parse dcerpc binding '%s'\n", binding_string));
56 talloc_destroy(mem_ctx);
62 status = torture_rpc_connection(&p,
67 if (!NT_STATUS_IS_OK(status)) {
71 if (username && username[0] && (binding->flags & DCERPC_SCHANNEL_ANY)) {
72 status = dcerpc_bind_auth_schannel(p, pipe_uuid, pipe_version,
73 domain, username, password);
74 } else if (username && username[0] && (binding->flags & (DCERPC_SIGN | DCERPC_SEAL))) {
75 status = dcerpc_bind_auth_ntlm(p, pipe_uuid, pipe_version, domain, username, password);
77 status = dcerpc_bind_auth_none(p, pipe_uuid, pipe_version);
80 if (NT_STATUS_IS_OK(status)) {
81 DEBUG(0,("(incorrectly) allowed re-bind to uuid %s - %s\n",
82 pipe_uuid, nt_errstr(status)));
90 talloc_destroy(mem_ctx);