[CIFS] Rename server time zone field
authorSteve French <sfrench@us.ibm.com>
Sat, 30 Sep 2006 01:07:38 +0000 (01:07 +0000)
committerSteve French <sfrench@us.ibm.com>
Sat, 30 Sep 2006 01:07:38 +0000 (01:07 +0000)
Server time zone is not really a time zone, rather a time adjustement
in seconds.

CC: Guenter Kukkukk <linux@kukkukk.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/cifspdu.h
fs/cifs/cifssmb.c
fs/cifs/connect.c

index 7ecfcbf31e55c88cae2b76ba3ab796685b95821e..e7641f9a13bbf60934d013a433934bd34123e091 100644 (file)
@@ -465,7 +465,7 @@ static struct super_operations cifs_super_ops = {
        .umount_begin   = cifs_umount_begin,
        .remount_fs = cifs_remount,
 #ifdef CONFIG_CIFS_STATS2
-       cifs_show_stats,
+       .cifs_show_stats,
 #endif
 };
 
index 441f8d2514fa3fbb60934d5576f050cfe8495633..98eb5446e8c1e5f22760aef786575baad3cbe308 100644 (file)
@@ -153,7 +153,7 @@ struct TCP_Server_Info {
        char sessid[4];         /* unique token id for this session */
        /* (returned on Negotiate */
        int capabilities; /* allow selective disabling of caps by smb sess */
-       __u16 timeZone;
+       __u16 timeAdj;  /* Adjust for difference in server time zone in sec */
        __u16 CurrentMid;         /* multiplex id - rotating counter */
        char cryptKey[CIFS_CRYPTO_KEY_SIZE];
        /* 16th byte of RFC1001 workstation name is always null */
index 81df2bf8e75a70d222f85757c5afdd1df9f20246..e5dd8708d636ee655379d34a593d9dce5dbf866a 100644 (file)
@@ -417,7 +417,10 @@ typedef struct lanman_neg_rsp {
        __le16 MaxNumberVcs;
        __le16 RawMode;
        __le32 SessionKey;
-       __le32 ServerTime;
+       struct {
+               __le16 Time;
+               __le16 Date;
+       } __attribute__((packed)) SrvTime;
        __le16 ServerTimeZone;
        __le16 EncryptionKeyLength;
        __le16 Reserved;
index 99718591ea295d0990662f8711f66235a848f6e2..6e004587fa483d92cafa5f31e37bf6493e401c3f 100644 (file)
@@ -473,7 +473,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
                        server->maxRw = 0;/* we do not need to use raw anyway */
                        server->capabilities = CAP_MPX_MODE;
                }
-               server->timeZone = le16_to_cpu(rsp->ServerTimeZone);
                tmp = le16_to_cpu(rsp->ServerTimeZone);
                if (tmp == (int)0xffff) {
                        /* OS/2 often does not set timezone therefore
@@ -492,11 +491,11 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
                        tmp = (int)(utc.tv_sec - ts.tv_sec);
                        adjust = tmp < 0 ? -29 : 29;
                        tmp = ((tmp + adjust) / 60) * 60;
-                       server->timeZone = tmp;
+                       server->timeAdj = tmp;
                } else {
-                       server->timeZone = tmp * 60; /* also in seconds */
+                       server->timeAdj = tmp * 60; /* also in seconds */
                }
-               cFYI(1,("server->timeZone: %d seconds", server->timeZone));
+               cFYI(1,("server->timeAdj: %d seconds", server->timeAdj));
 
 
                /* BB get server time for time conversions and add
@@ -557,7 +556,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
        cFYI(0, ("Max buf = %d", ses->server->maxBuf));
        GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);
        server->capabilities = le32_to_cpu(pSMBr->Capabilities);
-       server->timeZone = le16_to_cpu(pSMBr->ServerTimeZone);  
+       server->timeAdj = le16_to_cpu(pSMBr->ServerTimeZone) * 60;      
        if (pSMBr->EncryptionKeyLength == CIFS_CRYPTO_KEY_SIZE) {
                memcpy(server->cryptKey, pSMBr->u.EncryptionKey,
                       CIFS_CRYPTO_KEY_SIZE);
index b3268e53ab952bf057ef1c5f2aa8afd9e956e120..083b2b2c15715a93ed83c339e09e1eebd7a7e914 100644 (file)
@@ -3320,15 +3320,16 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
                if(linuxExtEnabled == 0)
                        pSesInfo->capabilities &= (~CAP_UNIX);
        /*      pSesInfo->sequence_number = 0;*/
-               cFYI(1,("Security Mode: 0x%x Capabilities: 0x%x Time Zone: %d",
+               cFYI(1,("Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
                        pSesInfo->server->secMode,
                        pSesInfo->server->capabilities,
-                       pSesInfo->server->timeZone));
+                       pSesInfo->server->timeAdj));
                if(experimEnabled < 2)
                        rc = CIFS_SessSetup(xid, pSesInfo,
                                            first_time, nls_info);
                else if (extended_security
-                               && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
+                               && (pSesInfo->capabilities 
+                                       & CAP_EXTENDED_SECURITY)
                                && (pSesInfo->server->secType == NTLMSSP)) {
                        rc = -EOPNOTSUPP;
                } else if (extended_security
@@ -3342,7 +3343,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
                        if (!rc) {
                                if(ntlmv2_flag) {
                                        char * v2_response;
-                                       cFYI(1,("Can use more secure NTLM version 2 password hash"));
+                                       cFYI(1,("more secure NTLM ver2 hash"));
                                        if(CalcNTLMv2_partial_mac_key(pSesInfo, 
                                                nls_info)) {
                                                rc = -ENOMEM;