summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuk Claes <luk@debian.org>2012-05-19 18:50:27 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-28 14:49:48 +0200
commit1ff8c404a64ea583b8265441edfb78c3613134dd (patch)
treebee1c8929dd16017632d6754d4634f394b9121e5 /source3
parent278ba9928ab0f36c933f3190aee136bbc964055a (diff)
downloadsamba-1ff8c404a64ea583b8265441edfb78c3613134dd.tar.gz
samba-1ff8c404a64ea583b8265441edfb78c3613134dd.tar.bz2
samba-1ff8c404a64ea583b8265441edfb78c3613134dd.zip
s3:libsmb: get rid of cli_state_server_time_zone
Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/clientgen.c5
-rw-r--r--source3/libsmb/clifile.c12
-rw-r--r--source3/libsmb/clilist.c14
-rw-r--r--source3/libsmb/cliprint.c3
-rw-r--r--source3/libsmb/clirap.c6
-rw-r--r--source3/libsmb/proto.h1
-rw-r--r--source3/utils/net_time.c3
7 files changed, 20 insertions, 24 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index a7135359d3..20f9afdfa0 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -437,11 +437,6 @@ uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs)
return ret;
}
-int cli_state_server_time_zone(struct cli_state *cli)
-{
- return smb1cli_conn_server_time_zone(cli->conn);
-}
-
time_t cli_state_server_time(struct cli_state *cli)
{
NTTIME nt;
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index fc5f5d7024..963f553144 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -3258,7 +3258,7 @@ struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
return NULL;
}
- state->zone_offset = cli_state_server_time_zone(cli);
+ state->zone_offset = smb1cli_conn_server_time_zone(cli->conn);
SSVAL(state->vwv+0,0,fnum);
subreq = cli_smb_send(state, ev, cli, SMBgetattrE, additional_flags,
@@ -3407,7 +3407,7 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
return NULL;
}
- state->zone_offset = cli_state_server_time_zone(cli);
+ state->zone_offset = smb1cli_conn_server_time_zone(cli->conn);
bytes = talloc_array(state, uint8_t, 1);
if (tevent_req_nomem(bytes, req)) {
@@ -3554,11 +3554,11 @@ struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
SSVAL(state->vwv+0, 0, fnum);
push_dos_date2((uint8_t *)&state->vwv[1], 0, change_time,
- cli_state_server_time_zone(cli));
+ smb1cli_conn_server_time_zone(cli->conn));
push_dos_date2((uint8_t *)&state->vwv[3], 0, access_time,
- cli_state_server_time_zone(cli));
+ smb1cli_conn_server_time_zone(cli->conn));
push_dos_date2((uint8_t *)&state->vwv[5], 0, write_time,
- cli_state_server_time_zone(cli));
+ smb1cli_conn_server_time_zone(cli->conn));
subreq = cli_smb_send(state, ev, cli, SMBsetattrE, additional_flags,
7, state->vwv, 0, NULL);
@@ -3665,7 +3665,7 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
}
SSVAL(state->vwv+0, 0, attr);
- push_dos_date3((uint8_t *)&state->vwv[1], 0, mtime, cli_state_server_time_zone(cli));
+ push_dos_date3((uint8_t *)&state->vwv[1], 0, mtime, smb1cli_conn_server_time_zone(cli->conn));
bytes = talloc_array(state, uint8_t, 1);
if (tevent_req_nomem(bytes, req)) {
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index aa8012cb30..ce3fb27297 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -77,11 +77,11 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
return pdata_end - base;
}
finfo->ctime_ts = convert_time_t_to_timespec(
- make_unix_date2(p+4, cli_state_server_time_zone(cli)));
+ make_unix_date2(p+4, smb1cli_conn_server_time_zone(cli->conn)));
finfo->atime_ts = convert_time_t_to_timespec(
- make_unix_date2(p+8, cli_state_server_time_zone(cli)));
+ make_unix_date2(p+8, smb1cli_conn_server_time_zone(cli->conn)));
finfo->mtime_ts = convert_time_t_to_timespec(
- make_unix_date2(p+12, cli_state_server_time_zone(cli)));
+ make_unix_date2(p+12, smb1cli_conn_server_time_zone(cli->conn)));
finfo->size = IVAL(p,16);
finfo->mode = CVAL(p,24);
len = CVAL(p, 26);
@@ -126,11 +126,11 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
return pdata_end - base;
}
finfo->ctime_ts = convert_time_t_to_timespec(
- make_unix_date2(p+4, cli_state_server_time_zone(cli)));
+ make_unix_date2(p+4, smb1cli_conn_server_time_zone(cli->conn)));
finfo->atime_ts = convert_time_t_to_timespec(
- make_unix_date2(p+8, cli_state_server_time_zone(cli)));
+ make_unix_date2(p+8, smb1cli_conn_server_time_zone(cli->conn)));
finfo->mtime_ts = convert_time_t_to_timespec(
- make_unix_date2(p+12, cli_state_server_time_zone(cli)));
+ make_unix_date2(p+12, smb1cli_conn_server_time_zone(cli->conn)));
finfo->size = IVAL(p,16);
finfo->mode = CVAL(p,24);
len = CVAL(p, 30);
@@ -248,7 +248,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 = make_unix_date(p+22, cli_state_server_time_zone(cli));
+ finfo->ctime_ts.tv_sec = make_unix_date(p+22, smb1cli_conn_server_time_zone(cli->conn));
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 f34b3e971b..c7888e9b38 100644
--- a/source3/libsmb/cliprint.c
+++ b/source3/libsmb/cliprint.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
+#include "../libcli/smb/smbXcli_base.h"
/*****************************************************************************
Convert a character pointer in a cli_call_api() response to a form we can use.
@@ -101,7 +102,7 @@ int cli_print_queue(struct cli_state *cli,
fix_char_ptr(SVAL(p,4), converter,
rdata, rdrcnt));
job.t = make_unix_date3(
- p + 12, cli_state_server_time_zone(cli));
+ p + 12, smb1cli_conn_server_time_zone(cli->conn));
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 2815243f2f..175fa3e6a1 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -640,13 +640,13 @@ NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req,
}
if (change_time) {
- *change_time = date_fn(state->data+0, cli_state_server_time_zone(state->cli));
+ *change_time = date_fn(state->data+0, smb1cli_conn_server_time_zone(state->cli->conn));
}
if (access_time) {
- *access_time = date_fn(state->data+4, cli_state_server_time_zone(state->cli));
+ *access_time = date_fn(state->data+4, smb1cli_conn_server_time_zone(state->cli->conn));
}
if (write_time) {
- *write_time = date_fn(state->data+8, cli_state_server_time_zone(state->cli));
+ *write_time = date_fn(state->data+8, smb1cli_conn_server_time_zone(state->cli->conn));
}
if (size) {
*size = IVAL(state->data, 12);
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 70e5027504..db45016ecb 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -181,7 +181,6 @@ uint16_t cli_state_get_uid(struct cli_state *cli);
uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
-int cli_state_server_time_zone(struct cli_state *cli);
time_t cli_state_server_time(struct cli_state *cli);
struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
struct cli_state *cli, uint16_t num_echos,
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index 195144cbe0..979d29cf91 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -20,6 +20,7 @@
#include "utils/net.h"
#include "libsmb/nmblib.h"
#include "libsmb/libsmb.h"
+#include "../libcli/smb/smbXcli_base.h"
/*
return the time on a server. This does not require any authentication
@@ -48,7 +49,7 @@ static time_t cli_servertime(const char *host,
}
ret = cli_state_server_time(cli);
- if (zone) *zone = cli_state_server_time_zone(cli);
+ if (zone) *zone = smb1cli_conn_server_time_zone(cli->conn);
done:
if (cli) {