summaryrefslogtreecommitdiff
path: root/source3/torture/scanner.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-04-30 15:26:43 -0700
committerJeremy Allison <jra@samba.org>2009-04-30 15:26:43 -0700
commit8cf78ff55312768d0b454b1d7e0560e04e6296da (patch)
tree0a2180f063e3bb9872c2565c92075dfb5dccac81 /source3/torture/scanner.c
parentab4b8c9c0438bc5afca17e3ebf05dde6f98bc0aa (diff)
downloadsamba-8cf78ff55312768d0b454b1d7e0560e04e6296da.tar.gz
samba-8cf78ff55312768d0b454b1d7e0560e04e6296da.tar.bz2
samba-8cf78ff55312768d0b454b1d7e0560e04e6296da.zip
Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
Convert all uses of cli_open(), cli_nt_createXXX to NTSTATUS versions. This is smaller than it looks, it just fixes a lot of old code. Next up, ensure all cli_XX functions return NTSTATUS. Jeremy.
Diffstat (limited to 'source3/torture/scanner.c')
-rw-r--r--source3/torture/scanner.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/torture/scanner.c b/source3/torture/scanner.c
index 3e9a24f121..e42e80abca 100644
--- a/source3/torture/scanner.c
+++ b/source3/torture/scanner.c
@@ -194,7 +194,7 @@ bool torture_trans2_scan(int dummy)
static struct cli_state *cli;
int op, level;
const char *fname = "\\scanner.dat";
- int fnum, dnum;
+ uint16_t fnum, dnum;
printf("starting trans2 scan test\n");
@@ -202,9 +202,15 @@ bool torture_trans2_scan(int dummy)
return False;
}
- fnum = cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
- DENY_NONE);
- dnum = cli_open(cli, "\\", O_RDONLY, DENY_NONE);
+ if (!NT_STATUS_IS_OK(cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
+ DENY_NONE, &fnum))) {
+ printf("open of %s failed\n", fname);
+ return false;
+ }
+ if (!NT_STATUS_IS_OK(cli_open(cli, "\\", O_RDONLY, DENY_NONE, &dnum))) {
+ printf("open of \\ failed\n");
+ return false;
+ }
for (op=OP_MIN; op<=OP_MAX; op++) {
printf("Scanning op=%d\n", op);
@@ -396,7 +402,7 @@ bool torture_nttrans_scan(int dummy)
static struct cli_state *cli;
int op, level;
const char *fname = "\\scanner.dat";
- int fnum, dnum;
+ uint16_t fnum, dnum;
printf("starting nttrans scan test\n");
@@ -404,9 +410,9 @@ bool torture_nttrans_scan(int dummy)
return False;
}
- fnum = cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
- DENY_NONE);
- dnum = cli_open(cli, "\\", O_RDONLY, DENY_NONE);
+ cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
+ DENY_NONE, &fnum);
+ cli_open(cli, "\\", O_RDONLY, DENY_NONE, &dnum);
for (op=OP_MIN; op<=OP_MAX; op++) {
printf("Scanning op=%d\n", op);