diff options
author | kib <kib@FreeBSD.org> | 2008-05-05 14:05:23 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-05-05 14:05:23 +0000 |
commit | c697e6f360e231d276258ea22e73c4085eba3af9 (patch) | |
tree | e3620d7f991edaa6b2b475aa8d2dae909d6e29ec /lib/libc/gen/telldir.h | |
parent | 420af22bc1279dd3fef45a8fd4e575afb086e937 (diff) | |
download | FreeBSD-src-c697e6f360e231d276258ea22e73c4085eba3af9.zip FreeBSD-src-c697e6f360e231d276258ea22e73c4085eba3af9.tar.gz |
Do not read away the target directory entry when encountering deleted
files after a seekdir().
The seekdir shall set the position for the next readdir operation.
When the _readdir_unlocked() encounters deleted entry, dd_loc is
already advanced. Continuing the loop leads to premature read of
the target entry.
Submitted by: Marc Balmer <mbalmer at openbsd org>
Obtained from: OpenBSD
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/gen/telldir.h')
-rw-r--r-- | lib/libc/gen/telldir.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h index 4fb4cb6..ef930d2 100644 --- a/lib/libc/gen/telldir.h +++ b/lib/libc/gen/telldir.h @@ -59,7 +59,7 @@ struct _telldir { long td_loccnt; /* index of entry for sequential readdir's */ }; -struct dirent *_readdir_unlocked(DIR *); +struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); |