summaryrefslogtreecommitdiff
path: root/source4/torture
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/torture
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/torture')
-rw-r--r--source4/torture/gentest.c8
-rw-r--r--source4/torture/locktest.c6
-rw-r--r--source4/torture/raw/close.c4
-rw-r--r--source4/torture/raw/open.c8
-rw-r--r--source4/torture/raw/qfileinfo.c36
-rw-r--r--source4/torture/raw/read.c8
-rw-r--r--source4/torture/raw/search.c10
-rw-r--r--source4/torture/raw/setfileinfo.c6
-rw-r--r--source4/torture/raw/write.c12
-rw-r--r--source4/torture/rpc/netlogon.c18
-rw-r--r--source4/torture/rpc/samr.c4
-rw-r--r--source4/torture/torture_util.c10
12 files changed, 62 insertions, 68 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 32dd763b26..5c5bdf5955 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -1031,12 +1031,12 @@ again:
} while(0)
#define CHECK_NTTIMES_EQUAL(field) do { \
- if (ABS(nt_time_to_unix(&parm[0].field) - \
- nt_time_to_unix(&parm[1].field)) > time_skew() && \
+ if (ABS(nt_time_to_unix(parm[0].field) - \
+ nt_time_to_unix(parm[1].field)) > time_skew() && \
!ignore_pattern(#field)) { \
printf("Mismatch in %s - 0x%x 0x%x\n", #field, \
- (int)nt_time_to_unix(&parm[0].field), \
- (int)nt_time_to_unix(&parm[1].field)); \
+ (int)nt_time_to_unix(parm[0].field), \
+ (int)nt_time_to_unix(parm[1].field)); \
return False; \
} \
} while(0)
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index cfc3d95cde..99dcf9fd47 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -55,7 +55,7 @@ struct record {
enum lock_op lock_op;
enum brl_type lock_type;
char conn, f;
- SMB_BIG_UINT start, len;
+ uint64_t start, len;
char needed;
};
@@ -166,8 +166,8 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
{
unsigned conn = rec->conn;
unsigned f = rec->f;
- SMB_BIG_UINT start = rec->start;
- SMB_BIG_UINT len = rec->len;
+ uint64_t start = rec->start;
+ uint64_t len = rec->len;
enum brl_type op = rec->lock_type;
int server;
BOOL ret[NSERVERS];
diff --git a/source4/torture/raw/close.c b/source4/torture/raw/close.c
index 0180f43dd2..e2221946a0 100644
--- a/source4/torture/raw/close.c
+++ b/source4/torture/raw/close.c
@@ -77,10 +77,10 @@ BOOL torture_raw_close(int dummy)
status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo);
CHECK_STATUS(status, NT_STATUS_OK);
- if (basetime != nt_time_to_unix(&finfo.all_info.out.write_time)) {
+ if (basetime != nt_time_to_unix(finfo.all_info.out.write_time)) {
printf("Incorrect write time on file - %s - %s\n",
timestring(mem_ctx, basetime),
- nt_time_string(mem_ctx, &finfo.all_info.out.write_time));
+ nt_time_string(mem_ctx, finfo.all_info.out.write_time));
dump_all_info(mem_ctx, &finfo);
ret = False;
}
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index f559632f23..6b85b243d5 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -84,7 +84,7 @@ static const char *rdwr_string(enum rdwr_mode m)
status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); \
CHECK_STATUS(status, NT_STATUS_OK); \
t1 = t & ~1; \
- t2 = nt_time_to_unix(&finfo.all_info.out.field) & ~1; \
+ t2 = nt_time_to_unix(finfo.all_info.out.field) & ~1; \
if (ABS(t1-t2) > 2) { \
printf("(%d) wrong time for field %s %s - %s\n", \
__LINE__, #field, \
@@ -101,11 +101,11 @@ static const char *rdwr_string(enum rdwr_mode m)
status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); \
CHECK_STATUS(status, NT_STATUS_OK); \
t2 = finfo.all_info.out.field; \
- if (!nt_time_equal(&t, &t2)) { \
+ if (t != t2) { \
printf("(%d) wrong time for field %s %s - %s\n", \
__LINE__, #field, \
- nt_time_string(mem_ctx, &t), \
- nt_time_string(mem_ctx, &t2)); \
+ nt_time_string(mem_ctx, t), \
+ nt_time_string(mem_ctx, t2)); \
dump_all_info(mem_ctx, &finfo); \
ret = False; \
}} while (0)
diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c
index 9c1c3a9e5c..14f30db97f 100644
--- a/source4/torture/raw/qfileinfo.c
+++ b/source4/torture/raw/qfileinfo.c
@@ -66,7 +66,7 @@ static struct {
/*
compare a dos time (2 second resolution) to a nt time
*/
-static int dos_nt_time_cmp(time_t t, const NTTIME *nt)
+static int dos_nt_time_cmp(time_t t, NTTIME nt)
{
time_t t2 = nt_time_to_unix(nt);
if (ABS(t2 - t) <= 2) return 0;
@@ -158,7 +158,7 @@ BOOL torture_raw_qfileinfo(int dummy)
int fnum;
const char *fname = "\\torture_qfileinfo.txt";
NTTIME correct_time;
- large_t correct_size;
+ uint64_t correct_size;
uint32 correct_attrib;
const char *correct_name;
BOOL skip_streams = False;
@@ -320,54 +320,54 @@ BOOL torture_raw_qfileinfo(int dummy)
s1 = fnum_find(sname); \
if (s1 && memcmp(&s1->stype.out.tfield, &correct_time, sizeof(correct_time)) != 0) { \
printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
- nt_time_string(mem_ctx, &s1->stype.out.tfield), \
- nt_time_string(mem_ctx, &correct_time)); \
+ nt_time_string(mem_ctx, s1->stype.out.tfield), \
+ nt_time_string(mem_ctx, correct_time)); \
ret = False; \
} \
s1 = fname_find(sname); \
if (s1 && memcmp(&s1->stype.out.tfield, &correct_time, sizeof(correct_time)) != 0) { \
printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
- nt_time_string(mem_ctx, &s1->stype.out.tfield), \
- nt_time_string(mem_ctx, &correct_time)); \
+ nt_time_string(mem_ctx, s1->stype.out.tfield), \
+ nt_time_string(mem_ctx, correct_time)); \
ret = False; \
}} while (0)
#define TIME_CHECK_DOS(sname, stype, tfield) do { \
s1 = fnum_find(sname); \
- if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \
+ if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \
printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
- nt_time_string(mem_ctx, &correct_time)); \
+ nt_time_string(mem_ctx, correct_time)); \
ret = False; \
} \
s1 = fname_find(sname); \
- if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \
+ if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \
printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
- nt_time_string(mem_ctx, &correct_time)); \
+ nt_time_string(mem_ctx, correct_time)); \
ret = False; \
}} while (0)
#define TIME_CHECK_UNX(sname, stype, tfield) do { \
s1 = fnum_find(sname); \
- if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \
+ if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \
printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
- nt_time_string(mem_ctx, &correct_time)); \
+ nt_time_string(mem_ctx, correct_time)); \
ret = False; \
} \
s1 = fname_find(sname); \
- if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \
+ if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \
printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
- nt_time_string(mem_ctx, &correct_time)); \
+ nt_time_string(mem_ctx, correct_time)); \
ret = False; \
}} while (0)
/* now check that all the times that are supposed to be equal are correct */
s1 = fnum_find("BASIC_INFO");
correct_time = s1->basic_info.out.create_time;
- printf("create_time: %s\n", nt_time_string(mem_ctx, &correct_time));
+ printf("create_time: %s\n", nt_time_string(mem_ctx, correct_time));
TIME_CHECK_NT ("BASIC_INFO", basic_info, create_time);
TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, create_time);
@@ -379,7 +379,7 @@ BOOL torture_raw_qfileinfo(int dummy)
s1 = fnum_find("BASIC_INFO");
correct_time = s1->basic_info.out.access_time;
- printf("access_time: %s\n", nt_time_string(mem_ctx, &correct_time));
+ printf("access_time: %s\n", nt_time_string(mem_ctx, correct_time));
TIME_CHECK_NT ("BASIC_INFO", basic_info, access_time);
TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, access_time);
@@ -391,7 +391,7 @@ BOOL torture_raw_qfileinfo(int dummy)
s1 = fnum_find("BASIC_INFO");
correct_time = s1->basic_info.out.write_time;
- printf("write_time : %s\n", nt_time_string(mem_ctx, &correct_time));
+ printf("write_time : %s\n", nt_time_string(mem_ctx, correct_time));
TIME_CHECK_NT ("BASIC_INFO", basic_info, write_time);
TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, write_time);
@@ -404,7 +404,7 @@ BOOL torture_raw_qfileinfo(int dummy)
s1 = fnum_find("BASIC_INFO");
correct_time = s1->basic_info.out.change_time;
- printf("change_time: %s\n", nt_time_string(mem_ctx, &correct_time));
+ printf("change_time: %s\n", nt_time_string(mem_ctx, correct_time));
TIME_CHECK_NT ("BASIC_INFO", basic_info, change_time);
TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, change_time);
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index 3e9547856c..5e1d055e22 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -502,9 +502,8 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_read(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT);
-#ifdef LARGE_SMB_OFF_T
printf("Trying large offset read\n");
- io.readx.in.offset = ((SMB_BIG_UINT)0x2) << 32;
+ io.readx.in.offset = ((uint64_t)0x2) << 32;
io.readx.in.mincnt = 10;
io.readx.in.maxcnt = 10;
status = smb_raw_read(cli->tree, &io);
@@ -520,7 +519,6 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_read(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.readx.out.nread, 0);
-#endif
done:
cli_close(cli->tree, fnum);
@@ -684,16 +682,14 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.readbraw.out.nread, 0);
-#ifdef LARGE_SMB_OFF_T
printf("Trying large offset read\n");
- io.readbraw.in.offset = ((SMB_BIG_UINT)0x2) << 32;
+ io.readbraw.in.offset = ((uint64_t)0x2) << 32;
io.readbraw.in.mincnt = 10;
io.readbraw.in.maxcnt = 10;
io.readbraw.in.timeout = 0;
status = smb_raw_read(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.readbraw.out.nread, 0);
-#endif
done:
cli_close(cli->tree, fnum);
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 57c6eb2bb9..ae5d8c34a8 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -197,11 +197,11 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
#define CHECK_TIME(name, sname1, field1, v, sname2, field2) do { \
s = find(name); \
if (s) { \
- if (s->sname1.field1 != (~1 & nt_time_to_unix(&v.sname2.out.field2))) { \
+ if (s->sname1.field1 != (~1 & nt_time_to_unix(v.sname2.out.field2))) { \
printf("(%d) %s/%s [%s] != %s/%s [%s]\n", \
__LINE__, \
#sname1, #field1, timestring(mem_ctx, s->sname1.field1), \
- #sname2, #field2, nt_time_string(mem_ctx, &v.sname2.out.field2)); \
+ #sname2, #field2, nt_time_string(mem_ctx, v.sname2.out.field2)); \
ret = False; \
} \
}} while (0)
@@ -209,11 +209,11 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
#define CHECK_NTTIME(name, sname1, field1, v, sname2, field2) do { \
s = find(name); \
if (s) { \
- if (memcmp(&s->sname1.field1, &v.sname2.out.field2, sizeof(NTTIME))) { \
+ if (s->sname1.field1 != v.sname2.out.field2) { \
printf("(%d) %s/%s [%s] != %s/%s [%s]\n", \
__LINE__, \
- #sname1, #field1, nt_time_string(mem_ctx, &s->sname1.field1), \
- #sname2, #field2, nt_time_string(mem_ctx, &v.sname2.out.field2)); \
+ #sname1, #field1, nt_time_string(mem_ctx, s->sname1.field1), \
+ #sname2, #field2, nt_time_string(mem_ctx, v.sname2.out.field2)); \
ret = False; \
} \
}} while (0)
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c
index 3a49c8baff..fb2e0633e8 100644
--- a/source4/torture/raw/setfileinfo.c
+++ b/source4/torture/raw/setfileinfo.c
@@ -152,13 +152,13 @@ BOOL torture_raw_sfileinfo(int dummy)
#define CHECK_TIME(call, stype, field, value) do { \
CHECK1(call); \
- if (NT_STATUS_IS_OK(status) && NT_STATUS_IS_OK(status2) && nt_time_to_unix(&finfo2.stype.out.field) != value) { \
+ if (NT_STATUS_IS_OK(status) && NT_STATUS_IS_OK(status2) && nt_time_to_unix(finfo2.stype.out.field) != value) { \
printf("(%d) %s - %s/%s should be 0x%x - 0x%x\n", __LINE__, \
call_name, #stype, #field, \
(uint_t)value, \
- (uint_t)nt_time_to_unix(&finfo2.stype.out.field)); \
+ (uint_t)nt_time_to_unix(finfo2.stype.out.field)); \
printf("\t%s", timestring(mem_ctx, value)); \
- printf("\t%s\n", nt_time_string(mem_ctx, &finfo2.stype.out.field)); \
+ printf("\t%s\n", nt_time_string(mem_ctx, finfo2.stype.out.field)); \
dump_all_info(mem_ctx, &finfo1); \
}} while (0)
diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c
index eb20fe3b84..18c992b8c6 100644
--- a/source4/torture/raw/write.c
+++ b/source4/torture/raw/write.c
@@ -187,7 +187,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_write(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.write.out.nwritten, 4000);
- CHECK_ALL_INFO(io.write.in.count + (SMB_BIG_UINT)io.write.in.offset, size);
+ CHECK_ALL_INFO(io.write.in.count + (uint64_t)io.write.in.offset, size);
memset(buf, 0, maxsize);
if (cli_read(cli->tree, fnum, buf, io.write.in.offset, 4000) != 4000) {
@@ -337,7 +337,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_write(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.writex.out.nwritten, 4000);
- CHECK_ALL_INFO(io.writex.in.count + (SMB_BIG_UINT)io.writex.in.offset, size);
+ CHECK_ALL_INFO(io.writex.in.count + (uint64_t)io.writex.in.offset, size);
memset(buf, 0, maxsize);
if (cli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) {
@@ -352,12 +352,12 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx)
setup_buffer(buf, seed+1, maxsize);
io.writex.in.fnum = fnum;
io.writex.in.count = 4000;
- io.writex.in.offset = ((SMB_BIG_UINT)1) << i;
+ io.writex.in.offset = ((uint64_t)1) << i;
io.writex.in.data = buf;
status = smb_raw_write(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.writex.out.nwritten, 4000);
- CHECK_ALL_INFO(io.writex.in.count + (SMB_BIG_UINT)io.writex.in.offset, size);
+ CHECK_ALL_INFO(io.writex.in.count + (uint64_t)io.writex.in.offset, size);
memset(buf, 0, maxsize);
if (cli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) {
@@ -500,7 +500,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_write(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.writeunlock.out.nwritten, 4000);
- CHECK_ALL_INFO(io.writeunlock.in.count + (SMB_BIG_UINT)io.writeunlock.in.offset, size);
+ CHECK_ALL_INFO(io.writeunlock.in.count + (uint64_t)io.writeunlock.in.offset, size);
memset(buf, 0, maxsize);
if (cli_read(cli->tree, fnum, buf, io.writeunlock.in.offset, 4000) != 4000) {
@@ -650,7 +650,7 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_write(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.writeclose.out.nwritten, 4000);
- CHECK_ALL_INFO(io.writeclose.in.count + (SMB_BIG_UINT)io.writeclose.in.offset, size);
+ CHECK_ALL_INFO(io.writeclose.in.count + (uint64_t)io.writeclose.in.offset, size);
fnum = cli_open(cli->tree, fname, O_RDWR, DENY_NONE);
io.writeclose.in.fnum = fnum;
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 524af42e01..25c0496a00 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -1081,7 +1081,7 @@ static BOOL test_SetPassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
/* we remember the sequence numbers so we can easily do a DatabaseDelta */
-static struct ULONG8 sequence_nums[3];
+static uint64_t sequence_nums[3];
/*
try a netlogon DatabaseSync
@@ -1133,10 +1133,9 @@ static BOOL test_DatabaseSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
r.out.delta_enum_array->delta_enum[0].delta_union.domain) {
sequence_nums[r.in.database_id] =
r.out.delta_enum_array->delta_enum[0].delta_union.domain->sequence_num;
- printf("\tsequence_nums[%d]=0x%08x%08x\n",
+ printf("\tsequence_nums[%d]=%llu\n",
r.in.database_id,
- sequence_nums[r.in.database_id].high,
- sequence_nums[r.in.database_id].low);
+ sequence_nums[r.in.database_id]);
}
} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
}
@@ -1170,13 +1169,13 @@ static BOOL test_DatabaseDeltas(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
r.in.database_id = database_ids[i];
r.in.sequence_num = sequence_nums[r.in.database_id];
- if (r.in.sequence_num.low == 0) continue;
+ if (r.in.sequence_num == 0) continue;
- r.in.sequence_num.low -= 1;
+ r.in.sequence_num -= 1;
- printf("Testing DatabaseDeltas of id %d at %d\n",
- r.in.database_id, r.in.sequence_num.low);
+ printf("Testing DatabaseDeltas of id %d at %llu\n",
+ r.in.database_id, r.in.sequence_num);
do {
creds_client_authenticator(&creds, &r.in.credential);
@@ -1193,8 +1192,7 @@ static BOOL test_DatabaseDeltas(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
printf("Credential chaining failed\n");
}
- r.in.sequence_num.low++;
- r.in.sequence_num.high = 0;
+ r.in.sequence_num++;
} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
}
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 14c124af78..73d599209c 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -862,7 +862,7 @@ static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct samr_CryptPassword nt_pass, lm_pass;
struct samr_Hash nt_verifier, lm_verifier;
char *oldpass = *password;
- char *newpass = samr_rand_pass(mem_ctx);
+ char *newpass = samr_rand_pass(mem_ctx);
uint8 old_nt_hash[16], new_nt_hash[16];
uint8 old_lm_hash[16], new_lm_hash[16];
@@ -878,7 +878,7 @@ static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
E_deshash(newpass, new_lm_hash);
encode_pw_buffer(lm_pass.data, newpass, STR_UNICODE);
- SamOEMhash(lm_pass.data, old_lm_hash, 516);
+ SamOEMhash(lm_pass.data, old_nt_hash, 516);
E_old_pw_hash(new_lm_hash, old_lm_hash, lm_verifier.hash);
encode_pw_buffer(nt_pass.data, newpass, STR_UNICODE);
diff --git a/source4/torture/torture_util.c b/source4/torture/torture_util.c
index 96579999c3..5b9e36ea71 100644
--- a/source4/torture/torture_util.c
+++ b/source4/torture/torture_util.c
@@ -217,7 +217,7 @@ BOOL wire_bad_flags(WIRE_STRING *str, int flags)
*/
BOOL nt_time_equal(NTTIME *t1, NTTIME *t2)
{
- return t1->low == t2->low && t1->high == t2->high;
+ return *t1 == *t2;
}
/*
@@ -225,10 +225,10 @@ BOOL nt_time_equal(NTTIME *t1, NTTIME *t2)
*/
void dump_all_info(TALLOC_CTX *mem_ctx, union smb_fileinfo *finfo)
{
- d_printf("\tcreate_time: %s\n", nt_time_string(mem_ctx, &finfo->all_info.out.create_time));
- d_printf("\taccess_time: %s\n", nt_time_string(mem_ctx, &finfo->all_info.out.access_time));
- d_printf("\twrite_time: %s\n", nt_time_string(mem_ctx, &finfo->all_info.out.write_time));
- d_printf("\tchange_time: %s\n", nt_time_string(mem_ctx, &finfo->all_info.out.change_time));
+ d_printf("\tcreate_time: %s\n", nt_time_string(mem_ctx, finfo->all_info.out.create_time));
+ d_printf("\taccess_time: %s\n", nt_time_string(mem_ctx, finfo->all_info.out.access_time));
+ d_printf("\twrite_time: %s\n", nt_time_string(mem_ctx, finfo->all_info.out.write_time));
+ d_printf("\tchange_time: %s\n", nt_time_string(mem_ctx, finfo->all_info.out.change_time));
d_printf("\tattrib: 0x%x\n", finfo->all_info.out.attrib);
d_printf("\talloc_size: %llu\n", (unsigned long long)finfo->all_info.out.alloc_size);
d_printf("\tsize: %llu\n", (unsigned long long)finfo->all_info.out.size);