server/rump_fs: skip . and .. directory elements

Do not return elements for '.' and '..' during directory reads.

Fixes #1998
This commit is contained in:
Emery Hemingway 2016-06-06 09:39:51 +02:00 committed by Christian Helmuth
parent 56890733af
commit f06087625f

View File

@ -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)