]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Do not read away the target directory entry when encountering deleted
authorKonstantin Belousov <kib@FreeBSD.org>
Mon, 5 May 2008 14:05:23 +0000 (14:05 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Mon, 5 May 2008 14:05:23 +0000 (14:05 +0000)
commit90c68c179908dbcf47abce2b0efaed38edddb9bb
treee3620d7f991edaa6b2b475aa8d2dae909d6e29ec
parentf2db8876a099ed831554e53f62ed38613583dcf5
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
lib/libc/gen/readdir.c
lib/libc/gen/telldir.c
lib/libc/gen/telldir.h