On 4/10/25 09:59, Nelson H. F. Beebe wrote:
I tried that, and gcc reported that O_SEARCH is unknown, and suggested
``did you mean 'O_EXCL'?''.

Oh, I thought DragonflyBSD was like other BSDs. My mistake; <https://leaf.dragonflybsd.org/cgi/web-man?command=openat&section=ANY> says it has neither O_SEARCH nor O_PATH.

In that case please use O_RDONLY instead of O_SEARCH.


 I made that change and ran the test:

        % gcc dfly-openat-bug-2.c && ./a.out
        d/f: File exists

        % ls -Rl d
        d:
        total 0

The "File exists" report certainly seems like a red herring; one would
have expected "Directory not writable" or "File cannot be created."

Indeed, if you get the same result with O_RDONLY instead of O_SEARCH it's a clear bug, one that gzip cannot work around reliably as far as I can see.


My substitution of O_EXCL may have been incorrect, and I don't find
O_SEARCH documented in "man openat" on CentOS 7 or Ubuntu 24.

I can certainly post a note about this on the DragonflyBSD mailing
list, but will wait until I hear agreement from you.



Reply via email to