1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s3:libsmb: move cli->server{zone,time} to cli->conn.smb1.server.{time_zone,system_time}

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Sep 15 14:00:29 CEST 2011 on sn-devel-104
This commit is contained in:
Stefan Metzmacher 2011-09-13 21:45:25 +02:00
parent aca5e33b00
commit ef8dc2d30e
3 changed files with 18 additions and 12 deletions

View File

@ -62,8 +62,6 @@ struct cli_state {
char *share; char *share;
char *dev; char *dev;
int serverzone;
uint32 servertime;
int timeout; /* in milliseconds. */ int timeout; /* in milliseconds. */
int initialised; int initialised;
int win95; int win95;
@ -140,6 +138,8 @@ struct cli_state {
DATA_BLOB gss_blob; DATA_BLOB gss_blob;
uint8_t challenge[8]; uint8_t challenge[8];
const char *workgroup; const char *workgroup;
int time_zone;
time_t system_time;
} server; } server;
uint32_t capabilities; uint32_t capabilities;

View File

@ -2627,6 +2627,8 @@ static void cli_negprot_done(struct tevent_req *subreq)
DATA_BLOB server_gss_blob = data_blob_null; DATA_BLOB server_gss_blob = data_blob_null;
uint8_t server_challenge[8]; uint8_t server_challenge[8];
char *server_workgroup = NULL; char *server_workgroup = NULL;
int server_time_zone = 0;
time_t server_system_time = 0;
enum protocol_types protocol; enum protocol_types protocol;
ZERO_STRUCT(server_challenge); ZERO_STRUCT(server_challenge);
@ -2682,11 +2684,11 @@ static void cli_negprot_done(struct tevent_req *subreq)
server_max_mux = SVAL(vwv + 1, 1); server_max_mux = SVAL(vwv + 1, 1);
server_max_xmit = IVAL(vwv + 3, 1); server_max_xmit = IVAL(vwv + 3, 1);
server_session_key = IVAL(vwv + 7, 1); server_session_key = IVAL(vwv + 7, 1);
cli->serverzone = SVALS(vwv + 15, 1); server_time_zone = SVALS(vwv + 15, 1);
cli->serverzone *= 60; server_time_zone *= 60;
/* this time arrives in real GMT */ /* this time arrives in real GMT */
ts = interpret_long_date(((char *)(vwv+11))+1); ts = interpret_long_date(((char *)(vwv+11))+1);
cli->servertime = ts.tv_sec; server_system_time = ts.tv_sec;
server_capabilities = IVAL(vwv + 9, 1); server_capabilities = IVAL(vwv + 9, 1);
key_len = CVAL(vwv + 16, 1); key_len = CVAL(vwv + 16, 1);
@ -2789,11 +2791,11 @@ static void cli_negprot_done(struct tevent_req *subreq)
server_max_xmit = SVAL(vwv + 2, 0); server_max_xmit = SVAL(vwv + 2, 0);
server_max_mux = SVAL(vwv + 3, 0); server_max_mux = SVAL(vwv + 3, 0);
server_session_key = IVAL(vwv + 6, 0); server_session_key = IVAL(vwv + 6, 0);
cli->serverzone = SVALS(vwv + 10, 0); server_time_zone = SVALS(vwv + 10, 0);
cli->serverzone *= 60; server_time_zone *= 60;
/* this time is converted to GMT by make_unix_date */ /* this time is converted to GMT by make_unix_date */
cli->servertime = make_unix_date( server_system_time = make_unix_date(
(char *)(vwv + 8), cli->serverzone); (char *)(vwv + 8), server_time_zone);
server_readbraw = ((SVAL(vwv + 5, 0) & 0x1) != 0); server_readbraw = ((SVAL(vwv + 5, 0) & 0x1) != 0);
server_writebraw = ((SVAL(vwv + 5, 0) & 0x2) != 0); server_writebraw = ((SVAL(vwv + 5, 0) & 0x2) != 0);
@ -2807,7 +2809,8 @@ static void cli_negprot_done(struct tevent_req *subreq)
} }
} else { } else {
/* the old core protocol */ /* the old core protocol */
cli->serverzone = get_time_zone(time(NULL)); server_time_zone = get_time_zone(time(NULL));
server_system_time = 0;
server_max_xmit = 1024; server_max_xmit = 1024;
server_max_mux = 1; server_max_mux = 1;
server_security_mode = 0; server_security_mode = 0;
@ -2869,6 +2872,9 @@ static void cli_negprot_done(struct tevent_req *subreq)
memcpy(cli->conn.smb1.server.challenge, server_challenge, 8); memcpy(cli->conn.smb1.server.challenge, server_challenge, 8);
cli->conn.smb1.server.workgroup = talloc_move(cli, &server_workgroup); cli->conn.smb1.server.workgroup = talloc_move(cli, &server_workgroup);
cli->conn.smb1.server.time_zone = server_time_zone;
cli->conn.smb1.server.system_time = server_system_time;
tevent_req_done(req); tevent_req_done(req);
} }

View File

@ -582,12 +582,12 @@ uint16_t cli_state_security_mode(struct cli_state *cli)
int cli_state_server_time_zone(struct cli_state *cli) int cli_state_server_time_zone(struct cli_state *cli)
{ {
return cli->serverzone; return cli->conn.smb1.server.time_zone;
} }
time_t cli_state_server_time(struct cli_state *cli) time_t cli_state_server_time(struct cli_state *cli)
{ {
return cli->servertime; return cli->conn.smb1.server.system_time;
} }
struct cli_echo_state { struct cli_echo_state {