Commit 76e4b1f8 authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Linus Torvalds

[PATCH] Fixed the handling of file name containing 0x05 on vfat

This patch fixes the behavior of vfatfs when the file name contains 0x05.
parent 76e7b902
...@@ -271,13 +271,10 @@ int fat_search_long(struct inode *inode, const char *name, int name_len, ...@@ -271,13 +271,10 @@ int fat_search_long(struct inode *inode, const char *name, int name_len,
long_slots = 0; long_slots = 0;
} }
for (i = 0; i < 8; i++) { memcpy(work, de->name, sizeof(de->name));
/* see namei.c, msdos_format_name */ /* see namei.c, msdos_format_name */
if (de->name[i] == 0x05) if (work[0] == 0x05)
work[i] = 0xE5; work[0] = 0xE5;
else
work[i] = de->name[i];
}
for (i = 0, j = 0, last_u = 0; i < 8;) { for (i = 0, j = 0, last_u = 0; i < 8;) {
if (!work[i]) break; if (!work[i]) break;
chl = fat_shortname2uni(nls_disk, &work[i], 8 - i, chl = fat_shortname2uni(nls_disk, &work[i], 8 - i,
...@@ -478,13 +475,10 @@ static int fat_readdirx(struct inode *inode, struct file *filp, void *dirent, ...@@ -478,13 +475,10 @@ static int fat_readdirx(struct inode *inode, struct file *filp, void *dirent,
dotoffset = 1; dotoffset = 1;
} }
for (i = 0; i < 8; i++) { memcpy(work, de->name, sizeof(de->name));
/* see namei.c, msdos_format_name */ /* see namei.c, msdos_format_name */
if (de->name[i] == 0x05) if (work[0] == 0x05)
work[i] = 0xE5; work[0] = 0xE5;
else
work[i] = de->name[i];
}
for (i = 0, j = 0, last = 0, last_u = 0; i < 8;) { for (i = 0, j = 0, last = 0, last_u = 0; i < 8;) {
if (!(c = work[i])) break; if (!(c = work[i])) break;
chl = fat_shortname2uni(nls_disk, &work[i], 8 - i, chl = fat_shortname2uni(nls_disk, &work[i], 8 - i,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment