On 2026-06-09 18:11, Collin Funk wrote:
Could you not just open everything with O_RDONLY and then use fstat before calling read? You wouldn't get the protection from O_PATH, but that seems mostly okay with me.
O_RDONLY should work if we are not using the results from fstatat to decide whether to open the file at all. Is that the case here?
As I recall, there is a difference in how source and destination files are handled, and the answer may differ for destination files vs source.
