From c0236e8ae32af5480b14ac57677dc983e786d3d5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 19 Aug 2003 01:26:43 +0000 Subject: Fix flush of 0xFFFF - found by Samba4 tester. Jeremy. (This used to be commit 8a5c97fa07eacd4cecb5afd9c197352dfa613b9f) --- source3/smbd/reply.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 32b9c39aed..9577375475 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2367,10 +2367,12 @@ int reply_lseek(connection_struct *conn, char *inbuf,char *outbuf, int size, int int reply_flush(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize) { int outsize = set_message(outbuf,0,0,True); + uint16 fnum = SVAL(inbuf,smb_vwv0); files_struct *fsp = file_fsp(inbuf,smb_vwv0); START_PROFILE(SMBflush); - CHECK_FSP(fsp,conn); + if (fnum != 0xFFFF) + CHECK_FSP(fsp,conn); if (!fsp) { file_sync_all(conn); @@ -2737,7 +2739,7 @@ int reply_printclose(connection_struct *conn, if (!CAN_PRINT(conn)) { END_PROFILE(SMBsplclose); - return ERROR_DOS(ERRDOS,ERRnoaccess); + return ERROR_NT(NT_STATUS_UNSUCCESSFUL); } DEBUG(3,("printclose fd=%d fnum=%d\n", -- cgit