diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c78762051da4..4093d5332930 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -109,7 +109,7 @@ static int ipv6_connect(struct sockaddr_in6 *psin_server, | |||
109 | * wake up waiters on reconnection? - (not needed currently) | 109 | * wake up waiters on reconnection? - (not needed currently) |
110 | */ | 110 | */ |
111 | 111 | ||
112 | int | 112 | static int |
113 | cifs_reconnect(struct TCP_Server_Info *server) | 113 | cifs_reconnect(struct TCP_Server_Info *server) |
114 | { | 114 | { |
115 | int rc = 0; | 115 | int rc = 0; |
@@ -771,13 +771,18 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
771 | separator[0] = ','; | 771 | separator[0] = ','; |
772 | separator[1] = 0; | 772 | separator[1] = 0; |
773 | 773 | ||
774 | memset(vol->source_rfc1001_name,0x20,15); | 774 | if (Local_System_Name[0] != 0) |
775 | for(i=0;i < strnlen(utsname()->nodename,15);i++) { | 775 | memcpy(vol->source_rfc1001_name, Local_System_Name,15); |
776 | /* does not have to be a perfect mapping since the field is | 776 | else { |
777 | informational, only used for servers that do not support | 777 | char *nodename = utsname()->nodename; |
778 | port 445 and it can be overridden at mount time */ | 778 | int n = strnlen(nodename,15); |
779 | vol->source_rfc1001_name[i] = | 779 | memset(vol->source_rfc1001_name,0x20,15); |
780 | toupper(utsname()->nodename[i]); | 780 | for(i=0 ; i < n ; i++) { |
781 | /* does not have to be perfect mapping since field is | ||
782 | informational, only used for servers that do not support | ||
783 | port 445 and it can be overridden at mount time */ | ||
784 | vol->source_rfc1001_name[i] = toupper(nodename[i]); | ||
785 | } | ||
781 | } | 786 | } |
782 | vol->source_rfc1001_name[15] = 0; | 787 | vol->source_rfc1001_name[15] = 0; |
783 | /* null target name indicates to use *SMBSERVR default called name | 788 | /* null target name indicates to use *SMBSERVR default called name |
@@ -3215,7 +3220,9 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3215 | } | 3220 | } |
3216 | /* else do not bother copying these informational fields */ | 3221 | /* else do not bother copying these informational fields */ |
3217 | } | 3222 | } |
3218 | if(smb_buffer_response->WordCount == 3) | 3223 | if((smb_buffer_response->WordCount == 3) || |
3224 | (smb_buffer_response->WordCount == 7)) | ||
3225 | /* field is in same location */ | ||
3219 | tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); | 3226 | tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); |
3220 | else | 3227 | else |
3221 | tcon->Flags = 0; | 3228 | tcon->Flags = 0; |
@@ -3312,19 +3319,21 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo, | |||
3312 | first_time = 1; | 3319 | first_time = 1; |
3313 | } | 3320 | } |
3314 | if (!rc) { | 3321 | if (!rc) { |
3322 | pSesInfo->flags = 0; | ||
3315 | pSesInfo->capabilities = pSesInfo->server->capabilities; | 3323 | pSesInfo->capabilities = pSesInfo->server->capabilities; |
3316 | if(linuxExtEnabled == 0) | 3324 | if(linuxExtEnabled == 0) |
3317 | pSesInfo->capabilities &= (~CAP_UNIX); | 3325 | pSesInfo->capabilities &= (~CAP_UNIX); |
3318 | /* pSesInfo->sequence_number = 0;*/ | 3326 | /* pSesInfo->sequence_number = 0;*/ |
3319 | cFYI(1,("Security Mode: 0x%x Capabilities: 0x%x Time Zone: %d", | 3327 | cFYI(1,("Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d", |
3320 | pSesInfo->server->secMode, | 3328 | pSesInfo->server->secMode, |
3321 | pSesInfo->server->capabilities, | 3329 | pSesInfo->server->capabilities, |
3322 | pSesInfo->server->timeZone)); | 3330 | pSesInfo->server->timeAdj)); |
3323 | if(experimEnabled < 2) | 3331 | if(experimEnabled < 2) |
3324 | rc = CIFS_SessSetup(xid, pSesInfo, | 3332 | rc = CIFS_SessSetup(xid, pSesInfo, |
3325 | first_time, nls_info); | 3333 | first_time, nls_info); |
3326 | else if (extended_security | 3334 | else if (extended_security |
3327 | && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY) | 3335 | && (pSesInfo->capabilities |
3336 | & CAP_EXTENDED_SECURITY) | ||
3328 | && (pSesInfo->server->secType == NTLMSSP)) { | 3337 | && (pSesInfo->server->secType == NTLMSSP)) { |
3329 | rc = -EOPNOTSUPP; | 3338 | rc = -EOPNOTSUPP; |
3330 | } else if (extended_security | 3339 | } else if (extended_security |
@@ -3338,7 +3347,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo, | |||
3338 | if (!rc) { | 3347 | if (!rc) { |
3339 | if(ntlmv2_flag) { | 3348 | if(ntlmv2_flag) { |
3340 | char * v2_response; | 3349 | char * v2_response; |
3341 | cFYI(1,("Can use more secure NTLM version 2 password hash")); | 3350 | cFYI(1,("more secure NTLM ver2 hash")); |
3342 | if(CalcNTLMv2_partial_mac_key(pSesInfo, | 3351 | if(CalcNTLMv2_partial_mac_key(pSesInfo, |
3343 | nls_info)) { | 3352 | nls_info)) { |
3344 | rc = -ENOMEM; | 3353 | rc = -ENOMEM; |