flush on a invalid fsp should give an error
authorAndrew Tridgell <tridge@samba.org>
Fri, 24 Aug 2001 04:56:33 +0000 (04:56 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 24 Aug 2001 04:56:33 +0000 (04:56 +0000)
source/smbd/reply.c

index fd4f5d62c08e62cba7acf3f7932bbe5707bdc3c0..fca16a2f0442b16e48e08d43c9ccad05155ee06f 100644 (file)
@@ -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);
 }