r15718: - split the SMBflush with the 0xFFFF wildcard fnum into a different level
[ira/wip.git] / source / smb_server / smb / reply.c
index cfd004304ad347a33beb84a41c30ab3d1b2472cf..768fba13192eb85597d8e6f0aedd3f02c13c02a0 100644 (file)
@@ -1069,13 +1069,21 @@ void smbsrv_reply_lseek(struct smbsrv_request *req)
 void smbsrv_reply_flush(struct smbsrv_request *req)
 {
        union smb_flush *io;
+       uint16_t fnum;
 
        /* parse request */
        SMBSRV_CHECK_WCT(req, 1);
        SMBSRV_TALLOC_IO_PTR(io, union smb_flush);
        SMBSRV_SETUP_NTVFS_REQUEST(reply_simple_send, NTVFS_ASYNC_STATE_MAY_ASYNC);
 
-       io->flush.in.file.fnum = req_fnum(req, req->in.vwv,  VWV(0));
+       fnum = req_fnum(req, req->in.vwv,  VWV(0));
+
+       if (fnum == 0xFFFF) {
+               io->flush_all.level     = RAW_FLUSH_ALL;
+       } else {
+               io->flush.level         = RAW_FLUSH_FLUSH;
+               io->flush.in.file.fnum  = fnum;
+       }
 
        SMBSRV_CALL_NTVFS_BACKEND(ntvfs_flush(req->ntvfs, io));
 }