The curious case of O_DIRECTORY|O_CREAT
The curious case of O_DIRECTORY|O_CREAT
Posted Mar 27, 2023 23:08 UTC (Mon) by mpr22 (subscriber, #60784)In reply to: The curious case of O_DIRECTORY|O_CREAT by jhoblitt
Parent article: The curious case of O_DIRECTORY|O_CREAT
opendir(3) is implemented on top of open(2), and the man page for open(2) on my Linux system says:
>O_DIRECTORY
>
>If pathname is not a directory, cause the open to fail. This flag was added in kernel version 2.1.126, to avoid denial-of-service problems if opendir(3) is called on a FIFO or tape device.
