lkml.org 
[lkml]   [1999]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] VFAT fixes.

Alexander Viro writes:

> * Due to the way longname->shortname conversion was implemented
> attempt to create a file or directory called ".\xf6" (any
> skippable symbols + 0xe5 or 0xf6 + anything else) resulted in
> directory entry used by active inode, but free from the
> msdos/vfat point of view ("\xf6" in this case). Fixed.


I think you added a bug here, or at least made the short names less
compatible with DOS.


- if (c < ' ' || c == ':' || c == '\\') return -EINVAL;
- if ((walk == name) && (c == 0xE5)) c = 0x05;
+ if (c < ' '|| c==':') return -EINVAL;


If you do the above, DOS won't see files starting with 0xE5 correctly.
DOS translates 0xE5 to 0x05 for the first character of a filename.
DOS also translates back as needed. Only the first character changes.


- if (baselen == 3) {
- for (reserved = reserved3_names; *reserved; reserved++)
- if (!strnicmp(name,*reserved,baselen)) return -EINVAL;
- } else if (baselen == 4) {
- for (reserved = reserved4_names; *reserved; reserved++)
- if (!strnicmp(name,*reserved,baselen)) return -EINVAL;


Hopefully reserved names are handled elsewhere.


+ /* Yes, it can happen. ".\xe5" would do it. */
+ if (IS_FREE(base))
+ base[0]='_';


base[0] ought to become 0x05, not '_'

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.078 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site