From 596aa96d1746c84c30b8bea395ce1195a418a202 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Sep 2011 16:48:18 +0200 Subject: s3:libsmb: move cli->sec_mode to cli->conn.smb1.server.security_mode metze --- source3/libsmb/cliconnect.c | 13 ++++++++----- source3/libsmb/clientgen.c | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 50014f57f7..b571d0f59a 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -2615,6 +2615,7 @@ static void cli_negprot_done(struct tevent_req *subreq) uint32_t server_max_xmit = 0; uint32_t max_xmit; uint32_t server_max_mux = 0; + uint16_t server_security_mode = 0; enum protocol_types protocol; status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv, @@ -2656,7 +2657,7 @@ static void cli_negprot_done(struct tevent_req *subreq) } /* NT protocol */ - cli->sec_mode = CVAL(vwv + 1, 0); + server_security_mode = CVAL(vwv + 1, 0); server_max_mux = SVAL(vwv + 1, 1); server_max_xmit = IVAL(vwv + 3, 1); cli->sesskey = IVAL(vwv + 7, 1); @@ -2692,11 +2693,11 @@ static void cli_negprot_done(struct tevent_req *subreq) } server_signing = "not supported"; - if (cli->sec_mode & NEGOTIATE_SECURITY_SIGNATURES_ENABLED) { + if (server_security_mode & NEGOTIATE_SECURITY_SIGNATURES_ENABLED) { server_signing = "supported"; server_allowed = true; } - if (cli->sec_mode & NEGOTIATE_SECURITY_SIGNATURES_REQUIRED) { + if (server_security_mode & NEGOTIATE_SECURITY_SIGNATURES_REQUIRED) { server_signing = "required"; server_mandatory = true; } @@ -2718,7 +2719,7 @@ static void cli_negprot_done(struct tevent_req *subreq) return; } - cli->sec_mode = SVAL(vwv + 1, 0); + server_security_mode = SVAL(vwv + 1, 0); server_max_xmit = SVAL(vwv + 2, 0); server_max_mux = SVAL(vwv + 3, 0); cli->sesskey = IVAL(vwv + 6, 0); @@ -2732,10 +2733,10 @@ static void cli_negprot_done(struct tevent_req *subreq) cli->secblob = data_blob(bytes, num_bytes); } else { /* the old core protocol */ - cli->sec_mode = 0; cli->serverzone = get_time_zone(time(NULL)); server_max_xmit = 1024; server_max_mux = 1; + server_security_mode = 0; } if (server_max_xmit < 1024) { @@ -2772,6 +2773,8 @@ static void cli_negprot_done(struct tevent_req *subreq) cli->conn.smb1.server.max_mux = server_max_mux; + cli->conn.smb1.server.security_mode = server_security_mode; + tevent_req_done(req); } diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index aef31b5aa0..34826b0bea 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -568,7 +568,7 @@ uint16_t cli_state_max_requests(struct cli_state *cli) uint16_t cli_state_security_mode(struct cli_state *cli) { - return cli->sec_mode; + return cli->conn.smb1.server.security_mode; } int cli_state_server_time_zone(struct cli_state *cli) -- cgit