summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-10 20:49:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:56:57 -0500
commit307e43bb5628e8b53a930c2928279af994281ba5 (patch)
tree68fa41cf4e697ae94b23cedab5eb7013932fc88d /source4/torture/basic
parent2b3767b1fe7744f0412531e1522e1d5af5dc39c6 (diff)
downloadsamba-307e43bb5628e8b53a930c2928279af994281ba5.tar.gz
samba-307e43bb5628e8b53a930c2928279af994281ba5.tar.bz2
samba-307e43bb5628e8b53a930c2928279af994281ba5.zip
r14173: change smb interface structures to always use
a union smb_file, to abtract - const char *path fot qpathinfo and setpathinfo - uint16_t fnum for SMB - smb2_handle handle for SMB2 the idea is to later add a struct ntvfs_handle *ntvfs so that the ntvfs subsystem don't need to know the difference between SMB and SMB2 metze (This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f)
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/delaywrite.c24
-rw-r--r--source4/torture/basic/delete.c4
-rw-r--r--source4/torture/basic/denytest.c24
-rw-r--r--source4/torture/basic/disconnect.c2
4 files changed, 27 insertions, 27 deletions
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c
index 2c26f21ddc..2a41508bcc 100644
--- a/source4/torture/basic/delaywrite.c
+++ b/source4/torture/basic/delaywrite.c
@@ -54,7 +54,7 @@ static BOOL test_delayed_write_update(struct smbcli_state *cli, TALLOC_CTX *mem_
}
finfo1.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo1.basic_info.in.fnum = fnum1;
+ finfo1.basic_info.file.fnum = fnum1;
finfo2 = finfo1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo1);
@@ -129,7 +129,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
BOOL ret = True;
ssize_t written;
time_t t;
- struct smb_flush flsh;
+ union smb_flush flsh;
printf("Testing delayed update of write time using 2 connections\n");
@@ -148,7 +148,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
}
finfo1.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo1.basic_info.in.fnum = fnum1;
+ finfo1.basic_info.file.fnum = fnum1;
finfo2 = finfo1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo1);
@@ -195,7 +195,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
t = time(NULL);
while (time(NULL) < t+120) {
- finfo2.basic_info.in.fname = fname;
+ finfo2.basic_info.file.path = fname;
status = smb_raw_pathinfo(cli2->tree, mem_ctx, &finfo2);
@@ -223,7 +223,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
/* Now try a write to see if the write time gets reset. */
finfo1.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo1.basic_info.in.fnum = fnum1;
+ finfo1.basic_info.file.fnum = fnum1;
finfo2 = finfo1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo1);
@@ -252,7 +252,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
printf("Doing flush after write\n");
- flsh.in.fnum = fnum1;
+ flsh.flush.file.fnum = fnum1;
status = smb_raw_flush(cli->tree, &flsh);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("smbflush failed: %s\n", nt_errstr(status)));
@@ -330,7 +330,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
}
finfo1.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo1.basic_info.in.fnum = fnum2;
+ finfo1.basic_info.file.fnum = fnum2;
finfo2 = finfo1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo2);
@@ -384,7 +384,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
}
finfo1.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo1.basic_info.in.fnum = fnum1;
+ finfo1.basic_info.file.fnum = fnum1;
finfo2 = finfo1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo1);
@@ -409,7 +409,7 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
}
finfo1.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo1.basic_info.in.fnum = fnum1;
+ finfo1.basic_info.file.fnum = fnum1;
finfo2 = finfo1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo2);
@@ -502,7 +502,7 @@ static BOOL test_finfo_after_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx
}
finfo1.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo1.basic_info.in.fnum = fnum1;
+ finfo1.basic_info.file.fnum = fnum1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo1);
@@ -545,7 +545,7 @@ static BOOL test_finfo_after_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx
}
finfo2.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo2.basic_info.in.fname = fname;
+ finfo2.basic_info.file.path = fname;
status = smb_raw_pathinfo(cli2->tree, mem_ctx, &finfo2);
@@ -598,7 +598,7 @@ static BOOL test_finfo_after_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx
/* This call is only for the people looking at ethereal :-) */
finfo2.basic_info.level = RAW_FILEINFO_BASIC_INFO;
- finfo2.basic_info.in.fname = fname;
+ finfo2.basic_info.file.path = fname;
status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo2);
diff --git a/source4/torture/basic/delete.c b/source4/torture/basic/delete.c
index 606e85a304..6aae6d073b 100644
--- a/source4/torture/basic/delete.c
+++ b/source4/torture/basic/delete.c
@@ -58,7 +58,7 @@ static BOOL check_delete_on_close(struct smbcli_state *cli, int fnum,
int nlink = expect_it ? 0 : 1;
io.all_info.level = RAW_FILEINFO_ALL_INFO;
- io.all_info.in.fnum = fnum;
+ io.all_info.file.fnum = fnum;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &io);
if (!NT_STATUS_IS_OK(status)) {
@@ -83,7 +83,7 @@ static BOOL check_delete_on_close(struct smbcli_state *cli, int fnum,
}
io.standard_info.level = RAW_FILEINFO_STANDARD_INFO;
- io.standard_info.in.fnum = fnum;
+ io.standard_info.file.fnum = fnum;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &io);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 2e68efa4eb..646714a4e9 100644
--- a/source4/torture/basic/denytest.c
+++ b/source4/torture/basic/denytest.c
@@ -1847,20 +1847,20 @@ 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, buf, 0, sizeof(buf)) >= 1) {
+ io2.ntcreatex.file.fnum, buf, 0, sizeof(buf)) >= 1) {
res += A_R;
}
if (smbcli_write(cli2->tree,
- io2.ntcreatex.out.fnum, 0, buf, 0, sizeof(buf)) >= 1) {
+ io2.ntcreatex.file.fnum, 0, buf, 0, sizeof(buf)) >= 1) {
res += A_W;
}
}
if (NT_STATUS_IS_OK(status1)) {
- smbcli_close(cli1->tree, io1.ntcreatex.out.fnum);
+ smbcli_close(cli1->tree, io1.ntcreatex.file.fnum);
}
if (NT_STATUS_IS_OK(status2)) {
- smbcli_close(cli2->tree, io2.ntcreatex.out.fnum);
+ smbcli_close(cli2->tree, io2.ntcreatex.file.fnum);
}
status2_p = predict_share_conflict(io1.ntcreatex.in.share_access,
@@ -2000,11 +2000,11 @@ BOOL torture_denydos_sharing(void)
printf("openx twice with RDWR/DENY_DOS\n");
status = smb_raw_open(cli->tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
- fnum1 = io.openx.out.fnum;
+ fnum1 = io.openx.file.fnum;
status = smb_raw_open(cli->tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
- fnum2 = io.openx.out.fnum;
+ fnum2 = io.openx.file.fnum;
printf("fnum1=%d fnum2=%d\n", fnum1, fnum2);
@@ -2016,12 +2016,12 @@ BOOL torture_denydos_sharing(void)
printf("two handles should be same file handle\n");
finfo.position_information.level = RAW_FILEINFO_POSITION_INFORMATION;
- finfo.position_information.in.fnum = fnum1;
+ finfo.position_information.file.fnum = fnum1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(finfo.position_information.out.position, 1000);
- finfo.position_information.in.fnum = fnum2;
+ finfo.position_information.file.fnum = fnum2;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(finfo.position_information.out.position, 1000);
@@ -2034,12 +2034,12 @@ BOOL torture_denydos_sharing(void)
io.openx.in.open_mode = OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_NONE;
status = smb_raw_open(cli->tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
- fnum1 = io.openx.out.fnum;
+ fnum1 = io.openx.file.fnum;
io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN;
status = smb_raw_open(cli->tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
- fnum2 = io.openx.out.fnum;
+ fnum2 = io.openx.file.fnum;
printf("fnum1=%d fnum2=%d\n", fnum1, fnum2);
@@ -2051,12 +2051,12 @@ BOOL torture_denydos_sharing(void)
CHECK_STATUS(status, NT_STATUS_OK);
finfo.position_information.level = RAW_FILEINFO_POSITION_INFORMATION;
- finfo.position_information.in.fnum = fnum1;
+ finfo.position_information.file.fnum = fnum1;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(finfo.position_information.out.position, 1000);
- finfo.position_information.in.fnum = fnum2;
+ finfo.position_information.file.fnum = fnum2;
status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(finfo.position_information.out.position, 0);
diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c
index 61b1750b92..8ad11ccb6c 100644
--- a/source4/torture/basic/disconnect.c
+++ b/source4/torture/basic/disconnect.c
@@ -96,7 +96,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
}
io.lockx.level = RAW_LOCK_LOCKX;
- io.lockx.in.fnum = fnum;
+ io.lockx.file.fnum = fnum;
io.lockx.in.mode = 0;
io.lockx.in.timeout = 0;
io.lockx.in.lock_cnt = 1;