[vlc-devel] [PATCH] access directory: try opening files as non blocking (fix #6940).

Rémi Denis-Courmont remi at remlab.net
Thu Jun 14 19:18:59 CEST 2012


Le jeudi 14 juin 2012 20:03:57 Tobias Güntner, vous avez écrit :
> Am 14.06.2012 17:05, schrieb Rémi Denis-Courmont:
> > Le jeudi 14 juin 2012 17:57:34 Francois Cartegnie, vous avez écrit :
> >> Le 14/06/2012 06:34, Rémi Denis-Courmont a écrit :
> >>> If we assume that non-blocking mode has no effects on directories and
> >>> regular files, then this is correct.
> >>> 
> >>> But the specification says not that it has no effects, but that it is
> >>> undefined :-(
> >> 
> >> What if we swap stat() & openat() calls ?
> > 
> > TOCTOU bug.
> 
> What if you use O_DIRECTORY instead of O_NONBLOCK?

That's Linux-specific. If we agree to ignore standards (which seems like the 
only option), then we might as well use O_NONBLOCK, which is probably more 
portable than O_DIRECTORY, and does not require further code changes.


-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list