summaryrefslogtreecommitdiff
path: root/source3/torture/torture.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-02-20 22:45:49 +0000
committerJeremy Allison <jra@samba.org>2004-02-20 22:45:49 +0000
commite5c79dd79eb86c4fa790cd919056ed0fca3c73c1 (patch)
tree72ec68b277d90b4cdecf39767123fa8e41cbc7d2 /source3/torture/torture.c
parent9138aa18eb66d2c54cd0736c5e25800868c274f5 (diff)
downloadsamba-e5c79dd79eb86c4fa790cd919056ed0fca3c73c1.tar.gz
samba-e5c79dd79eb86c4fa790cd919056ed0fca3c73c1.tar.bz2
samba-e5c79dd79eb86c4fa790cd919056ed0fca3c73c1.zip
Make us bug-for-bug compatible with W2K3 - to get delete on close semantics
on an initial open the desired_access field *must* contain DELETE_ACCESS, simply having it map from a GENERIC_ALL won't do. Fixes delete on close test. Jeremy. (This used to be commit fb4249e7d12bee4589edff40f1e76f1a19a6ffaa)
Diffstat (limited to 'source3/torture/torture.c')
-rw-r--r--source3/torture/torture.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 9d0a6bb79e..e612ddea92 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -2493,19 +2493,19 @@ static BOOL run_trans2test(int dummy)
static BOOL new_trans(struct cli_state *pcli, int fnum, int level)
{
- char buf[4096];
+ char *buf = NULL;
+ uint32 len;
BOOL correct = True;
- memset(buf, 0xff, sizeof(buf));
-
- if (!cli_qfileinfo_test(pcli, fnum, level, buf)) {
+ if (!cli_qfileinfo_test(pcli, fnum, level, &buf, &len)) {
printf("ERROR: qfileinfo (%d) failed (%s)\n", level, cli_errstr(pcli));
correct = False;
} else {
- printf("qfileinfo: level %d\n", level);
- dump_data(0, buf, 256);
+ printf("qfileinfo: level %d, len = %u\n", level, len);
+ dump_data(0, buf, len);
printf("\n");
}
+ SAFE_FREE(buf);
return correct;
}
@@ -2812,8 +2812,8 @@ static BOOL run_deletetest(int dummy)
cli_setatr(cli1, fname, 0, 0);
cli_unlink(cli1, fname);
- fnum1 = cli_nt_create_full(cli1, fname, 0, GENERIC_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL,
- FILE_SHARE_DELETE, FILE_OVERWRITE_IF,
+ fnum1 = cli_nt_create_full(cli1, fname, 0, GENERIC_ALL_ACCESS|DELETE_ACCESS, FILE_ATTRIBUTE_NORMAL,
+ 0, FILE_OVERWRITE_IF,
FILE_DELETE_ON_CLOSE, 0);
if (fnum1 == -1) {
@@ -2821,7 +2821,15 @@ static BOOL run_deletetest(int dummy)
correct = False;
goto fail;
}
-
+
+#if 0
+ {
+ uint32 accinfo = 0;
+ cli_qfileinfo_test(cli1, fnum1, SMB_FILE_ACCESS_INFORMATION, (char *)&accinfo);
+ printf("access mode = 0x%lx\n", accinfo);
+ }
+#endif
+
if (!cli_close(cli1, fnum1)) {
printf("[1] close failed (%s)\n", cli_errstr(cli1));
correct = False;