The curious case of O_DIRECTORY|O_CREAT
The curious case of O_DIRECTORY|O_CREAT
Posted Mar 29, 2023 0:46 UTC (Wed) by NYKevin (subscriber, #129325)In reply to: The curious case of O_DIRECTORY|O_CREAT by zev
Parent article: The curious case of O_DIRECTORY|O_CREAT
> Not if they have different metadata (permissions or ownership, which could arise with multiple processes accessing /tmp, say).
A can fstat it after opening it, if A cares.
> Also, is there any guarantee B even left it empty and didn't also start populating it with things that would conflict with A's plans for it?
If the permissions on the original dir allow it, then B can do this anyway. If not, then see previous reply.
