svn commit: samba r12127 - in
branches/SAMBA_4_0/source/torture/rpc: .
metze at samba.org
metze at samba.org
Thu Dec 8 14:06:43 GMT 2005
Author: metze
Date: 2005-12-08 14:06:42 +0000 (Thu, 08 Dec 2005)
New Revision: 12127
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12127
Log:
add --option=rpc_login:samr_auth=yes, to work against w2k3
metze
Modified:
branches/SAMBA_4_0/source/torture/rpc/xplogin.c
Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/xplogin.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/xplogin.c 2005-12-08 10:23:56 UTC (rev 12126)
+++ branches/SAMBA_4_0/source/torture/rpc/xplogin.c 2005-12-08 14:06:42 UTC (rev 12127)
@@ -683,6 +683,7 @@
struct get_samr_domain_state {
struct dcerpc_pipe *samr_pipe;
+ struct cli_credentials *creds;
struct policy_handle connect_handle;
struct policy_handle domain_handle;
struct policy_handle group_handle;
@@ -828,7 +829,11 @@
struct get_samr_domain_state);
struct rpc_request *req;
- c->status = dcerpc_bind_auth_none_recv(creq);
+ if (lp_parm_bool(-1,"rpc_login", "samr_auth", False)) {
+ c->status = dcerpc_bind_auth_recv(creq);
+ } else {
+ c->status = dcerpc_bind_auth_none_recv(creq);
+ }
if (!composite_is_ok(c)) return;
state->conn.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -855,14 +860,25 @@
c->status = dcerpc_pipe_open_smb_recv(creq);
if (!composite_is_ok(c)) return;
- creq = dcerpc_bind_auth_none_send(state, state->samr_pipe,
- DCERPC_SAMR_UUID,
- DCERPC_SAMR_VERSION);
+ if (lp_parm_bool(-1,"rpc_login", "samr_auth", False)) {
+ state->samr_pipe->conn->flags |= DCERPC_SIGN;
+ creq = dcerpc_bind_auth_send(state, state->samr_pipe,
+ DCERPC_SAMR_UUID,
+ DCERPC_SAMR_VERSION,
+ state->creds,
+ DCERPC_AUTH_TYPE_NTLMSSP,
+ NULL);
+ } else {
+ creq = dcerpc_bind_auth_none_send(state, state->samr_pipe,
+ DCERPC_SAMR_UUID,
+ DCERPC_SAMR_VERSION);
+ }
composite_continue(c, creq, get_samr_domain_recv_bind, c);
}
static struct composite_context *get_samr_domain_send(TALLOC_CTX *mem_ctx,
- struct smbcli_tree *tree)
+ struct smbcli_tree *tree,
+ struct cli_credentials *creds)
{
struct composite_context *c, *creq;
struct get_samr_domain_state *state;
@@ -886,6 +902,8 @@
goto failed;
}
+ state->creds = creds;
+
creq = dcerpc_pipe_open_smb_send(state->samr_pipe->conn, tree,
"\\samr");
if (creq == NULL) {
@@ -1080,7 +1098,8 @@
}
static struct composite_context *domadmins_send(TALLOC_CTX *mem_ctx,
- struct smbcli_tree *tree)
+ struct smbcli_tree *tree,
+ struct cli_credentials *creds)
{
struct composite_context *c, *creq;
struct domadmins_state *state;
@@ -1098,7 +1117,7 @@
c->private_data = state;
c->event_ctx = tree->session->transport->socket->event.ctx;
- creq = get_samr_domain_send(state, tree);
+ creq = get_samr_domain_send(state, tree, creds);
if (creq == NULL) {
c->status = NT_STATUS_NO_MEMORY;
goto failed;
@@ -1385,7 +1404,8 @@
static struct composite_context *memberships_send(TALLOC_CTX *mem_ctx,
struct smbcli_tree *tree,
- const char *username)
+ const char *username,
+ struct cli_credentials *creds)
{
struct composite_context *c, *creq;
struct memberships_state *state;
@@ -1409,7 +1429,7 @@
goto failed;
}
- creq = get_samr_domain_send(state, tree);
+ creq = get_samr_domain_send(state, tree, creds);
if (creq == NULL) {
c->status = NT_STATUS_NO_MEMORY;
goto failed;
@@ -1912,7 +1932,8 @@
if (!composite_is_ok(c)) return;
creq = domadmins_send(state,
- dcerpc_smb_tree(state->netlogon_pipe->conn));
+ dcerpc_smb_tree(state->netlogon_pipe->conn),
+ state->wks_creds);
composite_continue(c, creq, xp_login_recv_domadmins, c);
}
@@ -1954,7 +1975,8 @@
creq = memberships_send(state,
dcerpc_smb_tree(state->netlogon_pipe->conn),
- state->user_name);
+ state->user_name,
+ state->wks_creds);
composite_continue(c, creq, xp_login_recv_memberships, c);
}
@@ -1976,7 +1998,8 @@
to ntconfig.pol and local security policy settings. */
creq = memberships_send(
state, dcerpc_smb_tree(state->netlogon_pipe->conn),
- state->user_name);
+ state->user_name,
+ state->wks_creds);
composite_continue(c, creq, xp_login_recv_memberships, c);
return;
}
@@ -2060,7 +2083,7 @@
}
#if 0
-/* Stolen from testjoin.c for easy mass-joining */p
+/* Stolen from testjoin.c for easy mass-joining */
static BOOL joinme(int i)
{
TALLOC_CTX *mem_ctx;
More information about the samba-cvs
mailing list