summaryrefslogtreecommitdiff
path: root/src/dirent/fdopendir.c
AgeCommit message (Collapse)AuthorLines
2019-02-07fail fdopendir for O_PATH file descriptorsRich Felker-0/+4
fdopendir is specified to fail with EBADF if the file descriptor passed is not open for reading. while O_PATH is an extension and arguably exempt from this requirement, it's used, albeit incompletely, to implement O_SEARCH, and fdopendir should fail when passed an O_SEARCH file descriptor. the new check is performed after fstat so that we don't have to consider the possibility that the fd is invalid. an alternate solution would be attempting to pre-fill the buffer using getdents, which would fail with EBADF for us, but that seems more complex and error-prone and involves either code duplication or refactoring, so the simple fix with an additional inexpensive syscall is what I've made for now.
2013-12-12include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy-2/+0
2011-07-21fix errno value when fdopendir is given an invalid file descriptorRich Felker-1/+4
this resolves an issue reported by Vasiliy Kulikov
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+26