summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/bind.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-05 10:00:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:53 -0500
commit232db0b46dcc78b977f0495645fd48487a0b090b (patch)
treecf96d1ab40b3039d7698b6fea9ab84bdd14edf8f /source4/torture/rpc/bind.c
parent68a06bf37ec4ef63767a866977855b8b8bf6a5c8 (diff)
downloadsamba-232db0b46dcc78b977f0495645fd48487a0b090b.tar.gz
r16044: Create a samba3 specific file in torture/rpc. The tests in there survive
against W2k3, but they are designed to walk existing Samba3 code paths. It might be possible that I add something like that to other subdirs like raw/. RPC-BINDSAMBA3 excercises the bind variants that samba3 supports right now. RPC-NETLOGSAMBA3 does a samba3 style join, does some schannel-protected netlogon operations and leaves again. Samba3 right now does not survive this, I'm about to fix it soon. I'll also post a *VERY* dirty hack (fake users in sys_getpwnam()) to be able to run this in the build farm. Volker (This used to be commit 60b45bf8b6d0d2bb216e319891d50d0e07ab3010)
Diffstat (limited to 'source4/torture/rpc/bind.c')
-rw-r--r--source4/torture/rpc/bind.c127
1 files changed, 0 insertions, 127 deletions
diff --git a/source4/torture/rpc/bind.c b/source4/torture/rpc/bind.c
index 5267623e96a..956609e44e1 100644
--- a/source4/torture/rpc/bind.c
+++ b/source4/torture/rpc/bind.c
@@ -82,130 +82,3 @@ BOOL torture_multi_bind(struct torture_context *torture)
return ret;
}
-
-BOOL torture_bind_authcontext(struct torture_context *torture)
-{
- TALLOC_CTX *mem_ctx;
- NTSTATUS status;
- BOOL ret = False;
- struct lsa_ObjectAttribute objectattr;
- struct lsa_OpenPolicy2 openpolicy;
- struct policy_handle handle;
- struct lsa_Close close;
- struct smbcli_session *tmp;
- struct smbcli_session *session2;
- struct smbcli_state *cli;
- struct dcerpc_pipe *lsa_pipe;
- struct cli_credentials *anon_creds;
- struct smb_composite_sesssetup setup;
-
- mem_ctx = talloc_init("torture_bind_auth");
-
- if (mem_ctx == NULL) {
- d_printf("talloc_init failed\n");
- return False;
- }
-
- status = smbcli_full_connection(mem_ctx, &cli,
- lp_parm_string(-1, "torture", "host"),
- "IPC$", NULL, cmdline_credentials,
- NULL);
- if (!NT_STATUS_IS_OK(status)) {
- d_printf("smbcli_full_connection failed: %s\n",
- nt_errstr(status));
- goto done;
- }
-
- lsa_pipe = dcerpc_pipe_init(mem_ctx, cli->transport->socket->event.ctx);
- if (lsa_pipe == NULL) {
- d_printf("dcerpc_pipe_init failed\n");
- goto done;
- }
-
- status = dcerpc_pipe_open_smb(lsa_pipe->conn, cli->tree, "\\lsarpc");
- if (!NT_STATUS_IS_OK(status)) {
- d_printf("dcerpc_pipe_open_smb failed: %s\n",
- nt_errstr(status));
- goto done;
- }
-
- status = dcerpc_bind_auth_none(lsa_pipe, &dcerpc_table_lsarpc);
- if (!NT_STATUS_IS_OK(status)) {
- d_printf("dcerpc_bind_auth_none failed: %s\n",
- nt_errstr(status));
- goto done;
- }
-
- openpolicy.in.system_name =talloc_asprintf(
- mem_ctx, "\\\\%s", dcerpc_server_name(lsa_pipe));
- ZERO_STRUCT(objectattr);
- openpolicy.in.attr = &objectattr;
- openpolicy.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
- openpolicy.out.handle = &handle;
-
- status = dcerpc_lsa_OpenPolicy2(lsa_pipe, mem_ctx, &openpolicy);
-
- if (!NT_STATUS_IS_OK(status)) {
- d_printf("dcerpc_lsa_OpenPolicy2 failed: %s\n",
- nt_errstr(status));
- goto done;
- }
-
- close.in.handle = &handle;
- close.out.handle = &handle;
-
- status = dcerpc_lsa_Close(lsa_pipe, mem_ctx, &close);
- if (!NT_STATUS_IS_OK(status)) {
- d_printf("dcerpc_lsa_Close failed: %s\n",
- nt_errstr(status));
- goto done;
- }
-
- session2 = smbcli_session_init(cli->transport, mem_ctx, False);
- if (session2 == NULL) {
- d_printf("smbcli_session_init failed\n");
- goto done;
- }
-
- anon_creds = cli_credentials_init(mem_ctx);
- if (anon_creds == NULL) {
- d_printf("cli_credentials_init failed\n");
- goto done;
- }
-
- cli_credentials_set_conf(anon_creds);
- cli_credentials_set_anonymous(anon_creds);
-
- setup.in.sesskey = cli->transport->negotiate.sesskey;
- setup.in.capabilities = cli->transport->negotiate.capabilities;
- setup.in.workgroup = "";
- setup.in.credentials = anon_creds;
-
- status = smb_composite_sesssetup(session2, &setup);
- if (!NT_STATUS_IS_OK(status)) {
- d_printf("anon session setup failed: %s\n",
- nt_errstr(status));
- goto done;
- }
-
- tmp = cli->tree->session;
- cli->tree->session = session2;
-
- status = dcerpc_lsa_OpenPolicy2(lsa_pipe, mem_ctx, &openpolicy);
-
- cli->tree->session = tmp;
- talloc_free(lsa_pipe);
- lsa_pipe = NULL;
-
- if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
- d_printf("dcerpc_lsa_OpenPolicy2 with wrong vuid gave %s, "
- "expected NT_STATUS_INVALID_HANDLE\n",
- nt_errstr(status));
- goto done;
- }
-
- ret = True;
- done:
- talloc_free(mem_ctx);
- return ret;
-}