misc/86655: [patch] msdosfs incorrectly handles NT 8.3 capitalization

Micah Lieske micahjon at ywave.com
Tue Sep 27 16:40:17 PDT 2005


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


More information about the freebsd-bugs mailing list