svn commit: linux-cifs-client r68 - in branches/linux-2.6-cifs-git-devel/fs/cifs: .

sfrench at samba.org sfrench at samba.org
Fri Aug 11 22:04:46 GMT 2006


Author: sfrench
Date: 2006-08-11 22:04:45 +0000 (Fri, 11 Aug 2006)
New Revision: 68

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=linux-cifs-client&rev=68

Log:
Merge with cifs git tree  (and minor tweak to jra's earlier patch to shrink it by
not altering header_assemble)

Modified:
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifsencrypt.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifsproto.h
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/misc.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/transport.c


Changeset:
Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/cifsencrypt.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/cifsencrypt.c	2006-07-29 00:17:01 UTC (rev 67)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/cifsencrypt.c	2006-08-11 22:04:45 UTC (rev 68)
@@ -277,7 +277,8 @@
 		return;
 
 	memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
-	strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE);
+	if(ses->password)
+		strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE);
 
 	if((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0)
 		if(extended_security & CIFSSEC_MAY_PLNTXT) {

Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/cifsproto.h
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/cifsproto.h	2006-07-29 00:17:01 UTC (rev 67)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/cifsproto.h	2006-08-11 22:04:45 UTC (rev 68)
@@ -66,9 +66,8 @@
 extern int cifs_inet_pton(int, char * source, void *dst);
 extern int map_smb_to_linux_error(struct smb_hdr *smb);
 extern void header_assemble(struct smb_hdr *, char /* command */ ,
-			    const struct cifsTconInfo *,
-			    __u16 mid,
-			    int /* length of fixed section (word count) in two byte units */);
+			    const struct cifsTconInfo *, int /* length of
+			    fixed section (word count) in two byte units */);
 extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
 				struct cifsSesInfo *ses,
 				void ** request_buf);

Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c	2006-07-29 00:17:01 UTC (rev 67)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c	2006-08-11 22:04:45 UTC (rev 68)
@@ -201,8 +201,7 @@
 		return -ENOMEM;
 	}
 
-	header_assemble((struct smb_hdr *) *request_buf, smb_command, tcon,
-		tcon ? GetNextMid(tcon->ses->server) : 0, wct);
+	header_assemble((struct smb_hdr *) *request_buf, smb_command, tcon,wct);
 
         if(tcon != NULL)
                 cifs_stats_inc(&tcon->num_smbs_sent);
@@ -346,7 +345,7 @@
 		*response_buf = *request_buf; 
 
 	header_assemble((struct smb_hdr *) *request_buf, smb_command, tcon,
-			tcon ? GetNextMid(tcon->ses->server) : 0, wct /*wct */ );
+			wct /*wct */ );
 
         if(tcon != NULL)
                 cifs_stats_inc(&tcon->num_smbs_sent);

Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c	2006-07-29 00:17:01 UTC (rev 67)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c	2006-08-11 22:04:45 UTC (rev 68)
@@ -182,6 +182,7 @@
 
 	while ((server->tcpStatus != CifsExiting) && (server->tcpStatus != CifsGood))
 	{
+		try_to_freeze();
 		if(server->protocolType == IPV6) {
 			rc = ipv6_connect(&server->addr.sockAddr6,&server->ssocket);
 		} else {
@@ -2042,8 +2043,9 @@
 
 	/* send SMBsessionSetup here */
 	header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX,
-			NULL /* no tCon exists yet */ , GetNextMid(ses->server), 13 /* wct */ );
+			NULL /* no tCon exists yet */ , 13 /* wct */ );
 
+	smb_buffer->Mid = GetNextMid(ses->server);
 	pSMB->req_no_secext.AndXCommand = 0xFF;
 	pSMB->req_no_secext.MaxBufferSize = cpu_to_le16(ses->server->maxBuf);
 	pSMB->req_no_secext.MaxMpxCount = cpu_to_le16(ses->server->maxReq);
@@ -2334,8 +2336,9 @@
 
 	/* send SMBsessionSetup here */
 	header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX,
-			NULL /* no tCon exists yet */ , GetNextMid(ses->server), 12 /* wct */ );
+			NULL /* no tCon exists yet */ , 12 /* wct */ );
 
+	smb_buffer->Mid = GetNextMid(ses->server);
 	pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
 	pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT);
 
@@ -2667,8 +2670,9 @@
 
 	/* send SMBsessionSetup here */
 	header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX,
-			NULL /* no tCon exists yet */ , GetNextMid(ses->server), 12 /* wct */ );
+			NULL /* no tCon exists yet */ , 12 /* wct */ );
 
+	smb_buffer->Mid = GetNextMid(ses->server);
 	pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT);
 	pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
 	pSMB->req.AndXCommand = 0xFF;
@@ -3055,8 +3059,9 @@
 	smb_buffer_response = smb_buffer;
 
 	header_assemble(smb_buffer, SMB_COM_TREE_CONNECT_ANDX,
-			NULL /*no tid */ , GetNextMid(ses->server), 4 /*wct */ );
+			NULL /*no tid */ , 4 /*wct */ );
 
+	smb_buffer->Mid = GetNextMid(ses->server);
 	smb_buffer->Uid = ses->Suid;
 	pSMB = (TCONX_REQ *) smb_buffer;
 	pSMBr = (TCONX_RSP *) smb_buffer_response;

Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/misc.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/misc.c	2006-07-29 00:17:01 UTC (rev 67)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/misc.c	2006-08-11 22:04:45 UTC (rev 68)
@@ -291,7 +291,7 @@
    case it is responsbility of caller to set the mid */
 void
 header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
-		const struct cifsTconInfo *treeCon, __u16 mid, int word_count
+		const struct cifsTconInfo *treeCon, int word_count
 		/* length of fixed section (word count) in two byte units  */)
 {
 	struct list_head* temp_item;
@@ -316,7 +316,6 @@
 	buffer->Flags2 = SMBFLG2_KNOWS_LONG_NAMES;
 	buffer->Pid = cpu_to_le16((__u16)current->tgid);
 	buffer->PidHigh = cpu_to_le16((__u16)(current->tgid >> 16));
-	buffer->Mid = mid;
 	spin_lock(&GlobalMid_Lock);
 	spin_unlock(&GlobalMid_Lock);
 	if (treeCon) {
@@ -329,6 +328,7 @@
 			}
 			/* Uid is not converted */
 			buffer->Uid = treeCon->ses->Suid;
+			buffer->Mid = GetNextMid(treeCon->ses->server);
 			if(multiuser_mount != 0) {
 		/* For the multiuser case, there are few obvious technically  */
 		/* possible mechanisms to match the local linux user (uid)    */

Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/transport.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/transport.c	2006-07-29 00:17:01 UTC (rev 67)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/transport.c	2006-08-11 22:04:45 UTC (rev 68)
@@ -781,8 +781,10 @@
 {
 	int rc = 0;
 	struct cifsSesInfo *ses = tcon->ses;
+	__u16 mid = in_buf->Mid;
 
-	header_assemble(in_buf, SMB_COM_NT_CANCEL, tcon, in_buf->Mid, 0);
+	header_assemble(in_buf, SMB_COM_NT_CANCEL, tcon, 0);
+	in_buf->Mid = mid;
 	down(&ses->server->tcpSem); 
 	rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);
 	if (rc) {



More information about the samba-cvs mailing list