On 2/19/19 6:38 PM, James Youngman wrote:
> Thanks for this fix.
>
> But, I think the the code I originally I wrote here is broken in a way
> that's not completely fixed by your patch. The case is where the
> type of a file changes between directory and non-directory. The code
> as it is now w
Thanks for this fix.
But, I think the the code I originally I wrote here is broken in a way
that's not completely fixed by your patch. The case is where the
type of a file changes between directory and non-directory. The code
as it is now will issue an error whose message corresponds to ENOTDI
There is a small race condition between the previous stat call
and openat/fdopendir (which cannot be avoided): if the directory
got replaced by another file type, then openat would succeed but the
subsequent fdopendir would fail with ENOTDIR. Detect this earlier
by passing the O_DIRECTORY flag.
Fu