Re: fdopendir on non-directory

2009-10-18 Thread Roland McGrath
IMHO that behavior for file_name_lookup_under is clearly wrong, and perhaps dangerously so. The original point of using something that resolves to dir_lookup("/",...) rather than a lookup of "." is that it should not require actual lookup permission, but should still require that it be a directory

Re: fdopendir on non-directory

2009-10-17 Thread Samuel Thibault
Hello, Roland McGrath, le Tue 06 Oct 2009 20:06:27 -0700, a écrit : > fdopendir uses __file_name_lookup_under (port, "/", O_DIRECTORY | O_NOTRANS, > 0) > which I think is exactly right. Mmm, I'd say "almost". That line means starting from directory one should look at directory /, and what __hur

fdopendir on non-directory

2009-10-06 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Another bug detected by gnulib: fdopendir(creat("file",0600)) returns a DIR* pointer rather than NULL; subsequent attempts to use that pointer with readdir() then fail with ENOTDIR. But POSIX requires that the fdopendir fail with ENOTDIR up front. -

Re: fdopendir on non-directory

2009-10-06 Thread Roland McGrath
fdopendir uses __file_name_lookup_under (port, "/", O_DIRECTORY | O_NOTRANS, 0) which I think is exactly right. Something has gotten broken lower down if that is not doing it. Thanks, Roland