aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril Gorcunov <gorcunov@gmail.com>2007-10-14 13:58:43 -0400
committerSteve French <sfrench@us.ibm.com>2007-10-14 13:58:43 -0400
commit8f2376adfb57d95973b64ecdf016937f436b9bf0 (patch)
tree830a7f20af90be883a684fddc71a18f7c11df2b6
parent516897a208bc1423d561ce2ccce0624c3b652275 (diff)
[CIFS] Fix endian conversion problem in posix mkdir
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/CHANGES3
-rw-r--r--fs/cifs/cifsacl.h4
-rw-r--r--fs/cifs/cifsencrypt.c5
-rw-r--r--fs/cifs/cifssmb.c8
-rw-r--r--fs/cifs/inode.c3
5 files changed, 13 insertions, 10 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 13071faf8af7..70c90c07edf1 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -9,7 +9,8 @@ ability to mount to IPC$ share (which allows CIFS named pipes to be
9opened, read and written as if they were files). When 1st tree 9opened, read and written as if they were files). When 1st tree
10connect fails (e.g. due to signing negotiation failure) fix 10connect fails (e.g. due to signing negotiation failure) fix
11leak that causes cifsd not to stop and rmmod to fail to cleanup 11leak that causes cifsd not to stop and rmmod to fail to cleanup
12cifs_request_buffers pool. 12cifs_request_buffers pool. Fix problem with POSIX Open/Mkdir on
13bigendian architectures.
13 14
14Version 1.50 15Version 1.50
15------------ 16------------
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
index 1b115641b722..0362cd11f03e 100644
--- a/fs/cifs/cifsacl.h
+++ b/fs/cifs/cifsacl.h
@@ -51,8 +51,8 @@ struct cifs_acl {
51struct cifs_ntace { /* first part of ACE which contains perms */ 51struct cifs_ntace { /* first part of ACE which contains perms */
52 __u8 type; 52 __u8 type;
53 __u8 flags; 53 __u8 flags;
54 __u16 size; 54 __le16 size;
55 __u32 access_req; 55 __le32 access_req;
56} __attribute__((packed)); 56} __attribute__((packed));
57 57
58struct cifs_ace { /* last part of ACE which includes user info */ 58struct cifs_ace { /* last part of ACE which includes user info */
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 36272293027d..632070b4275d 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -345,7 +345,7 @@ static int calc_ntlmv2_hash(struct cifsSesInfo *ses,
345 user = kmalloc(2 + (len * 2), GFP_KERNEL); 345 user = kmalloc(2 + (len * 2), GFP_KERNEL);
346 if (user == NULL) 346 if (user == NULL)
347 goto calc_exit_2; 347 goto calc_exit_2;
348 len = cifs_strtoUCS(user, ses->userName, len, nls_cp); 348 len = cifs_strtoUCS((__le16 *)user, ses->userName, len, nls_cp);
349 UniStrupr(user); 349 UniStrupr(user);
350 hmac_md5_update((char *)user, 2*len, pctxt); 350 hmac_md5_update((char *)user, 2*len, pctxt);
351 351
@@ -356,7 +356,8 @@ static int calc_ntlmv2_hash(struct cifsSesInfo *ses,
356 domain = kmalloc(2 + (len * 2), GFP_KERNEL); 356 domain = kmalloc(2 + (len * 2), GFP_KERNEL);
357 if (domain == NULL) 357 if (domain == NULL)
358 goto calc_exit_1; 358 goto calc_exit_1;
359 len = cifs_strtoUCS(domain, ses->domainName, len, nls_cp); 359 len = cifs_strtoUCS((__le16 *)domain, ses->domainName, len,
360 nls_cp);
360 /* the following line was removed since it didn't work well 361 /* the following line was removed since it didn't work well
361 with lower cased domain name that passed as an option. 362 with lower cased domain name that passed as an option.
362 Maybe converting the domain name earlier makes sense */ 363 Maybe converting the domain name earlier makes sense */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index eff3226b2104..b17983633a1c 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1069,7 +1069,7 @@ PsxCreat:
1069 InformationLevel) - 4; 1069 InformationLevel) - 4;
1070 offset = param_offset + params; 1070 offset = param_offset + params;
1071 pdata = (OPEN_PSX_REQ *)(((char *)&pSMB->hdr.Protocol) + offset); 1071 pdata = (OPEN_PSX_REQ *)(((char *)&pSMB->hdr.Protocol) + offset);
1072 pdata->Level = SMB_QUERY_FILE_UNIX_BASIC; 1072 pdata->Level = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC);
1073 pdata->Permissions = cpu_to_le64(mode); 1073 pdata->Permissions = cpu_to_le64(mode);
1074 pdata->PosixOpenFlags = cpu_to_le32(posix_flags); 1074 pdata->PosixOpenFlags = cpu_to_le32(posix_flags);
1075 pdata->OpenFlags = cpu_to_le32(*pOplock); 1075 pdata->OpenFlags = cpu_to_le32(*pOplock);
@@ -1115,8 +1115,8 @@ PsxCreat:
1115 if (cpu_to_le32(FILE_CREATE) == psx_rsp->CreateAction) 1115 if (cpu_to_le32(FILE_CREATE) == psx_rsp->CreateAction)
1116 *pOplock |= CIFS_CREATE_ACTION; 1116 *pOplock |= CIFS_CREATE_ACTION;
1117 /* check to make sure response data is there */ 1117 /* check to make sure response data is there */
1118 if (psx_rsp->ReturnedLevel != SMB_QUERY_FILE_UNIX_BASIC) { 1118 if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) {
1119 pRetData->Type = -1; /* unknown */ 1119 pRetData->Type = cpu_to_le32(-1); /* unknown */
1120#ifdef CONFIG_CIFS_DEBUG2 1120#ifdef CONFIG_CIFS_DEBUG2
1121 cFYI(1, ("unknown type")); 1121 cFYI(1, ("unknown type"));
1122#endif 1122#endif
@@ -1124,7 +1124,7 @@ PsxCreat:
1124 if (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP) 1124 if (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP)
1125 + sizeof(FILE_UNIX_BASIC_INFO)) { 1125 + sizeof(FILE_UNIX_BASIC_INFO)) {
1126 cERROR(1, ("Open response data too small")); 1126 cERROR(1, ("Open response data too small"));
1127 pRetData->Type = -1; 1127 pRetData->Type = cpu_to_le32(-1);
1128 goto psx_create_err; 1128 goto psx_create_err;
1129 } 1129 }
1130 memcpy((char *) pRetData, 1130 memcpy((char *) pRetData,
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ece17ca00d08..cc119b278e5b 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -947,7 +947,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
947 d_drop(direntry); 947 d_drop(direntry);
948 } else { 948 } else {
949 int obj_type; 949 int obj_type;
950 if (pInfo->Type == -1) /* no return info - go query */ { 950 if (pInfo->Type == cpu_to_le32(-1)) {
951 /* no return info, go query for it */
951 kfree(pInfo); 952 kfree(pInfo);
952 goto mkdir_get_info; 953 goto mkdir_get_info;
953 } 954 }