Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162930644
D21634.id62029.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
D21634.id62029.diff
View Options
Index: lib/libc/sys/open.2
===================================================================
--- lib/libc/sys/open.2
+++ lib/libc/sys/open.2
@@ -419,6 +419,11 @@
.It Bq Er EISDIR
The named file is a directory, and the arguments specify
it is to be modified.
+.It Bq Er EISDIR
+The named file is a directory, and the flags specified
+.Dv O_CREAT
+without
+.Dv O_DIRECTORY .
.It Bq Er EROFS
The named file resides on a read-only file system,
and the file is to be modified.
Index: sys/kern/vfs_vnops.c
===================================================================
--- sys/kern/vfs_vnops.c
+++ sys/kern/vfs_vnops.c
@@ -343,14 +343,17 @@
return (EMLINK);
if (vp->v_type == VSOCK)
return (EOPNOTSUPP);
- if (vp->v_type != VDIR && fmode & O_DIRECTORY)
- return (ENOTDIR);
- accmode = 0;
- if (fmode & (FWRITE | O_TRUNC)) {
- if (vp->v_type == VDIR)
+ if (vp->v_type == VDIR) {
+ if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT ||
+ (fmode & (FWRITE | O_TRUNC)) != 0)
return (EISDIR);
- accmode |= VWRITE;
+ } else {
+ if ((fmode & O_DIRECTORY) != 0)
+ return (ENOTDIR);
}
+ accmode = 0;
+ if ((fmode & (FWRITE | O_TRUNC)) != 0)
+ accmode |= VWRITE;
if (fmode & FREAD)
accmode |= VREAD;
if (fmode & FEXEC)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 19, 10:19 AM (19 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35230752
Default Alt Text
D21634.id62029.diff (1 KB)
Attached To
Mode
D21634: Return EISDIR when directory is opened with O_CREAT without O_DIRECTORY.
Attached
Detach File
Event Timeline
Log In to Comment