aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/cifs/cifsglob.h2
-rw-r--r--fs/cifs/cifspdu.h5
-rw-r--r--fs/cifs/cifssmb.c9
-rw-r--r--fs/cifs/connect.c9
5 files changed, 15 insertions, 12 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 7ecfcbf31e55..e7641f9a13bb 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -465,7 +465,7 @@ static struct super_operations cifs_super_ops = {
465 .umount_begin = cifs_umount_begin, 465 .umount_begin = cifs_umount_begin,
466 .remount_fs = cifs_remount, 466 .remount_fs = cifs_remount,
467#ifdef CONFIG_CIFS_STATS2 467#ifdef CONFIG_CIFS_STATS2
468 cifs_show_stats, 468 .cifs_show_stats,
469#endif 469#endif
470}; 470};
471 471
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 441f8d2514fa..98eb5446e8c1 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -153,7 +153,7 @@ struct TCP_Server_Info {
153 char sessid[4]; /* unique token id for this session */ 153 char sessid[4]; /* unique token id for this session */
154 /* (returned on Negotiate */ 154 /* (returned on Negotiate */
155 int capabilities; /* allow selective disabling of caps by smb sess */ 155 int capabilities; /* allow selective disabling of caps by smb sess */
156 __u16 timeZone; 156 __u16 timeAdj; /* Adjust for difference in server time zone in sec */
157 __u16 CurrentMid; /* multiplex id - rotating counter */ 157 __u16 CurrentMid; /* multiplex id - rotating counter */
158 char cryptKey[CIFS_CRYPTO_KEY_SIZE]; 158 char cryptKey[CIFS_CRYPTO_KEY_SIZE];
159 /* 16th byte of RFC1001 workstation name is always null */ 159 /* 16th byte of RFC1001 workstation name is always null */
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 81df2bf8e75a..e5dd8708d636 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -417,7 +417,10 @@ typedef struct lanman_neg_rsp {
417 __le16 MaxNumberVcs; 417 __le16 MaxNumberVcs;
418 __le16 RawMode; 418 __le16 RawMode;
419 __le32 SessionKey; 419 __le32 SessionKey;
420 __le32 ServerTime; 420 struct {
421 __le16 Time;
422 __le16 Date;
423 } __attribute__((packed)) SrvTime;
421 __le16 ServerTimeZone; 424 __le16 ServerTimeZone;
422 __le16 EncryptionKeyLength; 425 __le16 EncryptionKeyLength;
423 __le16 Reserved; 426 __le16 Reserved;
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 99718591ea29..6e004587fa48 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -473,7 +473,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
473 server->maxRw = 0;/* we do not need to use raw anyway */ 473 server->maxRw = 0;/* we do not need to use raw anyway */
474 server->capabilities = CAP_MPX_MODE; 474 server->capabilities = CAP_MPX_MODE;
475 } 475 }
476 server->timeZone = le16_to_cpu(rsp->ServerTimeZone);
477 tmp = le16_to_cpu(rsp->ServerTimeZone); 476 tmp = le16_to_cpu(rsp->ServerTimeZone);
478 if (tmp == (int)0xffff) { 477 if (tmp == (int)0xffff) {
479 /* OS/2 often does not set timezone therefore 478 /* OS/2 often does not set timezone therefore
@@ -492,11 +491,11 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
492 tmp = (int)(utc.tv_sec - ts.tv_sec); 491 tmp = (int)(utc.tv_sec - ts.tv_sec);
493 adjust = tmp < 0 ? -29 : 29; 492 adjust = tmp < 0 ? -29 : 29;
494 tmp = ((tmp + adjust) / 60) * 60; 493 tmp = ((tmp + adjust) / 60) * 60;
495 server->timeZone = tmp; 494 server->timeAdj = tmp;
496 } else { 495 } else {
497 server->timeZone = tmp * 60; /* also in seconds */ 496 server->timeAdj = tmp * 60; /* also in seconds */
498 } 497 }
499 cFYI(1,("server->timeZone: %d seconds", server->timeZone)); 498 cFYI(1,("server->timeAdj: %d seconds", server->timeAdj));
500 499
501 500
502 /* BB get server time for time conversions and add 501 /* BB get server time for time conversions and add
@@ -557,7 +556,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
557 cFYI(0, ("Max buf = %d", ses->server->maxBuf)); 556 cFYI(0, ("Max buf = %d", ses->server->maxBuf));
558 GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey); 557 GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);
559 server->capabilities = le32_to_cpu(pSMBr->Capabilities); 558 server->capabilities = le32_to_cpu(pSMBr->Capabilities);
560 server->timeZone = le16_to_cpu(pSMBr->ServerTimeZone); 559 server->timeAdj = le16_to_cpu(pSMBr->ServerTimeZone) * 60;
561 if (pSMBr->EncryptionKeyLength == CIFS_CRYPTO_KEY_SIZE) { 560 if (pSMBr->EncryptionKeyLength == CIFS_CRYPTO_KEY_SIZE) {
562 memcpy(server->cryptKey, pSMBr->u.EncryptionKey, 561 memcpy(server->cryptKey, pSMBr->u.EncryptionKey,
563 CIFS_CRYPTO_KEY_SIZE); 562 CIFS_CRYPTO_KEY_SIZE);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b3268e53ab95..083b2b2c1571 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3320,15 +3320,16 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
3320 if(linuxExtEnabled == 0) 3320 if(linuxExtEnabled == 0)
3321 pSesInfo->capabilities &= (~CAP_UNIX); 3321 pSesInfo->capabilities &= (~CAP_UNIX);
3322 /* pSesInfo->sequence_number = 0;*/ 3322 /* pSesInfo->sequence_number = 0;*/
3323 cFYI(1,("Security Mode: 0x%x Capabilities: 0x%x Time Zone: %d", 3323 cFYI(1,("Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
3324 pSesInfo->server->secMode, 3324 pSesInfo->server->secMode,
3325 pSesInfo->server->capabilities, 3325 pSesInfo->server->capabilities,
3326 pSesInfo->server->timeZone)); 3326 pSesInfo->server->timeAdj));
3327 if(experimEnabled < 2) 3327 if(experimEnabled < 2)
3328 rc = CIFS_SessSetup(xid, pSesInfo, 3328 rc = CIFS_SessSetup(xid, pSesInfo,
3329 first_time, nls_info); 3329 first_time, nls_info);
3330 else if (extended_security 3330 else if (extended_security
3331 && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY) 3331 && (pSesInfo->capabilities
3332 & CAP_EXTENDED_SECURITY)
3332 && (pSesInfo->server->secType == NTLMSSP)) { 3333 && (pSesInfo->server->secType == NTLMSSP)) {
3333 rc = -EOPNOTSUPP; 3334 rc = -EOPNOTSUPP;
3334 } else if (extended_security 3335 } else if (extended_security
@@ -3342,7 +3343,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
3342 if (!rc) { 3343 if (!rc) {
3343 if(ntlmv2_flag) { 3344 if(ntlmv2_flag) {
3344 char * v2_response; 3345 char * v2_response;
3345 cFYI(1,("Can use more secure NTLM version 2 password hash")); 3346 cFYI(1,("more secure NTLM ver2 hash"));
3346 if(CalcNTLMv2_partial_mac_key(pSesInfo, 3347 if(CalcNTLMv2_partial_mac_key(pSesInfo,
3347 nls_info)) { 3348 nls_info)) {
3348 rc = -ENOMEM; 3349 rc = -ENOMEM;