[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2193-gef42431

Günther Deschner gd at samba.org
Wed Feb 13 13:20:06 GMT 2008


The branch, v3-2-test has been updated
       via  ef424319410b7a29ecdfefca53b7e9704beb6139 (commit)
      from  983ac0a6762b52945a784ccbc371f4df99a0a52b (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit ef424319410b7a29ecdfefca53b7e9704beb6139
Author: Günther Deschner <gd at samba.org>
Date:   Wed Feb 13 14:08:59 2008 +0100

    Use pidl for _netr_ServerReqChallenge.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/rpc_server/srv_netlog.c    |   24 +-----------------------
 source/rpc_server/srv_netlog_nt.c |   34 ++++++++++++----------------------
 2 files changed, 13 insertions(+), 45 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/rpc_server/srv_netlog.c b/source/rpc_server/srv_netlog.c
index 7faf632..1b23cd8 100644
--- a/source/rpc_server/srv_netlog.c
+++ b/source/rpc_server/srv_netlog.c
@@ -55,29 +55,7 @@ static bool proxy_netr_call(pipes_struct *p, uint8 opnum)
 
 static bool api_net_req_chal(pipes_struct *p)
 {
-	NET_Q_REQ_CHAL q_u;
-	NET_R_REQ_CHAL r_u;
-	prs_struct *data = &p->in_data.data;
-	prs_struct *rdata = &p->out_data.rdata;
-
-	ZERO_STRUCT(q_u);
-	ZERO_STRUCT(r_u);
-
-	/* grab the challenge... */
-	if(!net_io_q_req_chal("", &q_u, data, 0)) {
-		DEBUG(0,("api_net_req_chal: Failed to unmarshall NET_Q_REQ_CHAL.\n"));
-		return False;
-	}
-
-	r_u.status = _net_req_chal(p, &q_u, &r_u);
-
-	/* store the response in the SMB stream */
-	if(!net_io_r_req_chal("", &r_u, rdata, 0)) {
-		DEBUG(0,("api_net_req_chal: Failed to marshall NET_R_REQ_CHAL.\n"));
-		return False;
-	}
-
-	return True;
+	return proxy_netr_call(p, NDR_NETR_SERVERREQCHALLENGE);
 }
 
 /*************************************************************************
diff --git a/source/rpc_server/srv_netlog_nt.c b/source/rpc_server/srv_netlog_nt.c
index d9fcbeb..acf694b 100644
--- a/source/rpc_server/srv_netlog_nt.c
+++ b/source/rpc_server/srv_netlog_nt.c
@@ -34,12 +34,12 @@ extern userdom_struct current_user_info;
  init_net_r_req_chal:
  *************************************************************************/
 
-static void init_net_r_req_chal(NET_R_REQ_CHAL *r_c,
-                                DOM_CHAL *srv_chal, NTSTATUS status)
+static void init_net_r_req_chal(struct netr_Credential *r,
+				DOM_CHAL *srv_chal)
 {
 	DEBUG(6,("init_net_r_req_chal: %d\n", __LINE__));
-	memcpy(r_c->srv_chal.data, srv_chal->data, sizeof(srv_chal->data));
-	r_c->status = status;
+
+	memcpy(r->data, srv_chal->data, sizeof(r->data));
 }
 
 /*************************************************************************
@@ -305,10 +305,11 @@ static NTSTATUS get_md4pw(char *md4pw, char *mach_acct, uint16 sec_chan_type)
 }
 
 /*************************************************************************
- _net_req_chal
+ _netr_ServerReqChallenge
  *************************************************************************/
 
-NTSTATUS _net_req_chal(pipes_struct *p, NET_Q_REQ_CHAL *q_u, NET_R_REQ_CHAL *r_u)
+NTSTATUS _netr_ServerReqChallenge(pipes_struct *p,
+				  struct netr_ServerReqChallenge *r)
 {
 	if (!p->dc) {
 		p->dc = TALLOC_ZERO_P(p->pipe_state_mem_ctx, struct dcinfo);
@@ -316,23 +317,22 @@ NTSTATUS _net_req_chal(pipes_struct *p, NET_Q_REQ_CHAL *q_u, NET_R_REQ_CHAL *r_u
 			return NT_STATUS_NO_MEMORY;
 		}
 	} else {
-		DEBUG(10,("_net_req_chal: new challenge requested. Clearing old state.\n"));
+		DEBUG(10,("_netr_ServerReqChallenge: new challenge requested. Clearing old state.\n"));
 		ZERO_STRUCTP(p->dc);
 	}
 
-	rpcstr_pull(p->dc->remote_machine,
-			q_u->uni_logon_clnt.buffer,
-			sizeof(fstring),q_u->uni_logon_clnt.uni_str_len*2,0);
+	fstrcpy(p->dc->remote_machine, r->in.computer_name);
 
 	/* Save the client challenge to the server. */
-	memcpy(p->dc->clnt_chal.data, q_u->clnt_chal.data, sizeof(q_u->clnt_chal.data));
+	memcpy(p->dc->clnt_chal.data, r->in.credentials->data,
+		sizeof(r->in.credentials->data));
 
 	/* Create a server challenge for the client */
 	/* Set this to a random value. */
 	generate_random_buffer(p->dc->srv_chal.data, 8);
 
 	/* set up the LSA REQUEST CHALLENGE response */
-	init_net_r_req_chal(r_u, &p->dc->srv_chal, NT_STATUS_OK);
+	init_net_r_req_chal(r->out.credentials, &p->dc->srv_chal);
 
 	p->dc->challenge_sent = True;
 
@@ -1200,16 +1200,6 @@ NTSTATUS _netr_LogonSamLogoff(pipes_struct *p,
 /****************************************************************
 ****************************************************************/
 
-NTSTATUS _netr_ServerReqChallenge(pipes_struct *p,
-				  struct netr_ServerReqChallenge *r)
-{
-	p->rng_fault_state = true;
-	return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
 NTSTATUS _netr_ServerAuthenticate(pipes_struct *p,
 				  struct netr_ServerAuthenticate *r)
 {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list