RELENG_5_2 ntfs mounting problem

From: Alexander Zagrebin <alexz_at_visp.ru>
Date: Fri, 12 Dec 2003 12:43:11 +0300
Hi!

The FreeBSD 5.2-RC has problem with russian (cyrillic) file names on NTFS 
volumes. 
If the file name is "ΤΕΣΤ" (hex: 0xd4 0xc5 0xd3 0xd4), then after mounting its 
name looks like 0xff 0xd4 0xff 0xc5 0xff 0xd3 0xff 0xd4, so file is 
inaccessible.
I reason is in function "wchar ntfs_u28" (file ntfs_subr.c).
This function returns value of outbuf (char), converted to wchar. The highest 
bit of russian characters (koi8-r encoding) is always 1, so this conversion 
works incorrectly (data type char is signed). 

This patch solves the problem.
=====================================================
--- ntfs_subr.c.orig    Fri Dec 12 12:00:31 2003
+++ ntfs_subr.c Fri Dec 12 11:47:32 2003
_at__at_ -2143,7 +2143,8 _at__at_
        struct ntfsmount *ntmp,
        wchar wc)
 {
-       char *p, *outp, inbuf[3], outbuf[3];
+       char *p, *outp, inbuf[3];
+       unsigned char outbuf[3];
        size_t ilen, olen;

        if (ntfs_iconv && ntmp->ntm_ic_u2l) {
=====================================================

Alexander Zagrebin
-- 
Received on Fri Dec 12 2003 - 09:30:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:33 UTC