summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-17 09:52:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:04 -0500
commit5ff4b74df3f32192c9828233295d9f8fedcceb23 (patch)
treeda62feda7a25e882b41fb99c6a0949a08f44d0db /source4
parentd86da81304bc247c77b78f1f1d9da562168285d7 (diff)
downloadsamba-5ff4b74df3f32192c9828233295d9f8fedcceb23.tar.gz
samba-5ff4b74df3f32192c9828233295d9f8fedcceb23.tar.xz
samba-5ff4b74df3f32192c9828233295d9f8fedcceb23.zip
r15656: for NT IOCTL's we need to control the max_data field for some calls
metze (This used to be commit 3cab02f6f513cf7eb3d8863e62952766bb4d908f)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/raw/interfaces.h1
-rw-r--r--source4/libcli/raw/rawioctl.c2
-rw-r--r--source4/smb_server/smb/nttrans.c1
-rw-r--r--source4/torture/raw/ioctl.c4
4 files changed, 6 insertions, 2 deletions
diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h
index e0696b45ec7..d98b5de3708 100644
--- a/source4/libcli/raw/interfaces.h
+++ b/source4/libcli/raw/interfaces.h
@@ -1716,6 +1716,7 @@ union smb_ioctl {
uint32_t function;
BOOL fsctl;
uint8_t filter;
+ uint32_t max_data;
DATA_BLOB blob;
} in;
struct {
diff --git a/source4/libcli/raw/rawioctl.c b/source4/libcli/raw/rawioctl.c
index 77c8c801588..356852edd86 100644
--- a/source4/libcli/raw/rawioctl.c
+++ b/source4/libcli/raw/rawioctl.c
@@ -77,7 +77,7 @@ static struct smbcli_request *smb_raw_ntioctl_send(struct smbcli_tree *tree,
nt.in.max_setup = 0;
nt.in.max_param = 0;
- nt.in.max_data = 0;
+ nt.in.max_data = parms->ntioctl.in.max_data;
nt.in.setup_count = 4;
nt.in.setup = (uint16_t *)setup;
SIVAL(setup, 0, parms->ntioctl.in.function);
diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c
index 91545466939..0ac9c005c7e 100644
--- a/source4/smb_server/smb/nttrans.c
+++ b/source4/smb_server/smb/nttrans.c
@@ -324,6 +324,7 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req,
nt->ntioctl.in.function = function;
nt->ntioctl.in.fsctl = fsctl;
nt->ntioctl.in.filter = filter;
+ nt->ntioctl.in.max_data = trans->in.max_data;
nt->ntioctl.in.blob = trans->in.data;
status = nttrans_setup_reply(op, trans, 0, 0, 1);
diff --git a/source4/torture/raw/ioctl.c b/source4/torture/raw/ioctl.c
index cd930475761..dd100e107d1 100644
--- a/source4/torture/raw/ioctl.c
+++ b/source4/torture/raw/ioctl.c
@@ -105,6 +105,7 @@ static BOOL test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
nt.ntioctl.in.file.fnum = fnum;
nt.ntioctl.in.fsctl = True;
nt.ntioctl.in.filter = 0;
+ nt.ntioctl.in.max_data = 0;
nt.ntioctl.in.blob = data_blob(NULL, 0);
status = smb_raw_ioctl(cli->tree, mem_ctx, &nt);
@@ -112,10 +113,11 @@ static BOOL test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("trying batch oplock\n");
nt.ioctl.level = RAW_IOCTL_NTIOCTL;
- nt.ntioctl.in.function = (FSCTL_FILESYSTEM | (2<<2));
+ nt.ntioctl.in.function = FSCTL_REQUEST_BATCH_OPLOCK;
nt.ntioctl.in.file.fnum = fnum;
nt.ntioctl.in.fsctl = True;
nt.ntioctl.in.filter = 0;
+ nt.ntioctl.in.max_data = 0;
nt.ntioctl.in.blob = data_blob(NULL, 0);
status = smb_raw_ioctl(cli->tree, mem_ctx, &nt);