From 05779e318a0afbd6e2949167fe6e766c6bbe7932 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 11 Jun 2014 12:42:56 +0200 Subject: [PATCH] s3:smbd: pass smbXsrv_connection to get_challenge() Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Reviewed-by: Michael Adam --- source3/smbd/negprot.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 7db714d7f6f..86a4acd7d36 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -31,9 +31,8 @@ extern fstring remote_proto; -static void get_challenge(struct smbd_server_connection *sconn, uint8 buff[8]) +static void get_challenge(struct smbXsrv_connection *xconn, uint8 buff[8]) { - struct smbXsrv_connection *xconn = sconn->conn; NTSTATUS nt_status; /* We might be called more than once, multiple negprots are @@ -65,8 +64,7 @@ static void reply_lanman1(struct smb_request *req, uint16 choice) { int secword=0; time_t t = time(NULL); - struct smbd_server_connection *sconn = req->sconn; - struct smbXsrv_connection *xconn = sconn->conn; + struct smbXsrv_connection *xconn = req->xconn; uint16_t raw; if (lp_async_smb_echo_handler()) { raw = 0; @@ -87,11 +85,11 @@ static void reply_lanman1(struct smb_request *req, uint16 choice) SSVAL(req->outbuf,smb_vwv1,secword); /* Create a token value and add it to the outgoing packet. */ if (xconn->smb1.negprot.encrypted_passwords) { - get_challenge(sconn, (uint8 *)smb_buf(req->outbuf)); + get_challenge(xconn, (uint8 *)smb_buf(req->outbuf)); SSVAL(req->outbuf,smb_vwv11, 8); } - smbXsrv_connection_init_tables(req->sconn->conn, PROTOCOL_LANMAN1); + smbXsrv_connection_init_tables(xconn, PROTOCOL_LANMAN1); /* Reply, SMBlockread, SMBwritelock supported. */ SCVAL(req->outbuf,smb_flg, FLAG_REPLY|FLAG_SUPPORT_LOCKREAD); @@ -116,8 +114,7 @@ static void reply_lanman2(struct smb_request *req, uint16 choice) { int secword=0; time_t t = time(NULL); - struct smbd_server_connection *sconn = req->sconn; - struct smbXsrv_connection *xconn = sconn->conn; + struct smbXsrv_connection *xconn = req->xconn; uint16_t raw; if (lp_async_smb_echo_handler()) { raw = 0; @@ -140,11 +137,11 @@ static void reply_lanman2(struct smb_request *req, uint16 choice) /* Create a token value and add it to the outgoing packet. */ if (xconn->smb1.negprot.encrypted_passwords) { - get_challenge(sconn, (uint8 *)smb_buf(req->outbuf)); + get_challenge(xconn, (uint8 *)smb_buf(req->outbuf)); SSVAL(req->outbuf,smb_vwv11, 8); } - smbXsrv_connection_init_tables(req->sconn->conn, PROTOCOL_LANMAN2); + smbXsrv_connection_init_tables(xconn, PROTOCOL_LANMAN2); /* Reply, SMBlockread, SMBwritelock supported. */ SCVAL(req->outbuf,smb_flg,FLAG_REPLY|FLAG_SUPPORT_LOCKREAD); @@ -252,7 +249,6 @@ static void reply_nt1(struct smb_request *req, uint16 choice) bool negotiate_spnego = False; struct timespec ts; ssize_t ret; - struct smbd_server_connection *sconn = req->sconn; struct smbXsrv_connection *xconn = req->xconn; bool signing_desired = false; bool signing_required = false; @@ -352,7 +348,7 @@ static void reply_nt1(struct smb_request *req, uint16 choice) uint8 chal[8]; /* note that we do not send a challenge at all if we are using plaintext */ - get_challenge(sconn, chal); + get_challenge(xconn, chal); ret = message_push_blob( &req->outbuf, data_blob_const(chal, sizeof(chal))); if (ret == -1) { @@ -520,8 +516,8 @@ void reply_negprot(struct smb_request *req) char **cliprotos; int i; size_t converted_size; - struct smbd_server_connection *sconn = req->sconn; - struct smbXsrv_connection *xconn = sconn->conn; + struct smbXsrv_connection *xconn = req->xconn; + struct smbd_server_connection *sconn = xconn->sconn; START_PROFILE(SMBnegprot); -- 2.11.4.GIT