[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-655-g1e7e7d8

Jeremy Allison jra at samba.org
Fri Apr 4 22:28:45 GMT 2008


The branch, v3-2-test has been updated
       via  1e7e7d86a1ae1cd2c3cc3de9f36b7326ad249b82 (commit)
      from  624371ce32a7c0816963745059e743e5b3e92e2a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 1e7e7d86a1ae1cd2c3cc3de9f36b7326ad249b82
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 4 15:28:14 2008 -0700

    When using plaintext ucs2 passwords clistr_push calls ucs2_align, which causes
    the space taken by the unicode password to be one byte too
    long (as we're on an odd byte boundary here). Reduce the
    count by 1 to cope with this. Fixes smbclient against NetApp
    servers which can't cope. Fix from
    bryan.kolodziej at allenlund.com in bug #3840.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/libsmb/cliconnect.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c
index 8bdc284..4573f39 100644
--- a/source/libsmb/cliconnect.c
+++ b/source/libsmb/cliconnect.c
@@ -247,9 +247,16 @@ static NTSTATUS cli_session_setup_plaintext(struct cli_state *cli,
 		p += clistr_push(cli, p, pass, -1, STR_TERMINATE); /* password */
 		SSVAL(cli->outbuf,smb_vwv7,PTR_DIFF(p, smb_buf(cli->outbuf)));
 	}
-	else { 
+	else {
+		/* For ucs2 passwords clistr_push calls ucs2_align, which causes
+		 * the space taken by the unicode password to be one byte too
+		 * long (as we're on an odd byte boundary here). Reduce the
+		 * count by 1 to cope with this. Fixes smbclient against NetApp
+		 * servers which can't cope. Fix from
+		 * bryan.kolodziej at allenlund.com in bug #3840.
+		 */
 		p += clistr_push(cli, p, pass, -1, STR_UNICODE|STR_TERMINATE); /* unicode password */
-		SSVAL(cli->outbuf,smb_vwv8,PTR_DIFF(p, smb_buf(cli->outbuf)));	
+		SSVAL(cli->outbuf,smb_vwv8,PTR_DIFF(p, smb_buf(cli->outbuf))-1);	
 	}
 	
 	p += clistr_push(cli, p, user, -1, STR_TERMINATE); /* username */
@@ -1033,7 +1040,6 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
 	}
 
 	return NT_STATUS_OK;
-
 }
 
 /****************************************************************************


-- 
Samba Shared Repository


More information about the samba-cvs mailing list