From owner-freebsd-current@FreeBSD.ORG Fri Dec 12 10:30:34 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3431A16A4CF; Fri, 12 Dec 2003 10:30:34 -0800 (PST) Received: from srv1.visp.ru (srv1.visp.ru [213.154.182.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B62943D37; Fri, 12 Dec 2003 10:30:32 -0800 (PST) (envelope-from alexz@visp.ru) Received: from alex2.visp.ru ([213.154.183.201] helo=bsd.home.local) by srv1.visp.ru with esmtp (Exim 3.36 #1) id 1AUs3a-000Pcm-00; Fri, 12 Dec 2003 21:30:30 +0300 Received: from localhost (localhost [127.0.0.1]) by bsd.home.local (8.12.10/8.12.10) with ESMTP id hBC9hCJ1022257; Fri, 12 Dec 2003 12:43:13 +0300 (MSK) (envelope-from alexz@visp.ru) From: Alexander Zagrebin To: freebsd-current@freebsd.org Date: Fri, 12 Dec 2003 12:43:11 +0300 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200312121243.11908.alexz@visp.ru> cc: fjoe@freebsd.org Subject: RELENG_5_2 ntfs mounting problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2003 18:30:34 -0000 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 @@ -2143,7 +2143,8 @@ 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 --