summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-05 18:22:57 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-07 08:32:42 +0200
commitfbcba9fa8ff3d8b091016ed4e7d60a30703af50c (patch)
tree2cf1d4d178d788d8928dff3f52264e251227730f /source3/libsmb
parentb57fb1e1a4ec286940f1d165f360af62278e5a8f (diff)
downloadsamba-fbcba9fa8ff3d8b091016ed4e7d60a30703af50c.tar.gz
samba-fbcba9fa8ff3d8b091016ed4e7d60a30703af50c.tar.bz2
samba-fbcba9fa8ff3d8b091016ed4e7d60a30703af50c.zip
s3:smb2cli: SMB2_QUERY_DIRECTORY needs one dyn byte to that the structure size check works.
Windows generates NT_STATUS_INVALID_PARAMETER otherwise. metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/smb2cli_query_directory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/libsmb/smb2cli_query_directory.c b/source3/libsmb/smb2cli_query_directory.c
index 3feaa07abb..2286f2ce6f 100644
--- a/source3/libsmb/smb2cli_query_directory.c
+++ b/source3/libsmb/smb2cli_query_directory.c
@@ -27,6 +27,7 @@
struct smb2cli_query_directory_state {
uint8_t fixed[32];
+ uint8_t dyn_pad[1];
struct iovec *recv_iov;
uint8_t *data;
uint32_t data_length;
@@ -75,6 +76,11 @@ struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
SSVAL(fixed, 26, dyn_len);
SSVAL(fixed, 28, outbuf_len);
+ if (dyn_len == 0) {
+ dyn = state->dyn_pad;
+ dyn_len = sizeof(state->dyn_pad);
+ }
+
subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_FIND,
0, 0, /* flags */
cli->smb2.pid,