Page MenuHomeFreeBSD

open(2): allow O_PATH | O_CREAT
ClosedPublic

Authored by kib on Jan 6 2025, 11:03 AM.
Tags
None
Referenced Files
F113894794: D48332.id148806.diff
Sat, Apr 5, 5:53 AM
Unknown Object (File)
Sun, Mar 30, 3:53 PM
Unknown Object (File)
Mar 4 2025, 12:43 PM
Unknown Object (File)
Mar 1 2025, 9:32 PM
Unknown Object (File)
Feb 19 2025, 11:57 PM
Unknown Object (File)
Feb 18 2025, 12:56 PM
Unknown Object (File)
Feb 17 2025, 7:03 PM
Unknown Object (File)
Feb 12 2025, 4:58 PM
Subscribers

Details

Summary

There is no reason to disallow creating the file opened for path.
More, it might be a useful feature together with O_EXCL.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jan 6 2025, 11:03 AM

At least tests/sys/file/path_test.c:path_io will need to be updated.

This revision is now accepted and ready to land.Jan 6 2025, 2:07 PM
This revision now requires review to proceed.Jan 6 2025, 11:41 PM
markj added inline comments.
tests/sys/file/path_test.c
691 ↗(On Diff #148843)

Just for good measure, I'd verify that the descriptor really is an O_PATH descriptor. For example, read(pathfd) should fail.

This revision is now accepted and ready to land.Jan 7 2025, 2:10 AM
kib marked an inline comment as done.

Check that O_PATH|O_CREAT returns O_PATH-kind of fd.

This revision now requires review to proceed.Jan 7 2025, 2:34 AM
This revision is now accepted and ready to land.Jan 7 2025, 2:36 AM