From: Andrew Tridgell Date: Fri, 24 Aug 2001 04:56:33 +0000 (+0000) Subject: flush on a invalid fsp should give an error X-Git-Tag: samba-2.2.5pre1~1555^2~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef5f4866fbbfa6be07cdc3e612a8899967d48289;p=thirdparty%2Fsamba.git flush on a invalid fsp should give an error --- diff --git a/source/smbd/reply.c b/source/smbd/reply.c index fd4f5d62c08..fca16a2f044 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -2740,24 +2740,24 @@ 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); - files_struct *fsp = file_fsp(inbuf,smb_vwv0); - START_PROFILE(SMBflush); - - if (fsp) { - CHECK_FSP(fsp,conn); - CHECK_ERROR(fsp); - } + int outsize = set_message(outbuf,0,0,True); + files_struct *fsp = file_fsp(inbuf,smb_vwv0); + START_PROFILE(SMBflush); - if (!fsp) { - file_sync_all(conn); - } else { + CHECK_FSP(fsp,conn); + if (fsp) { + CHECK_ERROR(fsp); + } + + if (!fsp) { + file_sync_all(conn); + } else { sync_file(conn,fsp); - } - - DEBUG(3,("flush\n")); - END_PROFILE(SMBflush); - return(outsize); + } + + DEBUG(3,("flush\n")); + END_PROFILE(SMBflush); + return(outsize); }