aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-13 11:09:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-13 11:09:29 -0400
commit12e36b2f41b6cbc67386fcb9c59c32a3e2033905 (patch)
treeec1794bae2f96eef6cc2afb2fa5c48e6fd346316 /fs/cifs/connect.c
parent1baaf0b424fe611a99cf3e2e59e84df0561d679a (diff)
parent1a4e15a04ec69cb3552f4120079f5472377df5f7 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (27 commits) [CIFS] Missing flags2 for DFS [CIFS] Workaround incomplete byte length returned by some [CIFS] cifs Kconfig: don't select CONNECTOR [CIFS] Level 1 QPathInfo needed for proper OS2 support [CIFS] fix typo in previous patch [CIFS] Fix old DOS time conversion to handle timezone [CIFS] Do not need to adjust for Jan/Feb for leap day [CIFS] Fix leaps year calculation for years after 2100 [CIFS] readdir (ffirst) enablement of accurate timestamps from legacy servers [CIFS] Fix compiler warning with previous patch [CIFS] Fix typo [CIFS] Allow for 15 minute TZs (e.g. Nepal) and be more explicit about [CIFS] Fix readdir of large directories for backlevel servers [CIFS] Allow LANMAN21 support even in both POSIX non-POSIX path [CIFS] Make use of newer QFSInfo dependent on capability bit instead of [CIFS] Do not send newer QFSInfo to legacy servers which can not support it [CIFS] Fix typo in name of new cifs_show_stats [CIFS] Rename server time zone field [CIFS] Handle legacy servers which return undefined time zone [CIFS] CIFS support for /proc/<pid>/mountstats part 1 ... Manual conflict resolution in fs/cifs/connect.c
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c35
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
112int 112static int
113cifs_reconnect(struct TCP_Server_Info *server) 113cifs_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;