aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-14 11:48:26 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-15 14:00:58 -0400
commit733f99acc82543030ce0417e2f2201ddc63097af (patch)
treeea056804fb4883b407422ac563373c1092fe389c /fs/cifs/cifssmb.c
parent645408d1ffe9f27b176a88302c22420f301607db (diff)
[PATCH] new cifs endianness bugs
* missing cpu_to_le64() for ChangeTime (introduced by [CIFS] Legacy time handling for Win9x and OS/2 part 1) * missing le16_to_cpu() for DialectIndex (introduced by [CIFS] Do not send newer QFSInfo to legacy servers which can not support it) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 5dc5a966bd5f..098790eb2aa1 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -399,6 +399,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
399 struct TCP_Server_Info * server; 399 struct TCP_Server_Info * server;
400 u16 count; 400 u16 count;
401 unsigned int secFlags; 401 unsigned int secFlags;
402 u16 dialect;
402 403
403 if(ses->server) 404 if(ses->server)
404 server = ses->server; 405 server = ses->server;
@@ -438,9 +439,10 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
438 if (rc != 0) 439 if (rc != 0)
439 goto neg_err_exit; 440 goto neg_err_exit;
440 441
441 cFYI(1,("Dialect: %d", pSMBr->DialectIndex)); 442 dialect = le16_to_cpu(pSMBr->DialectIndex);
443 cFYI(1,("Dialect: %d", dialect));
442 /* Check wct = 1 error case */ 444 /* Check wct = 1 error case */
443 if((pSMBr->hdr.WordCount < 13) || (pSMBr->DialectIndex == BAD_PROT)) { 445 if((pSMBr->hdr.WordCount < 13) || (dialect == BAD_PROT)) {
444 /* core returns wct = 1, but we do not ask for core - otherwise 446 /* core returns wct = 1, but we do not ask for core - otherwise
445 small wct just comes when dialect index is -1 indicating we 447 small wct just comes when dialect index is -1 indicating we
446 could not negotiate a common dialect */ 448 could not negotiate a common dialect */
@@ -448,8 +450,8 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
448 goto neg_err_exit; 450 goto neg_err_exit;
449#ifdef CONFIG_CIFS_WEAK_PW_HASH 451#ifdef CONFIG_CIFS_WEAK_PW_HASH
450 } else if((pSMBr->hdr.WordCount == 13) 452 } else if((pSMBr->hdr.WordCount == 13)
451 && ((pSMBr->DialectIndex == LANMAN_PROT) 453 && ((dialect == LANMAN_PROT)
452 || (pSMBr->DialectIndex == LANMAN2_PROT))) { 454 || (dialect == LANMAN2_PROT))) {
453 __s16 tmp; 455 __s16 tmp;
454 struct lanman_neg_rsp * rsp = (struct lanman_neg_rsp *)pSMBr; 456 struct lanman_neg_rsp * rsp = (struct lanman_neg_rsp *)pSMBr;
455 457
@@ -2943,7 +2945,7 @@ QInfRetry:
2943 ts.tv_nsec = 0; 2945 ts.tv_nsec = 0;
2944 ts.tv_sec = time; 2946 ts.tv_sec = time;
2945 /* decode time fields */ 2947 /* decode time fields */
2946 pFinfo->ChangeTime = cifs_UnixTimeToNT(ts); 2948 pFinfo->ChangeTime = cpu_to_le64(cifs_UnixTimeToNT(ts));
2947 pFinfo->LastWriteTime = pFinfo->ChangeTime; 2949 pFinfo->LastWriteTime = pFinfo->ChangeTime;
2948 pFinfo->LastAccessTime = 0; 2950 pFinfo->LastAccessTime = 0;
2949 pFinfo->AllocationSize = 2951 pFinfo->AllocationSize =