Re: [PATCH] VFAT fixes.

Albert D. Cahalan (acahalan@cs.uml.edu)
Fri, 15 Jan 1999 02:09:17 -0500 (EST)


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/