Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166600596
D49717.id153371.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
D49717.id153371.diff
View Options
diff --git a/lib/libsys/fhopen.2 b/lib/libsys/fhopen.2
--- a/lib/libsys/fhopen.2
+++ b/lib/libsys/fhopen.2
@@ -74,7 +74,9 @@
.Xr open 2
system call.
All said flags are valid except for
-.Dv O_CREAT .
+.Dv O_CREAT
+and
+.Dv O_PATH .
.Pp
The
.Fn fhstat
@@ -113,9 +115,7 @@
.It Bq Er EINVAL
Calling
.Fn fhopen
-with
-.Dv O_CREAT
-set.
+with invalid flags set.
.It Bq Er ESTALE
The file handle
.Fa fhp
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -4663,7 +4663,8 @@
indx = -1;
fmode = FFLAGS(flags);
/* why not allow a non-read/write open for our lockd? */
- if (((fmode & (FREAD | FWRITE)) == 0) || (fmode & O_CREAT))
+ if ((fmode & (FREAD | FWRITE)) == 0 || (fmode & O_CREAT) != 0 ||
+ (fmode & O_PATH) != 0)
return (EINVAL);
error = copyin(u_fhp, &fhp, sizeof(fhp));
if (error != 0)
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -432,6 +432,9 @@
accmode_t accmode;
int error;
+ KASSERT((fmode & O_PATH) == 0 || (fmode & O_ACCMODE) == 0,
+ ("%s: O_PATH and O_ACCMODE are mutually exclusive", __func__));
+
if (vp->v_type == VLNK) {
if ((fmode & O_PATH) == 0 || (fmode & FEXEC) != 0)
return (EMLINK);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 15, 7:53 PM (5 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36795394
Default Alt Text
D49717.id153371.diff (1 KB)
Attached To
Mode
D49717: fhopen: Enable handling of O_PATH, fix some bugs
Attached
Detach File
Event Timeline
Log In to Comment