Page MenuHomeFreeBSD

open(2): allow O_PATH | O_CREAT
ClosedPublic

Authored by kib on Mon, Jan 6, 11:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 7, 12:31 PM
Unknown Object (File)
Tue, Jan 7, 12:29 PM
Unknown Object (File)
Tue, Jan 7, 12:29 PM
Unknown Object (File)
Tue, Jan 7, 12:28 PM
Unknown Object (File)
Tue, Jan 7, 12:27 PM
Unknown Object (File)
Tue, Jan 7, 12:26 PM
Unknown Object (File)
Tue, Jan 7, 7:47 AM
Unknown Object (File)
Tue, Jan 7, 7:19 AM
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 Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Mon, Jan 6, 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.Mon, Jan 6, 2:07 PM
This revision now requires review to proceed.Mon, Jan 6, 11:41 PM
markj added inline comments.
tests/sys/file/path_test.c
691

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.Tue, Jan 7, 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.Tue, Jan 7, 2:34 AM
This revision is now accepted and ready to land.Tue, Jan 7, 2:36 AM