aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index cabc7a01f5df..074923ce593d 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -948,15 +948,15 @@ DelFileRetry:
948} 948}
949 949
950int 950int
951CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, 951CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
952 const char *dirName, const struct nls_table *nls_codepage, 952 struct cifs_sb_info *cifs_sb)
953 int remap)
954{ 953{
955 DELETE_DIRECTORY_REQ *pSMB = NULL; 954 DELETE_DIRECTORY_REQ *pSMB = NULL;
956 DELETE_DIRECTORY_RSP *pSMBr = NULL; 955 DELETE_DIRECTORY_RSP *pSMBr = NULL;
957 int rc = 0; 956 int rc = 0;
958 int bytes_returned; 957 int bytes_returned;
959 int name_len; 958 int name_len;
959 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
960 960
961 cFYI(1, "In CIFSSMBRmDir"); 961 cFYI(1, "In CIFSSMBRmDir");
962RmDirRetry: 962RmDirRetry:
@@ -966,14 +966,15 @@ RmDirRetry:
966 return rc; 966 return rc;
967 967
968 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 968 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
969 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, dirName, 969 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name,
970 PATH_MAX, nls_codepage, remap); 970 PATH_MAX, cifs_sb->local_nls,
971 remap);
971 name_len++; /* trailing null */ 972 name_len++; /* trailing null */
972 name_len *= 2; 973 name_len *= 2;
973 } else { /* BB improve check for buffer overruns BB */ 974 } else { /* BB improve check for buffer overruns BB */
974 name_len = strnlen(dirName, PATH_MAX); 975 name_len = strnlen(name, PATH_MAX);
975 name_len++; /* trailing null */ 976 name_len++; /* trailing null */
976 strncpy(pSMB->DirName, dirName, name_len); 977 strncpy(pSMB->DirName, name, name_len);
977 } 978 }
978 979
979 pSMB->BufferFormat = 0x04; 980 pSMB->BufferFormat = 0x04;
@@ -992,14 +993,15 @@ RmDirRetry:
992} 993}
993 994
994int 995int
995CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon, 996CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
996 const char *name, const struct nls_table *nls_codepage, int remap) 997 struct cifs_sb_info *cifs_sb)
997{ 998{
998 int rc = 0; 999 int rc = 0;
999 CREATE_DIRECTORY_REQ *pSMB = NULL; 1000 CREATE_DIRECTORY_REQ *pSMB = NULL;
1000 CREATE_DIRECTORY_RSP *pSMBr = NULL; 1001 CREATE_DIRECTORY_RSP *pSMBr = NULL;
1001 int bytes_returned; 1002 int bytes_returned;
1002 int name_len; 1003 int name_len;
1004 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
1003 1005
1004 cFYI(1, "In CIFSSMBMkDir"); 1006 cFYI(1, "In CIFSSMBMkDir");
1005MkDirRetry: 1007MkDirRetry:
@@ -1010,7 +1012,8 @@ MkDirRetry:
1010 1012
1011 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1013 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
1012 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name, 1014 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name,
1013 PATH_MAX, nls_codepage, remap); 1015 PATH_MAX, cifs_sb->local_nls,
1016 remap);
1014 name_len++; /* trailing null */ 1017 name_len++; /* trailing null */
1015 name_len *= 2; 1018 name_len *= 2;
1016 } else { /* BB improve check for buffer overruns BB */ 1019 } else { /* BB improve check for buffer overruns BB */
@@ -5943,7 +5946,7 @@ CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5943 5946
5944int 5947int
5945CIFSSMBUnixSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon, 5948CIFSSMBUnixSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5946 char *fileName, 5949 const char *file_name,
5947 const struct cifs_unix_set_info_args *args, 5950 const struct cifs_unix_set_info_args *args,
5948 const struct nls_table *nls_codepage, int remap) 5951 const struct nls_table *nls_codepage, int remap)
5949{ 5952{
@@ -5964,14 +5967,14 @@ setPermsRetry:
5964 5967
5965 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 5968 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
5966 name_len = 5969 name_len =
5967 cifsConvertToUTF16((__le16 *) pSMB->FileName, fileName, 5970 cifsConvertToUTF16((__le16 *) pSMB->FileName, file_name,
5968 PATH_MAX, nls_codepage, remap); 5971 PATH_MAX, nls_codepage, remap);
5969 name_len++; /* trailing null */ 5972 name_len++; /* trailing null */
5970 name_len *= 2; 5973 name_len *= 2;
5971 } else { /* BB improve the check for buffer overruns BB */ 5974 } else { /* BB improve the check for buffer overruns BB */
5972 name_len = strnlen(fileName, PATH_MAX); 5975 name_len = strnlen(file_name, PATH_MAX);
5973 name_len++; /* trailing null */ 5976 name_len++; /* trailing null */
5974 strncpy(pSMB->FileName, fileName, name_len); 5977 strncpy(pSMB->FileName, file_name, name_len);
5975 } 5978 }
5976 5979
5977 params = 6 + name_len; 5980 params = 6 + name_len;