]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] fat: kill reserved names
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Fri, 31 Mar 2006 10:30:53 +0000 (02:30 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 31 Mar 2006 20:18:55 +0000 (12:18 -0800)
Since these names on old MSDOS is used as device, so, current fat driver
doesn't allow a user to create those names.  But many OSes and even Windows
can create those names actually, now.

This patch removes the reserved name check.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/msdos/namei.c
fs/vfat/namei.c

index 626a367bcd81145cb6dd4385b098755b58bf2f38..5b76ccd19e3fc25489af2d3ebc1addb587994c96 100644 (file)
 #include <linux/msdos_fs.h>
 #include <linux/smp_lock.h>
 
-/* MS-DOS "device special files" */
-static const unsigned char *reserved_names[] = {
-       "CON     ", "PRN     ", "NUL     ", "AUX     ",
-       "LPT1    ", "LPT2    ", "LPT3    ", "LPT4    ",
-       "COM1    ", "COM2    ", "COM3    ", "COM4    ",
-       NULL
-};
-
 /* Characters that are undesirable in an MS-DOS file name */
 static unsigned char bad_chars[] = "*?<>|\"";
 static unsigned char bad_if_strict_pc[] = "+=,; ";
@@ -40,7 +32,6 @@ static int msdos_format_name(const unsigned char *name, int len,
         */
 {
        unsigned char *walk;
-       const unsigned char **reserved;
        unsigned char c;
        int space;
 
@@ -127,11 +118,7 @@ static int msdos_format_name(const unsigned char *name, int len,
        }
        while (walk - res < MSDOS_NAME)
                *walk++ = ' ';
-       if (!opts->atari)
-               /* GEMDOS is less stupid and has no reserved names */
-               for (reserved = reserved_names; *reserved; reserved++)
-                       if (!strncmp(res, *reserved, 8))
-                               return -EINVAL;
+
        return 0;
 }
 
index ef46939c0c1a9cdaf1fd643806d14bad77270743..a56cec3be5f09cf9be5e81d28065c6923962ec69 100644 (file)
@@ -185,24 +185,6 @@ static int vfat_valid_longname(const unsigned char *name, unsigned int len)
                return -EINVAL;
        if (len >= 256)
                return -ENAMETOOLONG;
-
-       /* MS-DOS "device special files" */
-       if (len == 3 || (len > 3 && name[3] == '.')) {  /* basename == 3 */
-               if (!strnicmp(name, "aux", 3) ||
-                   !strnicmp(name, "con", 3) ||
-                   !strnicmp(name, "nul", 3) ||
-                   !strnicmp(name, "prn", 3))
-                       return -EINVAL;
-       }
-       if (len == 4 || (len > 4 && name[4] == '.')) {  /* basename == 4 */
-               /* "com1", "com2", ... */
-               if ('1' <= name[3] && name[3] <= '9') {
-                       if (!strnicmp(name, "com", 3) ||
-                           !strnicmp(name, "lpt", 3))
-                               return -EINVAL;
-               }
-       }
-
        return 0;
 }