diff options
author | Steve French <sfrench@us.ibm.com> | 2006-09-30 00:13:17 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-09-30 00:13:17 -0400 |
commit | 9ac00b7d96045fa3ce573e0ad5cdc0350ad8e1d2 (patch) | |
tree | 80ee9890d64f6c4b899144df8ee0c6cd9361aafb /fs/cifs/sess.c | |
parent | f46d3e11903e452924ef2996aa9aca2aae4427e2 (diff) |
[CIFS] Do not send newer QFSInfo to legacy servers which can not support it
Fix dialect negotiation to save off when we have negotiated lanman.
This allows us to avoid sending some somewhat newer requests that the server
can not handle and go directly to the older version (infolevel) of the same
call. Make sure we try to negotiate a level which allows us to get the
server OS (which we check so we can detect Win9x vs. other legacy servers
and eventually work around the Win9x DOS time bug (they reverse date/time
fields).
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r-- | fs/cifs/sess.c | 23 |
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); |