summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/aliases.c10
-rw-r--r--source4/torture/basic/denytest.c18
-rw-r--r--source4/torture/basic/locking.c6
-rw-r--r--source4/torture/basic/utable.c8
-rw-r--r--source4/torture/nbench/nbio.c6
-rw-r--r--source4/torture/raw/context.c6
-rw-r--r--source4/torture/raw/lock.c4
-rw-r--r--source4/torture/raw/open.c2
-rw-r--r--source4/torture/raw/read.c14
-rw-r--r--source4/torture/raw/seek.c2
-rw-r--r--source4/torture/raw/streams.c2
-rw-r--r--source4/torture/raw/write.c14
-rw-r--r--source4/torture/torture.c20
13 files changed, 56 insertions, 56 deletions
diff --git a/source4/torture/basic/aliases.c b/source4/torture/basic/aliases.c
index 50aabb825a..018bfd9f1a 100644
--- a/source4/torture/basic/aliases.c
+++ b/source4/torture/basic/aliases.c
@@ -125,7 +125,7 @@ static void qfileinfo_aliases(struct smbcli_state *cli)
printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
}
- smbcli_write(cli->tree, fnum, 0, (char *)&t2, 0, sizeof(t2));
+ smbcli_write(cli->tree, fnum, 0, &t2, 0, sizeof(t2));
SSVAL(t2.in.params.data, 0, fnum);
@@ -165,7 +165,7 @@ static void qpathinfo_aliases(struct smbcli_state *cli)
printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
}
- smbcli_write(cli->tree, fnum, 0, (char *)&t2, 0, sizeof(t2));
+ smbcli_write(cli->tree, fnum, 0, &t2, 0, sizeof(t2));
smbcli_close(cli->tree, fnum);
SIVAL(t2.in.params.data, 2, 0);
@@ -209,7 +209,7 @@ static void findfirst_aliases(struct smbcli_state *cli)
printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
}
- smbcli_write(cli->tree, fnum, 0, (char *)&t2, 0, sizeof(t2));
+ smbcli_write(cli->tree, fnum, 0, &t2, 0, sizeof(t2));
smbcli_close(cli->tree, fnum);
SSVAL(t2.in.params.data, 0, 0);
@@ -321,7 +321,7 @@ static void setfileinfo_aliases(struct smbcli_state *cli)
printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
}
- smbcli_write(cli->tree, fnum, 0, (char *)&t2, 0, sizeof(t2));
+ smbcli_write(cli->tree, fnum, 0, &t2, 0, sizeof(t2));
SSVAL(t2.in.params.data, 0, fnum);
SSVAL(t2.in.params.data, 4, 0);
@@ -362,7 +362,7 @@ static void setpathinfo_aliases(struct smbcli_state *cli)
printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
}
- smbcli_write(cli->tree, fnum, 0, (char *)&t2, 0, sizeof(t2));
+ smbcli_write(cli->tree, fnum, 0, &t2, 0, sizeof(t2));
smbcli_close(cli->tree, fnum);
SSVAL(t2.in.params.data, 2, 0);
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 7979778c3f..0e0032058f 100644
--- a/source4/torture/basic/denytest.c
+++ b/source4/torture/basic/denytest.c
@@ -1454,12 +1454,12 @@ BOOL torture_denytest1(void)
} else if (fnum2 == -1) {
res = A_0;
} else {
- char x = 1;
+ uint8_t x = 1;
res = A_0;
- if (smbcli_read(cli1->tree, fnum2, (void *)&x, 0, 1) == 1) {
+ if (smbcli_read(cli1->tree, fnum2, &x, 0, 1) == 1) {
res += A_R;
}
- if (smbcli_write(cli1->tree, fnum2, 0, (void *)&x, 0, 1) == 1) {
+ if (smbcli_write(cli1->tree, fnum2, 0, &x, 0, 1) == 1) {
res += A_W;
}
}
@@ -1551,12 +1551,12 @@ BOOL torture_denytest2(void)
} else if (fnum2 == -1) {
res = A_0;
} else {
- char x = 1;
+ uint8_t x = 1;
res = A_0;
- if (smbcli_read(cli2->tree, fnum2, (void *)&x, 0, 1) == 1) {
+ if (smbcli_read(cli2->tree, fnum2, &x, 0, 1) == 1) {
res += A_R;
}
- if (smbcli_write(cli2->tree, fnum2, 0, (void *)&x, 0, 1) == 1) {
+ if (smbcli_write(cli2->tree, fnum2, 0, &x, 0, 1) == 1) {
res += A_W;
}
}
@@ -1782,7 +1782,7 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c
union smb_open io1, io2;
extern int torture_numops;
int failures = 0;
- char buf[1];
+ uint8_t buf[1];
ZERO_STRUCT(buf);
@@ -1843,11 +1843,11 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c
} else {
res = A_0;
if (smbcli_read(cli2->tree,
- io2.ntcreatex.out.fnum, (void *)buf, 0, sizeof(buf)) >= 1) {
+ io2.ntcreatex.out.fnum, buf, 0, sizeof(buf)) >= 1) {
res += A_R;
}
if (smbcli_write(cli2->tree,
- io2.ntcreatex.out.fnum, 0, (void *)buf, 0, sizeof(buf)) >= 1) {
+ io2.ntcreatex.out.fnum, 0, buf, 0, sizeof(buf)) >= 1) {
res += A_W;
}
}
diff --git a/source4/torture/basic/locking.c b/source4/torture/basic/locking.c
index ba7d568706..7a1a13762b 100644
--- a/source4/torture/basic/locking.c
+++ b/source4/torture/basic/locking.c
@@ -464,7 +464,7 @@ BOOL torture_locktest4(void)
const char *fname = "\\lockt4.lck";
int fnum1, fnum2, f;
BOOL ret;
- char buf[1000];
+ uint8_t buf[1000];
BOOL correct = True;
if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
@@ -632,7 +632,7 @@ BOOL torture_locktest5(void)
const char *fname = "\\lockt5.lck";
int fnum1, fnum2, fnum3;
BOOL ret;
- char buf[1000];
+ uint8_t buf[1000];
BOOL correct = True;
if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
@@ -792,7 +792,7 @@ BOOL torture_locktest7(void)
int fnum1;
int fnum2 = -1;
size_t size;
- char buf[200];
+ uint8_t buf[200];
BOOL correct = False;
if (!torture_open_connection(&cli1)) {
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index f9233595cf..01984077a3 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -28,7 +28,7 @@ BOOL torture_utable(void)
fstring fname;
const char *alt_name;
int fnum;
- char c2[4];
+ uint8_t c2[4];
int c, len, fd;
int chars_allowed=0, alt_allowed=0;
uint8_t valid[0x10000];
@@ -102,7 +102,7 @@ BOOL torture_utable(void)
static char *form_name(int c)
{
static fstring fname;
- char c2[4];
+ uint8_t c2[4];
char *p;
int len;
@@ -178,7 +178,7 @@ BOOL torture_casetable(void)
return False;
}
- smbcli_read(cli->tree, fnum, (char *)c2, 0, size);
+ smbcli_read(cli->tree, fnum, c2, 0, size);
printf("%04x: ", c);
equiv[c][0] = c;
for (i=0; i<size/sizeof(int); i++) {
@@ -189,7 +189,7 @@ BOOL torture_casetable(void)
fflush(stdout);
}
- smbcli_write(cli->tree, fnum, 0, (char *)&c, size, sizeof(c));
+ smbcli_write(cli->tree, fnum, 0, &c, size, sizeof(c));
smbcli_close(cli->tree, fnum);
}
diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c
index 32bd108442..b83234be91 100644
--- a/source4/torture/nbench/nbio.c
+++ b/source4/torture/nbench/nbio.c
@@ -293,7 +293,7 @@ void nb_writex(int handle, int offset, int size, int ret_size, NTSTATUS status)
union smb_write io;
int i;
NTSTATUS ret;
- char *buf;
+ uint8_t *buf;
i = find_handle(handle);
@@ -330,7 +330,7 @@ void nb_write(int handle, int offset, int size, int ret_size, NTSTATUS status)
union smb_write io;
int i;
NTSTATUS ret;
- char *buf;
+ uint8_t *buf;
i = find_handle(handle);
@@ -420,7 +420,7 @@ void nb_readx(int handle, int offset, int size, int ret_size, NTSTATUS status)
union smb_read io;
int i;
NTSTATUS ret;
- char *buf;
+ uint8_t *buf;
i = find_handle(handle);
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 7fb49c3376..d0a948c401 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -67,7 +67,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
union smb_close cl;
int fnum;
const char *fname = BASEDIR "\\test.txt";
- char c = 1;
+ uint8_t c = 1;
printf("TESTING SESSION HANDLING\n");
@@ -208,7 +208,7 @@ static BOOL test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
union smb_close cl;
int fnum;
const char *fname = BASEDIR "\\test.txt";
- char c = 1;
+ uint8_t c = 1;
printf("TESTING TREE HANDLING\n");
@@ -307,7 +307,7 @@ static BOOL test_pid(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
union smb_close cl;
int fnum;
const char *fname = BASEDIR "\\test.txt";
- char c = 1;
+ uint8_t c = 1;
uint16_t pid1, pid2;
printf("TESTING PID HANDLING\n");
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c
index 547115c9f5..478c0a5a42 100644
--- a/source4/torture/raw/lock.c
+++ b/source4/torture/raw/lock.c
@@ -366,7 +366,7 @@ static BOOL test_pidhigh(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
BOOL ret = True;
int fnum;
const char *fname = BASEDIR "\\test.txt";
- char c = 1;
+ uint8_t c = 1;
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
@@ -598,7 +598,7 @@ static BOOL test_changetype(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char c = 0;
+ uint8_t c = 0;
const char *fname = BASEDIR "\\test.txt";
if (!torture_setup_dir(cli, BASEDIR)) {
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index fe0d4fe4fa..a1cc76ebd8 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -33,7 +33,7 @@ enum rdwr_mode {RDWR_NONE, RDWR_RDONLY, RDWR_WRONLY, RDWR_RDWR};
*/
static enum rdwr_mode check_rdwr(struct smbcli_tree *tree, int fnum)
{
- char c = 1;
+ uint8_t c = 1;
BOOL can_read = (smbcli_read(tree, fnum, &c, 0, 1) == 1);
BOOL can_write = (smbcli_write(tree, fnum, 0, &c, 0, 1) == 1);
if ( can_read && can_write) return RDWR_RDWR;
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index ff6d2baa2b..12818f7ba6 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -50,7 +50,7 @@
/*
setup a random buffer based on a seed
*/
-static void setup_buffer(char *buf, uint_t seed, int len)
+static void setup_buffer(uint8_t *buf, uint_t seed, int len)
{
int i;
srandom(seed);
@@ -60,12 +60,12 @@ static void setup_buffer(char *buf, uint_t seed, int len)
/*
check a random buffer based on a seed
*/
-static BOOL check_buffer(char *buf, uint_t seed, int len, int line)
+static BOOL check_buffer(uint8_t *buf, uint_t seed, int len, int line)
{
int i;
srandom(seed);
for (i=0;i<len;i++) {
- char v = random();
+ uint8_t v = random();
if (buf[i] != v) {
printf("Buffer incorrect at line %d! ofs=%d v1=0x%x v2=0x%x\n",
line, i, buf[i], v);
@@ -84,7 +84,7 @@ static BOOL test_read(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
@@ -208,7 +208,7 @@ static BOOL test_lockread(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
@@ -351,7 +351,7 @@ static BOOL test_readx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
@@ -545,7 +545,7 @@ static BOOL test_readbraw(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
diff --git a/source4/torture/raw/seek.c b/source4/torture/raw/seek.c
index 10b930b18f..716a73b8f7 100644
--- a/source4/torture/raw/seek.c
+++ b/source4/torture/raw/seek.c
@@ -50,7 +50,7 @@ static BOOL test_seek(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
BOOL ret = True;
int fnum, fnum2;
const char *fname = BASEDIR "\\test.txt";
- char c[2];
+ uint8_t c[2];
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 7053f6c998..16c1bee3f1 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -50,7 +50,7 @@ static BOOL check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
{
int fnum;
const char *full_name;
- char *buf;
+ uint8_t *buf;
ssize_t ret;
full_name = talloc_asprintf(mem_ctx, "%s:%s", fname, sname);
diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c
index 7def976b46..06fbe667ea 100644
--- a/source4/torture/raw/write.c
+++ b/source4/torture/raw/write.c
@@ -64,7 +64,7 @@
/*
setup a random buffer based on a seed
*/
-static void setup_buffer(char *buf, uint_t seed, int len)
+static void setup_buffer(uint8_t *buf, uint_t seed, int len)
{
int i;
srandom(seed);
@@ -74,12 +74,12 @@ static void setup_buffer(char *buf, uint_t seed, int len)
/*
check a random buffer based on a seed
*/
-static BOOL check_buffer(char *buf, uint_t seed, int len, const char *location)
+static BOOL check_buffer(uint8_t *buf, uint_t seed, int len, const char *location)
{
int i;
srandom(seed);
for (i=0;i<len;i++) {
- char v = random();
+ uint8_t v = random();
if (buf[i] != v) {
printf("Buffer incorrect at %s! ofs=%d buf=0x%x correct=0x%x\n",
location, i, buf[i], v);
@@ -98,7 +98,7 @@ static BOOL test_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
uint_t seed = time(NULL);
@@ -215,7 +215,7 @@ static BOOL test_writex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum, i;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
uint_t seed = time(NULL);
@@ -391,7 +391,7 @@ static BOOL test_writeunlock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
uint_t seed = time(NULL);
@@ -528,7 +528,7 @@ static BOOL test_writeclose(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NTSTATUS status;
BOOL ret = True;
int fnum;
- char *buf;
+ uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
uint_t seed = time(NULL);
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index af5c9a2f8e..192ec4b64b 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -267,7 +267,7 @@ static BOOL rw_torture(struct smbcli_state *c)
int fnum2;
pid_t pid2, pid = getpid();
int i, j;
- char buf[1024];
+ uint8_t buf[1024];
BOOL correct = True;
fnum2 = smbcli_open(c->tree, lockfname, O_RDWR | O_CREAT | O_EXCL,
@@ -298,13 +298,13 @@ static BOOL rw_torture(struct smbcli_state *c)
break;
}
- if (smbcli_write(c->tree, fnum, 0, (char *)&pid, 0, sizeof(pid)) != sizeof(pid)) {
+ if (smbcli_write(c->tree, fnum, 0, &pid, 0, sizeof(pid)) != sizeof(pid)) {
printf("write failed (%s)\n", smbcli_errstr(c->tree));
correct = False;
}
for (j=0;j<50;j++) {
- if (smbcli_write(c->tree, fnum, 0, (char *)buf,
+ if (smbcli_write(c->tree, fnum, 0, buf,
sizeof(pid)+(j*sizeof(buf)),
sizeof(buf)) != sizeof(buf)) {
printf("write failed (%s)\n", smbcli_errstr(c->tree));
@@ -314,7 +314,7 @@ static BOOL rw_torture(struct smbcli_state *c)
pid2 = 0;
- if (smbcli_read(c->tree, fnum, (char *)&pid2, 0, sizeof(pid)) != sizeof(pid)) {
+ if (smbcli_read(c->tree, fnum, &pid2, 0, sizeof(pid)) != sizeof(pid)) {
printf("read failed (%s)\n", smbcli_errstr(c->tree));
correct = False;
}
@@ -366,8 +366,8 @@ static BOOL rw_torture3(struct smbcli_state *c, const char *lockfname)
{
int fnum = -1;
uint_t i = 0;
- char buf[131072];
- char buf_rd[131072];
+ uint8_t buf[131072];
+ uint8_t buf_rd[131072];
uint_t count;
uint_t countprev = 0;
ssize_t sent = 0;
@@ -597,7 +597,7 @@ static BOOL run_tcon_test(void)
int fnum1;
uint16_t cnum1, cnum2, cnum3;
uint16_t vuid1, vuid2;
- char buf[4];
+ uint8_t buf[4];
BOOL ret = True;
struct smbcli_tree *tree1;
const char *host = lp_parm_string(-1, "torture", "host");
@@ -818,7 +818,7 @@ static BOOL run_fdpasstest(void)
struct smbcli_state *cli1, *cli2;
const char *fname = "\\fdpass.tst";
int fnum1, oldtid;
- pstring buf;
+ uint8_t buf[1024];
if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
return False;
@@ -1284,7 +1284,7 @@ static BOOL run_trans2test(void)
fnum = smbcli_open(cli->tree, fname2,
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
- smbcli_write(cli->tree, fnum, 0, (char *)&fnum, 0, sizeof(fnum));
+ smbcli_write(cli->tree, fnum, 0, &fnum, 0, sizeof(fnum));
smbcli_close(cli->tree, fnum);
if (NT_STATUS_IS_ERR(smbcli_qpathinfo2(cli->tree, "\\trans2\\", &c_time, &a_time, &m_time2, &w_time, &size, NULL, NULL))) {
printf("ERROR: qpathinfo2 failed (%s)\n", smbcli_errstr(cli->tree));
@@ -1536,7 +1536,7 @@ static BOOL run_vuidtest(void)
static struct smbcli_state *cli2;
const char *fname = "\\readonly.file";
int fnum1, fnum2;
- char buf[20];
+ uint8_t buf[20];
size_t fsize;
BOOL correct = True;
char *tmp_path;