mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] fat: kill reserved names
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e4e364e865
commit
094e320d76
2 changed files with 1 additions and 32 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue