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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index f0cf934ba877..2dddf01d2b66 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -902,15 +902,15 @@ PsxDelete:
902} 902}
903 903
904int 904int
905CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, 905CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
906 const char *fileName, const struct nls_table *nls_codepage, 906 struct cifs_sb_info *cifs_sb)
907 int remap)
908{ 907{
909 DELETE_FILE_REQ *pSMB = NULL; 908 DELETE_FILE_REQ *pSMB = NULL;
910 DELETE_FILE_RSP *pSMBr = NULL; 909 DELETE_FILE_RSP *pSMBr = NULL;
911 int rc = 0; 910 int rc = 0;
912 int bytes_returned; 911 int bytes_returned;
913 int name_len; 912 int name_len;
913 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
914 914
915DelFileRetry: 915DelFileRetry:
916 rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB, 916 rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB,
@@ -919,15 +919,15 @@ DelFileRetry:
919 return rc; 919 return rc;
920 920
921 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 921 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
922 name_len = 922 name_len = cifsConvertToUTF16((__le16 *) pSMB->fileName, name,
923 cifsConvertToUTF16((__le16 *) pSMB->fileName, fileName, 923 PATH_MAX, cifs_sb->local_nls,
924 PATH_MAX, nls_codepage, remap); 924 remap);
925 name_len++; /* trailing null */ 925 name_len++; /* trailing null */
926 name_len *= 2; 926 name_len *= 2;
927 } else { /* BB improve check for buffer overruns BB */ 927 } else { /* BB improve check for buffer overruns BB */
928 name_len = strnlen(fileName, PATH_MAX); 928 name_len = strnlen(name, PATH_MAX);
929 name_len++; /* trailing null */ 929 name_len++; /* trailing null */
930 strncpy(pSMB->fileName, fileName, name_len); 930 strncpy(pSMB->fileName, name, name_len);
931 } 931 }
932 pSMB->SearchAttributes = 932 pSMB->SearchAttributes =
933 cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM); 933 cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM);