summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-13 16:48:18 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-15 12:12:24 +0200
commit596aa96d1746c84c30b8bea395ce1195a418a202 (patch)
tree29f39b3d45a713ae142635dd975b13f2df84756b /source3
parent8f44105cc424a7f0a354ac06d5022c72ce73b004 (diff)
downloadsamba-596aa96d1746c84c30b8bea395ce1195a418a202.tar.gz
samba-596aa96d1746c84c30b8bea395ce1195a418a202.tar.bz2
samba-596aa96d1746c84c30b8bea395ce1195a418a202.zip
s3:libsmb: move cli->sec_mode to cli->conn.smb1.server.security_mode
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/include/client.h2
-rw-r--r--source3/libsmb/cliconnect.c13
-rw-r--r--source3/libsmb/clientgen.c2
3 files changed, 10 insertions, 7 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index 1e3ab50949..06e3c7aa7d 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -42,7 +42,6 @@ struct cli_state {
* A list of subsidiary connections for DFS.
*/
struct cli_state *prev, *next;
- int sec_mode;
int rap_error;
NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */
@@ -135,6 +134,7 @@ struct cli_state {
uint32_t capabilities;
uint32_t max_xmit;
uint16_t max_mux;
+ uint16_t security_mode;
} server;
uint32_t capabilities;
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)