Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Sep 2005 23:34:35 GMT
From:      Micah Lieske <micahjon@ywave.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/86655: [patch] msdosfs incorrectly handles NT 8.3 capitalization
Message-ID:  <200509272334.j8RNYZvK057324@www.freebsd.org>
Resent-Message-ID: <200509272340.j8RNeGvQ029510@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509272334.j8RNYZvK057324>