svn commit: samba r24225 - in branches/SAMBA_3_2/source/smbd: .

vlendec at samba.org vlendec at samba.org
Sat Aug 4 20:44:34 GMT 2007


Author: vlendec
Date: 2007-08-04 20:44:33 +0000 (Sat, 04 Aug 2007)
New Revision: 24225

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24225

Log:
Convert reply_flush to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/process.c
   branches/SAMBA_3_2/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/process.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/process.c	2007-08-04 20:28:46 UTC (rev 24224)
+++ branches/SAMBA_3_2/source/smbd/process.c	2007-08-04 20:44:33 UTC (rev 24225)
@@ -693,7 +693,7 @@
 /* 0x02 */ { "SMBopen",reply_open,NULL,AS_USER },
 /* 0x03 */ { "SMBcreate",reply_mknew,NULL,AS_USER},
 /* 0x04 */ { "SMBclose",NULL,reply_close,AS_USER | CAN_IPC },
-/* 0x05 */ { "SMBflush",reply_flush,NULL,AS_USER},
+/* 0x05 */ { "SMBflush",NULL,reply_flush,AS_USER},
 /* 0x06 */ { "SMBunlink",NULL,reply_unlink,AS_USER | NEED_WRITE },
 /* 0x07 */ { "SMBmv",reply_mv,NULL,AS_USER | NEED_WRITE },
 /* 0x08 */ { "SMBgetatr",reply_getatr,NULL,AS_USER},

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/reply.c	2007-08-04 20:28:46 UTC (rev 24224)
+++ branches/SAMBA_3_2/source/smbd/reply.c	2007-08-04 20:44:33 UTC (rev 24225)
@@ -3463,31 +3463,43 @@
  Reply to a flush.
 ****************************************************************************/
 
-int reply_flush(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize)
+void reply_flush(connection_struct *conn, struct smb_request *req)
 {
-	int outsize = set_message(inbuf,outbuf,0,0,False);
-	uint16 fnum = SVAL(inbuf,smb_vwv0);
-	files_struct *fsp = file_fsp(SVAL(inbuf,smb_vwv0));
+	uint16 fnum;
+	files_struct *fsp;
+
 	START_PROFILE(SMBflush);
 
-	if (fnum != 0xFFFF)
-		CHECK_FSP(fsp,conn);
+	if (req->wct < 1) {
+		reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		return;
+	}
+
+	fnum = SVAL(req->inbuf,smb_vwv0);
+	fsp = file_fsp(fnum);
+
+	if ((fnum != 0xFFFF) && !check_fsp(conn, req, fsp, &current_user)) {
+		return;
+	}
 	
 	if (!fsp) {
 		file_sync_all(conn);
 	} else {
 		NTSTATUS status = sync_file(conn, fsp, True);
 		if (!NT_STATUS_IS_OK(status)) {
-			END_PROFILE(SMBflush);
 			DEBUG(5,("reply_flush: sync_file for %s returned %s\n",
 				fsp->fsp_name, nt_errstr(status) ));
-			return ERROR_NT(status);
+			reply_nterror(req, status);
+			END_PROFILE(SMBflush);
+			return;
 		}
 	}
 	
+	reply_outbuf(req, 0, 0);
+
 	DEBUG(3,("flush\n"));
 	END_PROFILE(SMBflush);
-	return(outsize);
+	return;
 }
 
 /****************************************************************************



More information about the samba-cvs mailing list