mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
fs/fat: Fix pathnames using '..' that lead to the root directory
If we end up back in the root directory via a '..' directory entry, set
itr->is_root accordingly. Failing to do that gives spews like
"Invalid FAT entry" and being unable to access directory entries located
past the first cluster of the root directory.
Fixes: 8eafae209c
("fat/fs: convert to directory iterators")
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
This commit is contained in:
parent
edce588a45
commit
8df8731474
1 changed files with 2 additions and 1 deletions
|
@ -710,13 +710,14 @@ static void fat_itr_child(fat_itr *itr, fat_itr *parent)
|
|||
itr->fsdata = parent->fsdata;
|
||||
if (clustnum > 0) {
|
||||
itr->clust = clustnum;
|
||||
itr->is_root = 0;
|
||||
} else {
|
||||
itr->clust = parent->fsdata->root_cluster;
|
||||
itr->is_root = 1;
|
||||
}
|
||||
itr->dent = NULL;
|
||||
itr->remaining = 0;
|
||||
itr->last_cluster = 0;
|
||||
itr->is_root = 0;
|
||||
}
|
||||
|
||||
static void *next_cluster(fat_itr *itr)
|
||||
|
|
Loading…
Reference in a new issue