aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/sess.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r--fs/cifs/sess.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index d1705ab8136e..e4c4e466e320 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -268,6 +268,10 @@ static int decode_ascii_ssetup(char ** pbcc_area, int bleft, struct cifsSesInfo
268 ses->serverOS = kzalloc(len + 1, GFP_KERNEL); 268 ses->serverOS = kzalloc(len + 1, GFP_KERNEL);
269 if(ses->serverOS) 269 if(ses->serverOS)
270 strncpy(ses->serverOS, bcc_ptr, len); 270 strncpy(ses->serverOS, bcc_ptr, len);
271 if(strncmp(ses->serverOS, "OS/2",4) == 0) {
272 cFYI(1,("OS/2 server"));
273 ses->flags |= CIFS_SES_OS2;
274 }
271 275
272 bcc_ptr += len + 1; 276 bcc_ptr += len + 1;
273 bleft -= len + 1; 277 bleft -= len + 1;
@@ -290,16 +294,11 @@ static int decode_ascii_ssetup(char ** pbcc_area, int bleft, struct cifsSesInfo
290 if(len > bleft) 294 if(len > bleft)
291 return rc; 295 return rc;
292 296
293 if(ses->serverDomain) 297 /* No domain field in LANMAN case. Domain is
294 kfree(ses->serverDomain); 298 returned by old servers in the SMB negprot response */
295 299 /* BB For newer servers which do not support Unicode,
296 ses->serverDomain = kzalloc(len + 1, GFP_KERNEL); 300 but thus do return domain here we could add parsing
297 if(ses->serverOS) 301 for it later, but it is not very important */
298 strncpy(ses->serverOS, bcc_ptr, len);
299
300 bcc_ptr += len + 1;
301 bleft -= len + 1;
302
303 cFYI(1,("ascii: bytes left %d",bleft)); 302 cFYI(1,("ascii: bytes left %d",bleft));
304 303
305 return rc; 304 return rc;
@@ -366,6 +365,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
366 str_area = kmalloc(2000, GFP_KERNEL); 365 str_area = kmalloc(2000, GFP_KERNEL);
367 bcc_ptr = str_area; 366 bcc_ptr = str_area;
368 367
368 ses->flags &= ~CIFS_SES_LANMAN;
369
369 if(type == LANMAN) { 370 if(type == LANMAN) {
370#ifdef CONFIG_CIFS_WEAK_PW_HASH 371#ifdef CONFIG_CIFS_WEAK_PW_HASH
371 char lnm_session_key[CIFS_SESS_KEY_SIZE]; 372 char lnm_session_key[CIFS_SESS_KEY_SIZE];
@@ -377,7 +378,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
377 /* and copy into bcc */ 378 /* and copy into bcc */
378 379
379 calc_lanman_hash(ses, lnm_session_key); 380 calc_lanman_hash(ses, lnm_session_key);
380 381 ses->flags |= CIFS_SES_LANMAN;
381/* #ifdef CONFIG_CIFS_DEBUG2 382/* #ifdef CONFIG_CIFS_DEBUG2
382 cifs_dump_mem("cryptkey: ",ses->server->cryptKey, 383 cifs_dump_mem("cryptkey: ",ses->server->cryptKey,
383 CIFS_SESS_KEY_SIZE); 384 CIFS_SESS_KEY_SIZE);