svn commit: samba r17360 - in branches/SAMBA_4_0/source/smb_server/smb2: .

metze at samba.org metze at samba.org
Tue Aug 1 10:37:34 GMT 2006


Author: metze
Date: 2006-08-01 10:37:34 +0000 (Tue, 01 Aug 2006)
New Revision: 17360

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

Log:
add some comments

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb2/tcon.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb2/tcon.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb2/tcon.c	2006-08-01 10:11:37 UTC (rev 17359)
+++ branches/SAMBA_4_0/source/smb_server/smb2/tcon.c	2006-08-01 10:37:34 UTC (rev 17360)
@@ -49,7 +49,7 @@
 	tid = IVAL(base, offset + 8);
 	pad = IVAL(base, offset + 12);
 
-	if (pad != 0xFFFFFFFF) {
+	if (pad != UINT32_MAX) {
 		return NULL;
 	}
 
@@ -58,7 +58,15 @@
 		return NULL;
 	}
 
-/* TODO: add comments */
+	/*
+	 * the handle can belong to a different tcon
+	 * as that TID in the SMB2 header says, but
+	 * the request should succeed nevertheless!
+	 *
+	 * because if this we put the 32 bit TID into the
+	 * 128 bit handle, so that we can extract the tcon from the
+	 * handle
+	 */
 	tcon = req->tcon;
 	if (tid != req->tcon->tid) {
 		tcon = smbsrv_smb2_tcon_find(req->session, tid, req->request_time);
@@ -72,6 +80,18 @@
 		return NULL;
 	}
 
+	/*
+	 * as the smb2srv_tcon is a child object of the smb2srv_session
+	 * the handle belongs to the correct session!
+	 *
+	 * Note: no check is needed here for SMB2
+	 */
+
+	/*
+	 * as the handle may have overwritten the tcon
+	 * we need to set it on the request so that the
+	 * correct ntvfs context will be used for the ntvfs_*() request
+	 */
 	req->tcon = tcon;
 	return handle->ntvfs;
 }
@@ -86,7 +106,7 @@
 	 */
 	SBVAL(base, offset,	handle->hid);
 	SIVAL(base, offset + 8,	handle->tcon->tid);
-	SIVAL(base, offset + 12,0xFFFFFFFF);
+	SIVAL(base, offset + 12,UINT32_MAX);
 }
 
 static NTSTATUS smb2srv_handle_create_new(void *private_data, struct ntvfs_request *ntvfs, struct ntvfs_handle **_h)



More information about the samba-cvs mailing list