aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsproto.h6
-rw-r--r--fs/cifs/cifssmb.c51
-rw-r--r--fs/cifs/connect.c7
-rw-r--r--fs/cifs/netmisc.c6
-rw-r--r--fs/cifs/ntlmssp.h4
5 files changed, 45 insertions, 29 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index d481f6c5a2be..08248e85b788 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -93,7 +93,7 @@ extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time);
93 93
94extern int cifs_get_inode_info(struct inode **pinode, 94extern int cifs_get_inode_info(struct inode **pinode,
95 const unsigned char *search_path, 95 const unsigned char *search_path,
96 FILE_ALL_INFO * pfile_info, 96 FILE_ALL_INFO *pfile_info,
97 struct super_block *sb, int xid, const __u16 *pfid); 97 struct super_block *sb, int xid, const __u16 *pfid);
98extern int cifs_get_inode_info_unix(struct inode **pinode, 98extern int cifs_get_inode_info_unix(struct inode **pinode,
99 const unsigned char *search_path, 99 const unsigned char *search_path,
@@ -130,7 +130,7 @@ extern int CIFSFindClose(const int, struct cifsTconInfo *tcon,
130 130
131extern int CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon, 131extern int CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon,
132 const unsigned char *searchName, 132 const unsigned char *searchName,
133 FILE_ALL_INFO * findData, 133 FILE_ALL_INFO *findData,
134 int legacy /* whether to use old info level */, 134 int legacy /* whether to use old info level */,
135 const struct nls_table *nls_codepage, int remap); 135 const struct nls_table *nls_codepage, int remap);
136extern int SMBQueryInformation(const int xid, struct cifsTconInfo *tcon, 136extern int SMBQueryInformation(const int xid, struct cifsTconInfo *tcon,
@@ -141,7 +141,7 @@ extern int SMBQueryInformation(const int xid, struct cifsTconInfo *tcon,
141extern int CIFSSMBUnixQPathInfo(const int xid, 141extern int CIFSSMBUnixQPathInfo(const int xid,
142 struct cifsTconInfo *tcon, 142 struct cifsTconInfo *tcon,
143 const unsigned char *searchName, 143 const unsigned char *searchName,
144 FILE_UNIX_BASIC_INFO * pFindData, 144 FILE_UNIX_BASIC_INFO *pFindData,
145 const struct nls_table *nls_codepage, int remap); 145 const struct nls_table *nls_codepage, int remap);
146 146
147extern int CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses, 147extern int CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 1cbe61524efc..3c05c2de50e1 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1247,7 +1247,7 @@ OldOpenRetry:
1247 } else { 1247 } else {
1248 /* BB verify if wct == 15 */ 1248 /* BB verify if wct == 15 */
1249 1249
1250/* *pOplock = pSMBr->OplockLevel; */ /* BB take from action field BB */ 1250/* *pOplock = pSMBr->OplockLevel; */ /* BB take from action field*/
1251 1251
1252 *netfid = pSMBr->Fid; /* cifs fid stays in le */ 1252 *netfid = pSMBr->Fid; /* cifs fid stays in le */
1253 /* Let caller know file was created so we can set the mode. */ 1253 /* Let caller know file was created so we can set the mode. */
@@ -1944,7 +1944,7 @@ renameRetry:
1944 /* protocol requires ASCII signature byte on Unicode string */ 1944 /* protocol requires ASCII signature byte on Unicode string */
1945 pSMB->OldFileName[name_len + 1] = 0x00; 1945 pSMB->OldFileName[name_len + 1] = 0x00;
1946 name_len2 = 1946 name_len2 =
1947 cifsConvertToUCS((__le16 *) &pSMB->OldFileName[name_len + 2], 1947 cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2],
1948 toName, PATH_MAX, nls_codepage, remap); 1948 toName, PATH_MAX, nls_codepage, remap);
1949 name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; 1949 name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ;
1950 name_len2 *= 2; /* convert to bytes */ 1950 name_len2 *= 2; /* convert to bytes */
@@ -2925,7 +2925,8 @@ setAclRetry:
2925 } 2925 }
2926 params = 6 + name_len; 2926 params = 6 + name_len;
2927 pSMB->MaxParameterCount = cpu_to_le16(2); 2927 pSMB->MaxParameterCount = cpu_to_le16(2);
2928 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB size from sess */ 2928 /* BB find max SMB size from sess */
2929 pSMB->MaxDataCount = cpu_to_le16(1000);
2929 pSMB->MaxSetupCount = 0; 2930 pSMB->MaxSetupCount = 0;
2930 pSMB->Reserved = 0; 2931 pSMB->Reserved = 0;
2931 pSMB->Flags = 0; 2932 pSMB->Flags = 0;
@@ -3322,7 +3323,8 @@ QPathInfoRetry:
3322 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; 3323 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */;
3323 pSMB->TotalDataCount = 0; 3324 pSMB->TotalDataCount = 0;
3324 pSMB->MaxParameterCount = cpu_to_le16(2); 3325 pSMB->MaxParameterCount = cpu_to_le16(2);
3325 pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ 3326 /* BB find exact max SMB PDU from sess structure BB */
3327 pSMB->MaxDataCount = cpu_to_le16(4000);
3326 pSMB->MaxSetupCount = 0; 3328 pSMB->MaxSetupCount = 0;
3327 pSMB->Reserved = 0; 3329 pSMB->Reserved = 0;
3328 pSMB->Flags = 0; 3330 pSMB->Flags = 0;
@@ -3388,7 +3390,7 @@ QPathInfoRetry:
3388int 3390int
3389CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon, 3391CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon,
3390 const unsigned char *searchName, 3392 const unsigned char *searchName,
3391 FILE_UNIX_BASIC_INFO * pFindData, 3393 FILE_UNIX_BASIC_INFO *pFindData,
3392 const struct nls_table *nls_codepage, int remap) 3394 const struct nls_table *nls_codepage, int remap)
3393{ 3395{
3394/* SMB_QUERY_FILE_UNIX_BASIC */ 3396/* SMB_QUERY_FILE_UNIX_BASIC */
@@ -3922,7 +3924,8 @@ getDFSRetry:
3922 pSMB->DataCount = 0; 3924 pSMB->DataCount = 0;
3923 pSMB->DataOffset = 0; 3925 pSMB->DataOffset = 0;
3924 pSMB->MaxParameterCount = 0; 3926 pSMB->MaxParameterCount = 0;
3925 pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ 3927 /* BB find exact max SMB PDU from sess structure BB */
3928 pSMB->MaxDataCount = cpu_to_le16(4000);
3926 pSMB->MaxSetupCount = 0; 3929 pSMB->MaxSetupCount = 0;
3927 pSMB->Reserved = 0; 3930 pSMB->Reserved = 0;
3928 pSMB->Flags = 0; 3931 pSMB->Flags = 0;
@@ -4230,7 +4233,8 @@ QFSAttributeRetry:
4230 params = 2; /* level */ 4233 params = 2; /* level */
4231 pSMB->TotalDataCount = 0; 4234 pSMB->TotalDataCount = 0;
4232 pSMB->MaxParameterCount = cpu_to_le16(2); 4235 pSMB->MaxParameterCount = cpu_to_le16(2);
4233 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ 4236 /* BB find exact max SMB PDU from sess structure BB */
4237 pSMB->MaxDataCount = cpu_to_le16(1000);
4234 pSMB->MaxSetupCount = 0; 4238 pSMB->MaxSetupCount = 0;
4235 pSMB->Reserved = 0; 4239 pSMB->Reserved = 0;
4236 pSMB->Flags = 0; 4240 pSMB->Flags = 0;
@@ -4299,7 +4303,8 @@ QFSDeviceRetry:
4299 params = 2; /* level */ 4303 params = 2; /* level */
4300 pSMB->TotalDataCount = 0; 4304 pSMB->TotalDataCount = 0;
4301 pSMB->MaxParameterCount = cpu_to_le16(2); 4305 pSMB->MaxParameterCount = cpu_to_le16(2);
4302 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ 4306 /* BB find exact max SMB PDU from sess structure BB */
4307 pSMB->MaxDataCount = cpu_to_le16(1000);
4303 pSMB->MaxSetupCount = 0; 4308 pSMB->MaxSetupCount = 0;
4304 pSMB->Reserved = 0; 4309 pSMB->Reserved = 0;
4305 pSMB->Flags = 0; 4310 pSMB->Flags = 0;
@@ -4370,7 +4375,8 @@ QFSUnixRetry:
4370 pSMB->DataCount = 0; 4375 pSMB->DataCount = 0;
4371 pSMB->DataOffset = 0; 4376 pSMB->DataOffset = 0;
4372 pSMB->MaxParameterCount = cpu_to_le16(2); 4377 pSMB->MaxParameterCount = cpu_to_le16(2);
4373 pSMB->MaxDataCount = cpu_to_le16(100); /* BB find exact max SMB PDU from sess structure BB */ 4378 /* BB find exact max SMB PDU from sess structure BB */
4379 pSMB->MaxDataCount = cpu_to_le16(100);
4374 pSMB->MaxSetupCount = 0; 4380 pSMB->MaxSetupCount = 0;
4375 pSMB->Reserved = 0; 4381 pSMB->Reserved = 0;
4376 pSMB->Flags = 0; 4382 pSMB->Flags = 0;
@@ -4445,7 +4451,8 @@ SETFSUnixRetry:
4445 offset = param_offset + params; 4451 offset = param_offset + params;
4446 4452
4447 pSMB->MaxParameterCount = cpu_to_le16(4); 4453 pSMB->MaxParameterCount = cpu_to_le16(4);
4448 pSMB->MaxDataCount = cpu_to_le16(100); /* BB find exact max SMB PDU from sess structure BB */ 4454 /* BB find exact max SMB PDU from sess structure BB */
4455 pSMB->MaxDataCount = cpu_to_le16(100);
4449 pSMB->SetupCount = 1; 4456 pSMB->SetupCount = 1;
4450 pSMB->Reserved3 = 0; 4457 pSMB->Reserved3 = 0;
4451 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FS_INFORMATION); 4458 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FS_INFORMATION);
@@ -4513,7 +4520,8 @@ QFSPosixRetry:
4513 pSMB->DataCount = 0; 4520 pSMB->DataCount = 0;
4514 pSMB->DataOffset = 0; 4521 pSMB->DataOffset = 0;
4515 pSMB->MaxParameterCount = cpu_to_le16(2); 4522 pSMB->MaxParameterCount = cpu_to_le16(2);
4516 pSMB->MaxDataCount = cpu_to_le16(100); /* BB find exact max SMB PDU from sess structure BB */ 4523 /* BB find exact max SMB PDU from sess structure BB */
4524 pSMB->MaxDataCount = cpu_to_le16(100);
4517 pSMB->MaxSetupCount = 0; 4525 pSMB->MaxSetupCount = 0;
4518 pSMB->Reserved = 0; 4526 pSMB->Reserved = 0;
4519 pSMB->Flags = 0; 4527 pSMB->Flags = 0;
@@ -4703,7 +4711,8 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
4703 4711
4704 count = sizeof(struct file_end_of_file_info); 4712 count = sizeof(struct file_end_of_file_info);
4705 pSMB->MaxParameterCount = cpu_to_le16(2); 4713 pSMB->MaxParameterCount = cpu_to_le16(2);
4706 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */ 4714 /* BB find exact max SMB PDU from sess structure BB */
4715 pSMB->MaxDataCount = cpu_to_le16(1000);
4707 pSMB->SetupCount = 1; 4716 pSMB->SetupCount = 1;
4708 pSMB->Reserved3 = 0; 4717 pSMB->Reserved3 = 0;
4709 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); 4718 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION);
@@ -4790,7 +4799,8 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
4790 4799
4791 count = sizeof(FILE_BASIC_INFO); 4800 count = sizeof(FILE_BASIC_INFO);
4792 pSMB->MaxParameterCount = cpu_to_le16(2); 4801 pSMB->MaxParameterCount = cpu_to_le16(2);
4793 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */ 4802 /* BB find max SMB PDU from sess */
4803 pSMB->MaxDataCount = cpu_to_le16(1000);
4794 pSMB->SetupCount = 1; 4804 pSMB->SetupCount = 1;
4795 pSMB->Reserved3 = 0; 4805 pSMB->Reserved3 = 0;
4796 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); 4806 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION);
@@ -4857,7 +4867,8 @@ SetTimesRetry:
4857 params = 6 + name_len; 4867 params = 6 + name_len;
4858 count = sizeof(FILE_BASIC_INFO); 4868 count = sizeof(FILE_BASIC_INFO);
4859 pSMB->MaxParameterCount = cpu_to_le16(2); 4869 pSMB->MaxParameterCount = cpu_to_le16(2);
4860 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ 4870 /* BB find max SMB PDU from sess structure BB */
4871 pSMB->MaxDataCount = cpu_to_le16(1000);
4861 pSMB->MaxSetupCount = 0; 4872 pSMB->MaxSetupCount = 0;
4862 pSMB->Reserved = 0; 4873 pSMB->Reserved = 0;
4863 pSMB->Flags = 0; 4874 pSMB->Flags = 0;
@@ -4987,7 +4998,8 @@ setPermsRetry:
4987 params = 6 + name_len; 4998 params = 6 + name_len;
4988 count = sizeof(FILE_UNIX_BASIC_INFO); 4999 count = sizeof(FILE_UNIX_BASIC_INFO);
4989 pSMB->MaxParameterCount = cpu_to_le16(2); 5000 pSMB->MaxParameterCount = cpu_to_le16(2);
4990 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ 5001 /* BB find max SMB PDU from sess structure BB */
5002 pSMB->MaxDataCount = cpu_to_le16(1000);
4991 pSMB->MaxSetupCount = 0; 5003 pSMB->MaxSetupCount = 0;
4992 pSMB->Reserved = 0; 5004 pSMB->Reserved = 0;
4993 pSMB->Flags = 0; 5005 pSMB->Flags = 0;
@@ -5170,7 +5182,8 @@ QAllEAsRetry:
5170 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; 5182 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */;
5171 pSMB->TotalDataCount = 0; 5183 pSMB->TotalDataCount = 0;
5172 pSMB->MaxParameterCount = cpu_to_le16(2); 5184 pSMB->MaxParameterCount = cpu_to_le16(2);
5173 pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ 5185 /* BB find exact max SMB PDU from sess structure BB */
5186 pSMB->MaxDataCount = cpu_to_le16(4000);
5174 pSMB->MaxSetupCount = 0; 5187 pSMB->MaxSetupCount = 0;
5175 pSMB->Reserved = 0; 5188 pSMB->Reserved = 0;
5176 pSMB->Flags = 0; 5189 pSMB->Flags = 0;
@@ -5318,7 +5331,8 @@ QEARetry:
5318 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; 5331 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */;
5319 pSMB->TotalDataCount = 0; 5332 pSMB->TotalDataCount = 0;
5320 pSMB->MaxParameterCount = cpu_to_le16(2); 5333 pSMB->MaxParameterCount = cpu_to_le16(2);
5321 pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ 5334 /* BB find exact max SMB PDU from sess structure BB */
5335 pSMB->MaxDataCount = cpu_to_le16(4000);
5322 pSMB->MaxSetupCount = 0; 5336 pSMB->MaxSetupCount = 0;
5323 pSMB->Reserved = 0; 5337 pSMB->Reserved = 0;
5324 pSMB->Flags = 0; 5338 pSMB->Flags = 0;
@@ -5476,7 +5490,8 @@ SetEARetry:
5476 5490
5477 count = sizeof(*parm_data) + ea_value_len + name_len; 5491 count = sizeof(*parm_data) + ea_value_len + name_len;
5478 pSMB->MaxParameterCount = cpu_to_le16(2); 5492 pSMB->MaxParameterCount = cpu_to_le16(2);
5479 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB size from sess */ 5493 /* BB find max SMB PDU from sess */
5494 pSMB->MaxDataCount = cpu_to_le16(1000);
5480 pSMB->MaxSetupCount = 0; 5495 pSMB->MaxSetupCount = 0;
5481 pSMB->Reserved = 0; 5496 pSMB->Reserved = 0;
5482 pSMB->Flags = 0; 5497 pSMB->Flags = 0;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8e2fa6d46c72..7c2e5ea03305 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1820,7 +1820,7 @@ convert_delimiter(char *path, char delim)
1820 if (path == NULL) 1820 if (path == NULL)
1821 return; 1821 return;
1822 1822
1823 if (delim == '/') 1823 if (delim == '/')
1824 old_delim = '\\'; 1824 old_delim = '\\';
1825 else 1825 else
1826 old_delim = '/'; 1826 old_delim = '/';
@@ -2321,9 +2321,10 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2321 user = ses->userName; 2321 user = ses->userName;
2322 domain = ses->domainName; 2322 domain = ses->domainName;
2323 smb_buffer = cifs_buf_get(); 2323 smb_buffer = cifs_buf_get();
2324 if (smb_buffer == NULL) { 2324
2325 if (smb_buffer == NULL)
2325 return -ENOMEM; 2326 return -ENOMEM;
2326 } 2327
2327 smb_buffer_response = smb_buffer; 2328 smb_buffer_response = smb_buffer;
2328 pSMBr = pSMB = (SESSION_SETUP_ANDX *) smb_buffer; 2329 pSMBr = pSMB = (SESSION_SETUP_ANDX *) smb_buffer;
2329 2330
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 00f4cff400b3..8703d68f5b20 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -141,11 +141,11 @@ cifs_inet_pton(const int address_family, const char *cp, void *dst)
141 int ret = 0; 141 int ret = 0;
142 142
143 /* calculate length by finding first slash or NULL */ 143 /* calculate length by finding first slash or NULL */
144 if (address_family == AF_INET) { 144 if (address_family == AF_INET)
145 ret = in4_pton(cp, -1 /* len */, dst, '\\', NULL); 145 ret = in4_pton(cp, -1 /* len */, dst, '\\', NULL);
146 } else if (address_family == AF_INET6) { 146 else if (address_family == AF_INET6)
147 ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL); 147 ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL);
148 } 148
149 cFYI(DBG2, ("address conversion returned %d for %s", ret, cp)); 149 cFYI(DBG2, ("address conversion returned %d for %s", ret, cp));
150 if (ret > 0) 150 if (ret > 0)
151 ret = 1; 151 ret = 1;
diff --git a/fs/cifs/ntlmssp.h b/fs/cifs/ntlmssp.h
index 7170a9b70f1e..c377d8065d99 100644
--- a/fs/cifs/ntlmssp.h
+++ b/fs/cifs/ntlmssp.h
@@ -64,7 +64,7 @@ typedef struct _SECURITY_BUFFER {
64} __attribute__((packed)) SECURITY_BUFFER; 64} __attribute__((packed)) SECURITY_BUFFER;
65 65
66typedef struct _NEGOTIATE_MESSAGE { 66typedef struct _NEGOTIATE_MESSAGE {
67 __u8 Signature[sizeof (NTLMSSP_SIGNATURE)]; 67 __u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
68 __le32 MessageType; /* 1 */ 68 __le32 MessageType; /* 1 */
69 __le32 NegotiateFlags; 69 __le32 NegotiateFlags;
70 SECURITY_BUFFER DomainName; /* RFC 1001 style and ASCII */ 70 SECURITY_BUFFER DomainName; /* RFC 1001 style and ASCII */
@@ -74,7 +74,7 @@ typedef struct _NEGOTIATE_MESSAGE {
74} __attribute__((packed)) NEGOTIATE_MESSAGE, *PNEGOTIATE_MESSAGE; 74} __attribute__((packed)) NEGOTIATE_MESSAGE, *PNEGOTIATE_MESSAGE;
75 75
76typedef struct _CHALLENGE_MESSAGE { 76typedef struct _CHALLENGE_MESSAGE {
77 __u8 Signature[sizeof (NTLMSSP_SIGNATURE)]; 77 __u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
78 __le32 MessageType; /* 2 */ 78 __le32 MessageType; /* 2 */
79 SECURITY_BUFFER TargetName; 79 SECURITY_BUFFER TargetName;
80 __le32 NegotiateFlags; 80 __le32 NegotiateFlags;