Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24895
b: refs/heads/master
c: 094e320
h: refs/heads/master
i:
  24893: 890a2fb
  24891: 323c10c
  24887: 8195b20
  24879: 666027a
  24863: bbfb9e3
  24831: f349d84
v: v3
  • Loading branch information
OGAWA Hirofumi authored and Linus Torvalds committed Mar 31, 2006
1 parent 3466e9b commit aed9b2c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4e364e865b382f9d99c7fc230ec2ce7df21257a
refs/heads/master: 094e320d761dae5816d8faa695b0509eea79c108
15 changes: 1 addition & 14 deletions trunk/fs/msdos/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
#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[] = "+=,; ";
Expand All @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down
18 changes: 0 additions & 18 deletions trunk/fs/vfat/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit aed9b2c

Please sign in to comment.