mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
server/rump_fs: skip . and .. directory elements
Do not return elements for '.' and '..' during directory reads. Fixes #1998
This commit is contained in:
parent
56890733af
commit
f06087625f
@ -165,11 +165,17 @@ class File_system::Directory : public Node
|
||||
void *current, *end;
|
||||
for (current = buf, end = &buf[bytes];
|
||||
current < end;
|
||||
current = _DIRENT_NEXT((dirent *)current), i++)
|
||||
if (i == index) {
|
||||
dent = (dirent *)current;
|
||||
break;
|
||||
current = _DIRENT_NEXT((dirent *)current))
|
||||
{
|
||||
struct ::dirent *d = (dirent*)current;
|
||||
if (strcmp(".", d->d_name) && strcmp("..", d->d_name)) {
|
||||
if (i == index) {
|
||||
dent = d;
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
} while(bytes && !dent);
|
||||
|
||||
if (!dent)
|
||||
|
Loading…
Reference in New Issue
Block a user