From 3c028ff88b7f8b4a19a058ee44aeb42c10f4b398 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 15 Oct 2009 18:26:19 +1100 Subject: s4-smb: declare root_fid as a file handle In order to implement root_fid in the s4 SMB server we need to declare it as a handle type, just as for other fnum values in SMB. This required some extensive (but simple) changes in many bits of code. --- source4/torture/basic/base.c | 4 ++-- source4/torture/basic/charset.c | 2 +- source4/torture/basic/denytest.c | 14 +++++++------- source4/torture/basic/disconnect.c | 2 +- source4/torture/basic/unlink.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source4/torture/basic') diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 892ca30bc1..355c569bb3 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -1493,7 +1493,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) io.generic.level = RAW_OPEN_NTCREATEX; io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED; - io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.root_fid.fnum = 0; io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; io.ntcreatex.in.alloc_size = 1024*1024; io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; @@ -1627,7 +1627,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) smbcli_close(cli_nt->tree, fnum); io.generic.level = RAW_OPEN_NTCREATEX; - io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.root_fid.fnum = 0; io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; io.ntcreatex.in.alloc_size = 0; io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c index 5ac299dbbe..2f50376f87 100644 --- a/source4/torture/basic/charset.c +++ b/source4/torture/basic/charset.c @@ -70,7 +70,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx, io.generic.level = RAW_OPEN_NTCREATEX; io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED; - io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.root_fid.fnum = 0; io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; io.ntcreatex.in.alloc_size = 0; io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 0802896d7a..8decf094de 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1768,7 +1768,7 @@ static bool torture_ntdenytest(struct torture_context *tctx, GetTimeOfDay(&tv_start); io1.ntcreatex.level = RAW_OPEN_NTCREATEX; - io1.ntcreatex.in.root_fid = 0; + io1.ntcreatex.in.root_fid.fnum = 0; io1.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED; io1.ntcreatex.in.create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE; io1.ntcreatex.in.file_attr = 0; @@ -2150,6 +2150,7 @@ static void createx_fill_file(union smb_open *open_parms, int accessmode, .open_disposition = NTCREATEX_DISP_OPEN_IF, .create_options = 0, .fname = fname, + .root_fid = { .fnum = 0 }, ); } @@ -2189,7 +2190,7 @@ static bool createx_test_dir(struct torture_context *tctx, .open_disposition = NTCREATEX_DISP_CREATE, .create_options = 0, .fname = CHILD, - .root_fid = fnum, + .root_fid = { .fnum = fnum }, ); result[CXD_DIR_CREATE_CHILD] = @@ -2205,7 +2206,7 @@ static bool createx_test_dir(struct torture_context *tctx, .open_disposition = NTCREATEX_DISP_OPEN, .create_options = 0, .fname = KNOWN, - .root_fid = fnum, + .root_fid = {.fnum = fnum}, ); result[CXD_DIR_TRAVERSE] = @@ -2231,14 +2232,14 @@ static bool createx_test_file(struct torture_context *tctx, rd.readx.in.file.fnum = fnum; rd.readx.in.mincnt = sizeof(buf); rd.readx.in.maxcnt = sizeof(buf); - rd.readx.out.data = buf; + rd.readx.out.data = (uint8_t *)buf; result[CXD_FILE_READ] = smb_raw_read(tree, &rd); wr.writex.level = RAW_WRITE_WRITEX; wr.writex.in.file.fnum = fnum; wr.writex.in.count = sizeof(buf); - wr.writex.in.data = buf; + wr.writex.in.data = (uint8_t *)buf; result[CXD_FILE_WRITE] = smb_raw_write(tree, &wr); @@ -2248,7 +2249,7 @@ static bool createx_test_file(struct torture_context *tctx, rd.readx.in.mincnt = sizeof(buf); rd.readx.in.maxcnt = sizeof(buf); rd.readx.in.read_for_execute = 1; - rd.readx.out.data = buf; + rd.readx.out.data = (uint8_t *)buf; result[CXD_FILE_EXECUTE] = smb_raw_read(tree, &rd); @@ -2580,7 +2581,6 @@ bool torture_createx_access(struct torture_context *tctx, torture_createx_specific(tctx, cli, NULL, mem_ctx, &cxd, est); } - for (i = 0; i < num_access_bits; i++) { /* And now run through the single access bits. */ cxd.cxd_access1 = 1 << i; diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 89e05d6839..0de0910512 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -49,7 +49,7 @@ static bool test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("trying open/disconnect\n"); io.generic.level = RAW_OPEN_NTCREATEX; - io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.root_fid.fnum = 0; io.ntcreatex.in.flags = 0; io.ntcreatex.in.access_mask = SEC_FILE_READ_DATA; io.ntcreatex.in.create_options = 0; diff --git a/source4/torture/basic/unlink.c b/source4/torture/basic/unlink.c index 9e13021d20..5d0e4f6964 100644 --- a/source4/torture/basic/unlink.c +++ b/source4/torture/basic/unlink.c @@ -65,7 +65,7 @@ bool torture_unlinktest(struct torture_context *tctx, struct smbcli_state *cli) torture_comment(tctx, "testing unlink after ntcreatex with DELETE access\n"); io.ntcreatex.level = RAW_OPEN_NTCREATEX; - io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.root_fid.fnum = 0; io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED; io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE; io.ntcreatex.in.file_attr = 0; -- cgit