summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-07-12 14:25:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:10:06 -0500
commita8958391e8fd9ddd996d2d3aff7ddeed3243fc1f (patch)
tree617c2420c90d475b05bb3b3894feb2914fbed393 /source4/smb_server/smb
parente6b29409a29bdf99c45b2c0aefecb321904f2fd3 (diff)
downloadsamba-a8958391e8fd9ddd996d2d3aff7ddeed3243fc1f.tar.gz
samba-a8958391e8fd9ddd996d2d3aff7ddeed3243fc1f.tar.bz2
samba-a8958391e8fd9ddd996d2d3aff7ddeed3243fc1f.zip
r16980: - make struct smb_notify a union and add levels RAW_NOTIFY_NTTRANS,RAW_NOTIFY_SMB2
- parse SMB2 Notify reponse metze (This used to be commit de50e0ccddfad16ad7b254770f4c52c1abe707b9)
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r--source4/smb_server/smb/nttrans.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c
index 3bc0ab69b2..fce4fdc129 100644
--- a/source4/smb_server/smb/nttrans.c
+++ b/source4/smb_server/smb/nttrans.c
@@ -345,7 +345,7 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req,
*/
static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
{
- struct smb_notify *info = talloc_get_type(op->op_info, struct smb_notify);
+ union smb_notify *info = talloc_get_type(op->op_info, union smb_notify);
size_t size = 0;
int i;
NTSTATUS status;
@@ -353,8 +353,8 @@ static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
#define MAX_BYTES_PER_CHAR 3
/* work out how big the reply buffer could be */
- for (i=0;i<info->out.num_changes;i++) {
- size += 12 + 3 + (1+strlen(info->out.changes[i].name.s)) * MAX_BYTES_PER_CHAR;
+ for (i=0;i<info->nttrans.out.num_changes;i++) {
+ size += 12 + 3 + (1+strlen(info->nttrans.out.changes[i].name.s)) * MAX_BYTES_PER_CHAR;
}
status = nttrans_setup_reply(op, op->trans, size, 0, 0);
@@ -362,16 +362,16 @@ static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
p = op->trans->out.params.data;
/* construct the changes buffer */
- for (i=0;i<info->out.num_changes;i++) {
+ for (i=0;i<info->nttrans.out.num_changes;i++) {
uint32_t ofs;
ssize_t len;
- SIVAL(p, 4, info->out.changes[i].action);
- len = push_string(p + 12, info->out.changes[i].name.s,
+ SIVAL(p, 4, info->nttrans.out.changes[i].action);
+ len = push_string(p + 12, info->nttrans.out.changes[i].name.s,
op->trans->out.params.length -
(p+12 - op->trans->out.params.data), STR_UNICODE);
SIVAL(p, 8, len);
-
+
ofs = len + 12;
if (ofs & 3) {
@@ -380,7 +380,7 @@ static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
ofs += pad;
}
- if (i == info->out.num_changes-1) {
+ if (i == info->nttrans.out.num_changes-1) {
SIVAL(p, 0, 0);
} else {
SIVAL(p, 0, ofs);
@@ -401,25 +401,26 @@ static NTSTATUS nttrans_notify_change(struct smbsrv_request *req,
struct nttrans_op *op)
{
struct smb_nttrans *trans = op->trans;
- struct smb_notify *info;
+ union smb_notify *info;
/* should have at least 4 setup words */
if (trans->in.setup_count != 4) {
return NT_STATUS_INVALID_PARAMETER;
}
- info = talloc(op, struct smb_notify);
+ info = talloc(op, union smb_notify);
NT_STATUS_HAVE_NO_MEMORY(info);
- info->in.completion_filter = IVAL(trans->in.setup, 0);
- info->in.file.ntvfs = smbsrv_pull_fnum(req, (uint8_t *)trans->in.setup, 4);
- info->in.recursive = SVAL(trans->in.setup, 6);
- info->in.buffer_size = trans->in.max_param;
+ info->nttrans.level = RAW_NOTIFY_NTTRANS;
+ info->nttrans.in.completion_filter = IVAL(trans->in.setup, 0);
+ info->nttrans.in.file.ntvfs = smbsrv_pull_fnum(req, (uint8_t *)trans->in.setup, 4);
+ info->nttrans.in.recursive = SVAL(trans->in.setup, 6);
+ info->nttrans.in.buffer_size = trans->in.max_param;
op->op_info = info;
op->send_fn = nttrans_notify_change_send;
-
- SMBSRV_CHECK_FILE_HANDLE_NTSTATUS(info->in.file.ntvfs);
+
+ SMBSRV_CHECK_FILE_HANDLE_NTSTATUS(info->nttrans.in.file.ntvfs);
return ntvfs_notify(req->ntvfs, info);
}