summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-25 13:57:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:14 -0500
commit579c13da43d5b40ac6d6c1436399fbc1d8dfd054 (patch)
tree42299570746f2d7f80356b689cb15e3db6c53d3c /source4/libcli
parent81e8de9ca85fe9a6658beb1dab0d231c13cda063 (diff)
downloadsamba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.tar.gz
samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.tar.bz2
samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.zip
r873: converted samba4 to use real 64 bit integers instead of
structures. This was suggested by metze recently. I checked on the build farm and all the machines we have support 64 bit ints, and support the LL suffix for 64 bit constants. I suspect some won't support strtoll() and related functions, so we will probably need replacements for those. (This used to be commit 9a9244a1c66654c12abe4379661cba83a73c4c21)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/clilist.c6
-rw-r--r--source4/libcli/clitrans2.c16
-rw-r--r--source4/libcli/raw/clispnego.c12
-rw-r--r--source4/libcli/raw/rawnegotiate.c2
-rw-r--r--source4/libcli/raw/rawrequest.c10
-rw-r--r--source4/libcli/raw/rawsetfileinfo.c14
-rw-r--r--source4/libcli/util/asn1.c12
-rw-r--r--source4/libcli/util/smbencrypt.c2
8 files changed, 35 insertions, 39 deletions
diff --git a/source4/libcli/clilist.c b/source4/libcli/clilist.c
index ee0357579c..ca4b6acdc7 100644
--- a/source4/libcli/clilist.c
+++ b/source4/libcli/clilist.c
@@ -45,9 +45,9 @@ static BOOL interpret_long_filename(int level,
ZERO_STRUCTP(finfo);
finfo->size = info->both_directory_info.size;
- finfo->ctime = nt_time_to_unix(&info->both_directory_info.create_time);
- finfo->atime = nt_time_to_unix(&info->both_directory_info.access_time);
- finfo->mtime = nt_time_to_unix(&info->both_directory_info.write_time);
+ finfo->ctime = nt_time_to_unix(info->both_directory_info.create_time);
+ finfo->atime = nt_time_to_unix(info->both_directory_info.access_time);
+ finfo->mtime = nt_time_to_unix(info->both_directory_info.write_time);
finfo->mode = info->both_directory_info.attrib; /* 32 bit->16 bit attrib */
if (info->both_directory_info.short_name.s) {
strncpy(finfo->short_name, info->both_directory_info.short_name.s,
diff --git a/source4/libcli/clitrans2.c b/source4/libcli/clitrans2.c
index 777150a257..dc8c2cdfec 100644
--- a/source4/libcli/clitrans2.c
+++ b/source4/libcli/clitrans2.c
@@ -85,16 +85,16 @@ NTSTATUS cli_qpathinfo2(struct cli_tree *tree, const char *fname,
return status;
if (c_time) {
- *c_time = nt_time_to_unix(&parms.all_info.out.create_time);
+ *c_time = nt_time_to_unix(parms.all_info.out.create_time);
}
if (a_time) {
- *a_time = nt_time_to_unix(&parms.all_info.out.access_time);
+ *a_time = nt_time_to_unix(parms.all_info.out.access_time);
}
if (m_time) {
- *m_time = nt_time_to_unix(&parms.all_info.out.change_time);
+ *m_time = nt_time_to_unix(parms.all_info.out.change_time);
}
if (w_time) {
- *w_time = nt_time_to_unix(&parms.all_info.out.write_time);
+ *w_time = nt_time_to_unix(parms.all_info.out.write_time);
}
if (size) {
*size = parms.all_info.out.size;
@@ -163,16 +163,16 @@ NTSTATUS cli_qfileinfo(struct cli_tree *tree, int fnum,
}
if (c_time) {
- *c_time = nt_time_to_unix(&parms.all_info.out.create_time);
+ *c_time = nt_time_to_unix(parms.all_info.out.create_time);
}
if (a_time) {
- *a_time = nt_time_to_unix(&parms.all_info.out.access_time);
+ *a_time = nt_time_to_unix(parms.all_info.out.access_time);
}
if (m_time) {
- *m_time = nt_time_to_unix(&parms.all_info.out.change_time);
+ *m_time = nt_time_to_unix(parms.all_info.out.change_time);
}
if (w_time) {
- *w_time = nt_time_to_unix(&parms.all_info.out.write_time);
+ *w_time = nt_time_to_unix(parms.all_info.out.write_time);
}
if (mode) {
*mode = parms.all_info.out.attrib;
diff --git a/source4/libcli/raw/clispnego.c b/source4/libcli/raw/clispnego.c
index e6cadc466c..7ad6be1006 100644
--- a/source4/libcli/raw/clispnego.c
+++ b/source4/libcli/raw/clispnego.c
@@ -141,9 +141,9 @@ BOOL spnego_parse_negTokenInit(DATA_BLOB blob,
asn1_start_tag(&data,ASN1_CONTEXT(0));
asn1_start_tag(&data,ASN1_SEQUENCE(0));
for (i=0; asn1_tag_remaining(&data) > 0 && i < ASN1_MAX_OIDS; i++) {
- char *oid = NULL;
- asn1_read_OID(&data,&oid);
- OIDs[i] = oid;
+ char *aoid = NULL;
+ asn1_read_OID(&data,&aoid);
+ OIDs[i] = aoid;
}
OIDs[i] = NULL;
asn1_end_tag(&data);
@@ -230,9 +230,9 @@ BOOL parse_negTokenTarg(DATA_BLOB blob, char *OIDs[ASN1_MAX_OIDS], DATA_BLOB *se
asn1_start_tag(&data, ASN1_CONTEXT(0));
asn1_start_tag(&data, ASN1_SEQUENCE(0));
for (i=0; asn1_tag_remaining(&data) > 0 && i < ASN1_MAX_OIDS; i++) {
- char *oid = NULL;
- asn1_read_OID(&data,&oid);
- OIDs[i] = oid;
+ char *aoid = NULL;
+ asn1_read_OID(&data,&aoid);
+ OIDs[i] = aoid;
}
OIDs[i] = NULL;
asn1_end_tag(&data);
diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c
index 587050bef8..5b94ef63d8 100644
--- a/source4/libcli/raw/rawnegotiate.c
+++ b/source4/libcli/raw/rawnegotiate.c
@@ -106,7 +106,7 @@ NTSTATUS smb_raw_negotiate(struct cli_transport *transport)
/* this time arrives in real GMT */
ntt = cli_pull_nttime(req->in.vwv, VWV(11)+1);
- transport->negotiate.server_time = nt_time_to_unix(&ntt);
+ transport->negotiate.server_time = nt_time_to_unix(ntt);
transport->negotiate.capabilities = IVAL(req->in.vwv,VWV(9)+1);
transport->negotiate.secblob = cli_req_pull_blob(req, transport->mem_ctx, req->in.data, req->in.data_size);
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index 35a2d363df..085b445fba 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -831,11 +831,9 @@ BOOL cli_raw_pull_data(struct cli_request *req, const char *src, int len, char *
/*
put a NTTIME into a packet
*/
-
-void cli_push_nttime(void *base, uint16 offset, NTTIME *t)
+void cli_push_nttime(void *base, uint16 offset, NTTIME t)
{
- SIVAL(base, offset, t->low);
- SIVAL(base, offset+4, t->high);
+ SBVAL(base, offset, t);
}
/*
@@ -843,9 +841,7 @@ void cli_push_nttime(void *base, uint16 offset, NTTIME *t)
*/
NTTIME cli_pull_nttime(void *base, uint16 offset)
{
- NTTIME ret;
- ret.low = IVAL(base, offset);
- ret.high = IVAL(base, offset+4);
+ NTTIME ret = BVAL(base, offset);
return ret;
}
diff --git a/source4/libcli/raw/rawsetfileinfo.c b/source4/libcli/raw/rawsetfileinfo.c
index 9da94f161c..d8fc78972d 100644
--- a/source4/libcli/raw/rawsetfileinfo.c
+++ b/source4/libcli/raw/rawsetfileinfo.c
@@ -61,10 +61,10 @@ static BOOL smb_raw_setinfo_backend(struct cli_tree *tree,
case RAW_SFILEINFO_BASIC_INFO:
case RAW_SFILEINFO_BASIC_INFORMATION:
NEED_BLOB(40);
- cli_push_nttime(blob->data, 0, &parms->basic_info.in.create_time);
- cli_push_nttime(blob->data, 8, &parms->basic_info.in.access_time);
- cli_push_nttime(blob->data, 16, &parms->basic_info.in.write_time);
- cli_push_nttime(blob->data, 24, &parms->basic_info.in.change_time);
+ cli_push_nttime(blob->data, 0, parms->basic_info.in.create_time);
+ cli_push_nttime(blob->data, 8, parms->basic_info.in.access_time);
+ cli_push_nttime(blob->data, 16, parms->basic_info.in.write_time);
+ cli_push_nttime(blob->data, 24, parms->basic_info.in.change_time);
SIVAL(blob->data, 32, parms->basic_info.in.attrib);
SIVAL(blob->data, 36, 0); /* padding */
return True;
@@ -73,9 +73,9 @@ static BOOL smb_raw_setinfo_backend(struct cli_tree *tree,
NEED_BLOB(92);
SBVAL(blob->data, 0, parms->unix_basic.in.end_of_file);
SBVAL(blob->data, 8, parms->unix_basic.in.num_bytes);
- cli_push_nttime(blob->data, 16, &parms->unix_basic.in.status_change_time);
- cli_push_nttime(blob->data, 24, &parms->unix_basic.in.access_time);
- cli_push_nttime(blob->data, 32, &parms->unix_basic.in.change_time);
+ cli_push_nttime(blob->data, 16, parms->unix_basic.in.status_change_time);
+ cli_push_nttime(blob->data, 24, parms->unix_basic.in.access_time);
+ cli_push_nttime(blob->data, 32, parms->unix_basic.in.change_time);
SBVAL(blob->data, 40, parms->unix_basic.in.uid);
SBVAL(blob->data, 48, parms->unix_basic.in.gid);
SIVAL(blob->data, 56, parms->unix_basic.in.file_type);
diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c
index 09d4fbb6c9..07c692f700 100644
--- a/source4/libcli/util/asn1.c
+++ b/source4/libcli/util/asn1.c
@@ -315,17 +315,17 @@ int asn1_tag_remaining(ASN1_DATA *data)
BOOL asn1_read_OID(ASN1_DATA *data, char **OID)
{
uint8 b;
- pstring oid;
+ pstring aoid;
fstring el;
if (!asn1_start_tag(data, ASN1_OID)) return False;
asn1_read_uint8(data, &b);
- oid[0] = 0;
+ aoid[0] = 0;
snprintf(el, sizeof(el), "%u", b/40);
- pstrcat(oid, el);
+ pstrcat(aoid, el);
snprintf(el, sizeof(el), " %u", b%40);
- pstrcat(oid, el);
+ pstrcat(aoid, el);
while (asn1_tag_remaining(data) > 0) {
unsigned v = 0;
@@ -334,12 +334,12 @@ BOOL asn1_read_OID(ASN1_DATA *data, char **OID)
v = (v<<7) | (b&0x7f);
} while (!data->has_error && b & 0x80);
snprintf(el, sizeof(el), " %u", v);
- pstrcat(oid, el);
+ pstrcat(aoid, el);
}
asn1_end_tag(data);
- *OID = strdup(oid);
+ *OID = strdup(aoid);
return !data->has_error;
}
diff --git a/source4/libcli/util/smbencrypt.c b/source4/libcli/util/smbencrypt.c
index 5468bdbebe..013f00d5fa 100644
--- a/source4/libcli/util/smbencrypt.c
+++ b/source4/libcli/util/smbencrypt.c
@@ -314,7 +314,7 @@ static DATA_BLOB NTLMv2_generate_client_data(const DATA_BLOB *names_blob)
generate_random_buffer(client_chal, sizeof(client_chal), False);
- push_nttime(long_date, 0, &nttime);
+ push_nttime(long_date, 0, nttime);
/* See http://www.ubiqx.org/cifs/SMB.html#SMB.8.5 */