@@ -536,7 +536,7 @@ static int parse_reparse_posix(struct reparse_posix_data *buf,
536
536
}
537
537
538
538
int smb2_parse_native_symlink (char * * target , const char * buf , unsigned int len ,
539
- bool unicode , bool relative ,
539
+ bool relative ,
540
540
const char * full_path ,
541
541
struct cifs_sb_info * cifs_sb )
542
542
{
@@ -547,26 +547,24 @@ int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len,
547
547
int rc ;
548
548
int i ;
549
549
550
- /* Check that length it valid for unicode/non-unicode mode */
551
- if (!len || (unicode && ( len % 2 ) )) {
550
+ /* Check that length it valid */
551
+ if (!len || (len % 2 )) {
552
552
cifs_dbg (VFS , "srv returned malformed symlink buffer\n" );
553
553
rc = - EIO ;
554
554
goto out ;
555
555
}
556
556
557
557
/*
558
- * Check that buffer does not contain UTF-16 null codepoint in unicode
559
- * mode or null byte in non-unicode mode because Linux cannot process
560
- * symlink with null byte.
558
+ * Check that buffer does not contain UTF-16 null codepoint
559
+ * because Linux cannot process symlink with null byte.
561
560
*/
562
- if ((unicode && UniStrnlen ((wchar_t * )buf , len /2 ) != len /2 ) ||
563
- (!unicode && strnlen (buf , len ) != len )) {
561
+ if (UniStrnlen ((wchar_t * )buf , len /2 ) != len /2 ) {
564
562
cifs_dbg (VFS , "srv returned null byte in native symlink target location\n" );
565
563
rc = - EIO ;
566
564
goto out ;
567
565
}
568
566
569
- smb_target = cifs_strndup_from_utf16 (buf , len , unicode , cifs_sb -> local_nls );
567
+ smb_target = cifs_strndup_from_utf16 (buf , len , true , cifs_sb -> local_nls );
570
568
if (!smb_target ) {
571
569
rc = - ENOMEM ;
572
570
goto out ;
@@ -621,7 +619,7 @@ int smb2_parse_native_symlink(char **target, const char *buf, unsigned int len,
621
619
}
622
620
623
621
static int parse_reparse_symlink (struct reparse_symlink_data_buffer * sym ,
624
- u32 plen , bool unicode ,
622
+ u32 plen ,
625
623
struct cifs_sb_info * cifs_sb ,
626
624
const char * full_path ,
627
625
struct cifs_open_info_data * data )
@@ -641,7 +639,6 @@ static int parse_reparse_symlink(struct reparse_symlink_data_buffer *sym,
641
639
return smb2_parse_native_symlink (& data -> symlink_target ,
642
640
sym -> PathBuffer + offs ,
643
641
len ,
644
- unicode ,
645
642
le32_to_cpu (sym -> Flags ) & SYMLINK_FLAG_RELATIVE ,
646
643
full_path ,
647
644
cifs_sb );
@@ -696,7 +693,7 @@ static int parse_reparse_wsl_symlink(struct reparse_wsl_symlink_data_buffer *buf
696
693
int parse_reparse_point (struct reparse_data_buffer * buf ,
697
694
u32 plen , struct cifs_sb_info * cifs_sb ,
698
695
const char * full_path ,
699
- bool unicode , struct cifs_open_info_data * data )
696
+ struct cifs_open_info_data * data )
700
697
{
701
698
struct cifs_tcon * tcon = cifs_sb_master_tcon (cifs_sb );
702
699
@@ -710,7 +707,7 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
710
707
case IO_REPARSE_TAG_SYMLINK :
711
708
return parse_reparse_symlink (
712
709
(struct reparse_symlink_data_buffer * )buf ,
713
- plen , unicode , cifs_sb , full_path , data );
710
+ plen , cifs_sb , full_path , data );
714
711
case IO_REPARSE_TAG_LX_SYMLINK :
715
712
return parse_reparse_wsl_symlink (
716
713
(struct reparse_wsl_symlink_data_buffer * )buf ,
@@ -744,7 +741,7 @@ int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb,
744
741
745
742
buf = (struct reparse_data_buffer * )((u8 * )io +
746
743
le32_to_cpu (io -> OutputOffset ));
747
- return parse_reparse_point (buf , plen , cifs_sb , full_path , true, data );
744
+ return parse_reparse_point (buf , plen , cifs_sb , full_path , data );
748
745
}
749
746
750
747
static bool wsl_to_fattr (struct cifs_open_info_data * data ,
0 commit comments