diff options
-rw-r--r-- | source3/include/proto.h | 4 | ||||
-rw-r--r-- | source3/lib/time.c | 18 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 4 | ||||
-rw-r--r-- | source3/libsmb/clilist.c | 20 | ||||
-rw-r--r-- | source3/libsmb/cliprint.c | 3 | ||||
-rw-r--r-- | source3/libsmb/clirap.c | 12 |
6 files changed, 25 insertions, 36 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 8996a2165d..5d6d782e25 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1088,6 +1088,7 @@ void round_timespec(enum timestamp_set_resolution res, struct timespec *ts); void put_long_date_timespec(enum timestamp_set_resolution res, char *p, struct timespec ts); void put_long_date(char *p, time_t t); void dos_filetime_timespec(struct timespec *tsp); +time_t make_unix_date(const void *date_ptr, int zone_offset); time_t make_unix_date2(const void *date_ptr, int zone_offset); time_t make_unix_date3(const void *date_ptr, int zone_offset); time_t srv_make_unix_date(const void *date_ptr); @@ -1107,9 +1108,6 @@ struct timespec interpret_long_date(const char *p); void cli_put_dos_date(struct cli_state *cli, char *buf, int offset, time_t unixdate); void cli_put_dos_date2(struct cli_state *cli, char *buf, int offset, time_t unixdate); void cli_put_dos_date3(struct cli_state *cli, char *buf, int offset, time_t unixdate); -time_t cli_make_unix_date(struct cli_state *cli, const void *date_ptr); -time_t cli_make_unix_date2(struct cli_state *cli, const void *date_ptr); -time_t cli_make_unix_date3(struct cli_state *cli, const void *date_ptr); void TimeInit(void); void get_process_uptime(struct timeval *ret_time); void get_startup_time(struct timeval *ret_time); diff --git a/source3/lib/time.c b/source3/lib/time.c index 3a43a5b6cd..bb75f1f70d 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -259,7 +259,7 @@ void dos_filetime_timespec(struct timespec *tsp) localtime). ********************************************************************/ -static time_t make_unix_date(const void *date_ptr, int zone_offset) +time_t make_unix_date(const void *date_ptr, int zone_offset) { uint32_t dos_date=0; struct tm t; @@ -452,22 +452,6 @@ void cli_put_dos_date3(struct cli_state *cli, char *buf, int offset, time_t unix push_dos_date3((uint8_t *)buf, offset, unixdate, cli->serverzone); } -time_t cli_make_unix_date(struct cli_state *cli, const void *date_ptr) -{ - return make_unix_date(date_ptr, cli->serverzone); -} - -time_t cli_make_unix_date2(struct cli_state *cli, const void *date_ptr) -{ - return make_unix_date2(date_ptr, cli->serverzone); -} - -time_t cli_make_unix_date3(struct cli_state *cli, const void *date_ptr) -{ - return make_unix_date3(date_ptr, cli->serverzone); -} - - /******************************************************************* Re-read the smb serverzone value. ******************************************************************/ diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 9d84585398..54e6a5d166 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -2146,8 +2146,8 @@ static void cli_negprot_done(struct tevent_req *subreq) cli->serverzone = SVALS(vwv + 10, 0); cli->serverzone *= 60; /* this time is converted to GMT by make_unix_date */ - cli->servertime = cli_make_unix_date( - cli, (char *)(vwv + 8)); + cli->servertime = make_unix_date( + (char *)(vwv + 8), cli->serverzone); cli->readbraw_supported = ((SVAL(vwv + 5, 0) & 0x1) != 0); cli->writebraw_supported = ((SVAL(vwv + 5, 0) & 0x2) != 0); cli->secblob = data_blob(bytes, num_bytes); diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index a8e3bd5017..56de119281 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -70,9 +70,12 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, if (pdata_end - base < 27) { return pdata_end - base; } - finfo->ctime_ts = convert_time_t_to_timespec(cli_make_unix_date2(cli, p+4)); - finfo->atime_ts = convert_time_t_to_timespec(cli_make_unix_date2(cli, p+8)); - finfo->mtime_ts = convert_time_t_to_timespec(cli_make_unix_date2(cli, p+12)); + finfo->ctime_ts = convert_time_t_to_timespec( + make_unix_date2(p+4, cli->serverzone)); + finfo->atime_ts = convert_time_t_to_timespec( + make_unix_date2(p+8, cli->serverzone)); + finfo->mtime_ts = convert_time_t_to_timespec( + make_unix_date2(p+12, cli->serverzone)); finfo->size = IVAL(p,16); finfo->mode = CVAL(p,24); len = CVAL(p, 26); @@ -115,9 +118,12 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, if (pdata_end - base < 31) { return pdata_end - base; } - finfo->ctime_ts = convert_time_t_to_timespec(cli_make_unix_date2(cli, p+4)); - finfo->atime_ts = convert_time_t_to_timespec(cli_make_unix_date2(cli, p+8)); - finfo->mtime_ts = convert_time_t_to_timespec(cli_make_unix_date2(cli, p+12)); + finfo->ctime_ts = convert_time_t_to_timespec( + make_unix_date2(p+4, cli->serverzone)); + finfo->atime_ts = convert_time_t_to_timespec( + make_unix_date2(p+8, cli->serverzone)); + finfo->mtime_ts = convert_time_t_to_timespec( + make_unix_date2(p+12, cli->serverzone)); finfo->size = IVAL(p,16); finfo->mode = CVAL(p,24); len = CVAL(p, 30); @@ -510,7 +516,7 @@ static bool interpret_short_filename(TALLOC_CTX *ctx, finfo->mode = CVAL(p,21); /* this date is converted to GMT by make_unix_date */ - finfo->ctime_ts.tv_sec = cli_make_unix_date(cli, p+22); + finfo->ctime_ts.tv_sec = make_unix_date(p+22, cli->serverzone); finfo->ctime_ts.tv_nsec = 0; finfo->mtime_ts.tv_sec = finfo->atime_ts.tv_sec = finfo->ctime_ts.tv_sec; finfo->mtime_ts.tv_nsec = finfo->atime_ts.tv_nsec = 0; diff --git a/source3/libsmb/cliprint.c b/source3/libsmb/cliprint.c index 723ae02623..89e80d2904 100644 --- a/source3/libsmb/cliprint.c +++ b/source3/libsmb/cliprint.c @@ -98,7 +98,8 @@ int cli_print_queue(struct cli_state *cli, fstrcpy(job.user, fix_char_ptr(SVAL(p,4), converter, rdata, rdrcnt)); - job.t = cli_make_unix_date3(cli, p + 12); + job.t = make_unix_date3( + p + 12, cli->serverzone); job.size = IVAL(p,16); fstrcpy(job.name,fix_char_ptr(SVAL(p,24), converter, diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 6c4826dd8e..a1b911cfbf 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -590,26 +590,26 @@ NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req, req, struct cli_qpathinfo1_state); NTSTATUS status; - time_t (*date_fn)(struct cli_state *, const void *); + time_t (*date_fn)(const void *buf, int serverzone); if (tevent_req_is_nterror(req, &status)) { return status; } if (state->cli->win95) { - date_fn = cli_make_unix_date; + date_fn = make_unix_date; } else { - date_fn = cli_make_unix_date2; + date_fn = make_unix_date2; } if (change_time) { - *change_time = date_fn(state->cli, state->data+0); + *change_time = date_fn(state->data+0, state->cli->serverzone); } if (access_time) { - *access_time = date_fn(state->cli, state->data+4); + *access_time = date_fn(state->data+4, state->cli->serverzone); } if (write_time) { - *write_time = date_fn(state->cli, state->data+8); + *write_time = date_fn(state->data+8, state->cli->serverzone); } if (size) { *size = IVAL(state->data, 12); |