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

vlendec at samba.org vlendec at samba.org
Tue Aug 14 19:09:38 GMT 2007


Author: vlendec
Date: 2007-08-14 19:09:37 +0000 (Tue, 14 Aug 2007)
New Revision: 24428

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

Log:
Convert reply_unlock 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-14 18:52:58 UTC (rev 24427)
+++ branches/SAMBA_3_2/source/smbd/process.c	2007-08-14 19:09:37 UTC (rev 24428)
@@ -703,7 +703,7 @@
 /* 0x0a */ { "SMBread",NULL,reply_read,AS_USER},
 /* 0x0b */ { "SMBwrite",NULL,reply_write,AS_USER | CAN_IPC },
 /* 0x0c */ { "SMBlock",NULL,reply_lock,AS_USER},
-/* 0x0d */ { "SMBunlock",reply_unlock,NULL,AS_USER},
+/* 0x0d */ { "SMBunlock",NULL,reply_unlock,AS_USER},
 /* 0x0e */ { "SMBctemp",NULL,reply_ctemp,AS_USER },
 /* 0x0f */ { "SMBmknew",NULL,reply_mknew,AS_USER},
 /* 0x10 */ { "SMBcheckpath",NULL,reply_checkpath,AS_USER},

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/reply.c	2007-08-14 18:52:58 UTC (rev 24427)
+++ branches/SAMBA_3_2/source/smbd/reply.c	2007-08-14 19:09:37 UTC (rev 24428)
@@ -4033,37 +4033,50 @@
  Reply to a unlock.
 ****************************************************************************/
 
-int reply_unlock(connection_struct *conn, char *inbuf,char *outbuf, int size, 
-		 int dum_buffsize)
+void reply_unlock(connection_struct *conn, struct smb_request *req)
 {
-	int outsize = set_message(inbuf,outbuf,0,0,False);
 	SMB_BIG_UINT count,offset;
 	NTSTATUS status;
-	files_struct *fsp = file_fsp(SVAL(inbuf,smb_vwv0));
+	files_struct *fsp;
+
 	START_PROFILE(SMBunlock);
 
-	CHECK_FSP(fsp,conn);
+	if (req->wct < 5) {
+		reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		END_PROFILE(SMBunlock);
+		return;
+	}
+
+	fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+
+	if (!check_fsp(conn, req, fsp, &current_user)) {
+		END_PROFILE(SMBunlock);
+		return;
+	}
 	
-	count = (SMB_BIG_UINT)IVAL(inbuf,smb_vwv1);
-	offset = (SMB_BIG_UINT)IVAL(inbuf,smb_vwv3);
+	count = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv1);
+	offset = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv3);
 	
 	status = do_unlock(smbd_messaging_context(),
 			fsp,
-			(uint32)SVAL(inbuf,smb_pid),
+			req->smbpid,
 			count,
 			offset,
 			WINDOWS_LOCK);
 
 	if (NT_STATUS_V(status)) {
+		reply_nterror(req, status);
 		END_PROFILE(SMBunlock);
-		return ERROR_NT(status);
+		return;
 	}
 
 	DEBUG( 3, ( "unlock fd=%d fnum=%d offset=%.0f count=%.0f\n",
 		    fsp->fh->fd, fsp->fnum, (double)offset, (double)count ) );
-	
+
+	reply_outbuf(req, 0, 0);
+
 	END_PROFILE(SMBunlock);
-	return(outsize);
+	return;
 }
 
 #undef DBGC_CLASS



More information about the samba-cvs mailing list