Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145629813
D55302.id171977.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55302.id171977.diff
View Options
diff --git a/lib/libsys/open.2 b/lib/libsys/open.2
--- a/lib/libsys/open.2
+++ b/lib/libsys/open.2
@@ -72,11 +72,18 @@
.Fn open
function except in the case where the
.Fa path
-specifies a relative path.
+specifies a relative path or the
+.Va O_EMPTY_PATH
+flag is specified.
For
.Fn openat
and relative
.Fa path ,
+when
+.Fa fd
+references directory and without the
+.Va O_EMPTY_PATH
+flag,
the file to be opened is determined relative to the directory
associated with the file descriptor
.Fa fd
@@ -104,6 +111,14 @@
.Fa fd
argument.
.Pp
+When
+.Fn openat
+is called with the
+.Fa fd
+argument that does not reference a directory, the call fails unless
+.Va O_EMPTY_PATH
+flag is specified, see below.
+.Pp
In
.Xr capsicum 4
capability mode,
@@ -421,9 +436,11 @@
call.
.Pp
.Dv O_PATH
-returns a file descriptor that can be used as a directory file descriptor for
+returns a file descriptor that can be used as the first argument for
.Fn openat
-and other system calls taking a file descriptor argument, like
+and other filesystem-related system calls collectively named
+.Fn *at
+taking a file descriptor argument, like
.Xr fstatat 2
and others.
The other functionality of the returned file descriptor is limited to
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 23, 9:37 AM (6 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28806517
Default Alt Text
D55302.id171977.diff (1 KB)
Attached To
Mode
D55302: open.2: stop making impression that fd must be directory
Attached
Detach File
Event Timeline
Log In to Comment