diff options
author | Steve French <sfrench@us.ibm.com> | 2006-06-27 15:50:57 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-06-27 15:50:57 -0400 |
commit | 0223cf0b10bdb3b557d8884b1a957cc64be843c3 (patch) | |
tree | fb4247a30b8df1fd00e9cab04132795e826fa83a /fs/cifs | |
parent | 750d1151a6c95ef9b9a188bb7cff6b80ee30da17 (diff) |
[CIFS] Fix alignment of unicode strings in previous patch
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/sess.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 7737edd1baf1..b7d49c03985c 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -83,11 +83,11 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, | |||
83 | /* BB FIXME add check that strings total less | 83 | /* BB FIXME add check that strings total less |
84 | than 335 or will need to send them as arrays */ | 84 | than 335 or will need to send them as arrays */ |
85 | 85 | ||
86 | /* align unicode strings, must be word aligned */ | 86 | /* unicode strings, must be word aligned before the call */ |
87 | if ((long) bcc_ptr % 2) { | 87 | /* if ((long) bcc_ptr % 2) { |
88 | *bcc_ptr = 0; | 88 | *bcc_ptr = 0; |
89 | bcc_ptr++; | 89 | bcc_ptr++; |
90 | } | 90 | } */ |
91 | /* copy user */ | 91 | /* copy user */ |
92 | if(ses->userName == NULL) { | 92 | if(ses->userName == NULL) { |
93 | /* BB what about null user mounts - check that we do this BB */ | 93 | /* BB what about null user mounts - check that we do this BB */ |
@@ -416,9 +416,14 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, | |||
416 | bcc_ptr += CIFS_SESS_KEY_SIZE; | 416 | bcc_ptr += CIFS_SESS_KEY_SIZE; |
417 | memcpy(bcc_ptr, (char *)ntlm_session_key,CIFS_SESS_KEY_SIZE); | 417 | memcpy(bcc_ptr, (char *)ntlm_session_key,CIFS_SESS_KEY_SIZE); |
418 | bcc_ptr += CIFS_SESS_KEY_SIZE; | 418 | bcc_ptr += CIFS_SESS_KEY_SIZE; |
419 | if(ses->capabilities & CAP_UNICODE) | 419 | if(ses->capabilities & CAP_UNICODE) { |
420 | /* unicode strings must be word aligned */ | ||
421 | if (iov[0].iov_len % 2) { | ||
422 | *bcc_ptr = 0; | ||
423 | bcc_ptr++; | ||
424 | } | ||
420 | unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); | 425 | unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); |
421 | else | 426 | } else |
422 | ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); | 427 | ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); |
423 | } else if (type == NTLMv2) { | 428 | } else if (type == NTLMv2) { |
424 | char * v2_sess_key = | 429 | char * v2_sess_key = |
@@ -455,9 +460,12 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, | |||
455 | memcpy(bcc_ptr, (char *)v2_sess_key, sizeof(struct ntlmv2_resp)); | 460 | memcpy(bcc_ptr, (char *)v2_sess_key, sizeof(struct ntlmv2_resp)); |
456 | bcc_ptr += sizeof(struct ntlmv2_resp); | 461 | bcc_ptr += sizeof(struct ntlmv2_resp); |
457 | kfree(v2_sess_key); | 462 | kfree(v2_sess_key); |
458 | if(ses->capabilities & CAP_UNICODE) | 463 | if(ses->capabilities & CAP_UNICODE) { |
464 | if(iov[0].iov_len % 2) { | ||
465 | *bcc_ptr = 0; | ||
466 | } bcc_ptr++; | ||
459 | unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); | 467 | unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); |
460 | else | 468 | } else |
461 | ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); | 469 | ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); |
462 | } else /* NTLMSSP or SPNEGO */ { | 470 | } else /* NTLMSSP or SPNEGO */ { |
463 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; | 471 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; |