From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 27 23:40:17 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79A6216A41F for ; Tue, 27 Sep 2005 23:40:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F33F943D53 for ; Tue, 27 Sep 2005 23:40:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j8RNeG1A029511 for ; Tue, 27 Sep 2005 23:40:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j8RNeGvQ029510; Tue, 27 Sep 2005 23:40:16 GMT (envelope-from gnats) Resent-Date: Tue, 27 Sep 2005 23:40:16 GMT Resent-Message-Id: <200509272340.j8RNeGvQ029510@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Micah Lieske Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA34416A41F for ; Tue, 27 Sep 2005 23:34:35 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D0F843D48 for ; Tue, 27 Sep 2005 23:34:35 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j8RNYZPL057325 for ; Tue, 27 Sep 2005 23:34:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j8RNYZvK057324; Tue, 27 Sep 2005 23:34:35 GMT (envelope-from nobody) Message-Id: <200509272334.j8RNYZvK057324@www.freebsd.org> Date: Tue, 27 Sep 2005 23:34:35 GMT From: Micah Lieske To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: misc/86655: [patch] msdosfs incorrectly handles NT 8.3 capitalization X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 23:40:17 -0000 >Number: 86655 >Category: misc >Synopsis: [patch] msdosfs incorrectly handles NT 8.3 capitalization >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 27 23:40:16 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Micah Lieske >Release: 5.4-RELEASE-p7 >Organization: >Environment: FreeBSD trisha.eidolonworld 5.4-RELEASE-p7 FreeBSD 5.4-RELEASE-p7 #0: Fri Sep 9 19:10:20 PDT 2005 root@trisha.eidolonworld:/usr/obj/usr/src/sys/TRISHA i386 >Description: If I create the files a.txt, B.txt, C.TXT and d.TXT in Win2K or XP (and probably any NT based windows) on a FAT partition or floppy an ls in FreeBSD will display the names as a.txt, b.txt, C.TXT, and d.txt. This only applies to files that fit the 8.3 limitations and doesn't apply to long file names. >How-To-Repeat: Create the files named above in an NT based windows and save to a FAT partion or floppy disk. Mount the partition/disk in FreeBSD and do an ls. >Fix: The functions dos2unixfn calls dos2unixchr seperately for the base name and the extension but passes dos2unixchr the capitalization flags for both base and extension. The following patch passes only LCASE_BASE when converting the base, and LCASE_EXT when converting the extension. Contact me if this form mangled the patch too much (sorry, not sure how I should attach it using the web form). --- msdosfs_conv.c Tue Sep 27 14:41:06 2005 +++ msdosfs_conv.patch.c Tue Sep 27 16:29:54 2005 @@ -436,7 +436,7 @@ * Copy the name portion into the unix filename string. */ for (i = 8; i > 0 && *dn != ' ';) { - c = dos2unixchr((const u_char **)&dn, &i, lower, pmp); + c = dos2unixchr((const u_char **)&dn, &i, lower & LCASE_BASE, pmp); if (c & 0xff00) { *un++ = c >> 8; thislong++; @@ -454,7 +454,7 @@ *un++ = '.'; thislong++; for (i = 3; i > 0 && *dn != ' ';) { - c = dos2unixchr((const u_char **)&dn, &i, lower, pmp); + c = dos2unixchr((const u_char **)&dn, &i, lower & LCASE_EXT, pmp); if (c & 0xff00) { *un++ = c >> 8; thislong++; >Release-Note: >Audit-Trail: >Unformatted: