summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb2/fileio.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-20 18:57:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:15 -0500
commit49012954d055f2b7ed5a796f767e5c0535d80558 (patch)
tree6f407a8264f21c34703cba961349c9b28d627805 /source4/smb_server/smb2/fileio.c
parent772c4928404bc26e5cc7cfdcba1f931ee0d0de82 (diff)
downloadsamba-49012954d055f2b7ed5a796f767e5c0535d80558.tar.gz
samba-49012954d055f2b7ed5a796f767e5c0535d80558.tar.bz2
samba-49012954d055f2b7ed5a796f767e5c0535d80558.zip
r15758: - handle RAW_FLUSH_SMB2 in the posix ntvfs backend
- Implement SMB2 Flush metze (This used to be commit 41d87ebe355cd34d35a93d1e90cd2680363cb5d3)
Diffstat (limited to 'source4/smb_server/smb2/fileio.c')
-rw-r--r--source4/smb_server/smb2/fileio.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/source4/smb_server/smb2/fileio.c b/source4/smb_server/smb2/fileio.c
index 2b25cf0af1..e46a42c2d8 100644
--- a/source4/smb_server/smb2/fileio.c
+++ b/source4/smb_server/smb2/fileio.c
@@ -117,9 +117,35 @@ void smb2srv_close_recv(struct smb2srv_request *req)
SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_close(req->ntvfs, io));
}
+static void smb2srv_flush_send(struct ntvfs_request *ntvfs)
+{
+ struct smb2srv_request *req;
+ union smb_flush *io;
+
+ SMB2SRV_CHECK_ASYNC_STATUS(io, union smb_flush);
+ SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x04, False, 0));
+
+ SSVAL(req->out.body, 0x02, 0);
+
+ smb2srv_send_reply(req);
+}
+
void smb2srv_flush_recv(struct smb2srv_request *req)
{
- smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED);
+ union smb_flush *io;
+ uint16_t _pad;
+
+ SMB2SRV_CHECK_BODY_SIZE(req, 0x18, False);
+ SMB2SRV_TALLOC_IO_PTR(io, union smb_flush);
+ SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_flush_send, NTVFS_ASYNC_STATE_MAY_ASYNC);
+
+ io->smb2.level = RAW_FLUSH_SMB2;
+ _pad = SVAL(req->in.body, 0x02);
+ io->smb2.in.unknown = IVAL(req->in.body, 0x04);
+ io->smb2.in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x08);
+
+ SMB2SRV_CHECK_FILE_HANDLE(io->smb2.in.file.ntvfs);
+ SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_flush(req->ntvfs, io));
}
void smb2srv_read_recv(struct smb2srv_request *req)