Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102806551
D31530.id93660.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
D31530.id93660.diff
View Options
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -489,6 +489,7 @@
MPASS((cnp->cn_flags & EMPTYPATH) != 0);
MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0);
+ ndp->ni_resflags |= NIRES_EMPTYPATH;
error = namei_setup(ndp, &dp, &pwd);
if (error != 0) {
namei_cleanup_cnp(cnp);
@@ -501,7 +502,6 @@
ndp->ni_vp = dp;
namei_cleanup_cnp(cnp);
pwd_drop(pwd);
- ndp->ni_resflags |= NIRES_EMPTYPATH;
NDVALIDATE(ndp);
if ((cnp->cn_flags & LOCKLEAF) != 0) {
VOP_LOCK(dp, (cnp->cn_flags & LOCKSHARED) != 0 ?
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
@@ -2438,8 +2438,12 @@
AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH) | LOCKSHARED | LOCKLEAF |
AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td);
- if ((error = namei(&nd)) != 0)
+ if ((error = namei(&nd)) != 0) {
+ if (error == ENOTDIR &&
+ (nd.ni_resflags & NIRES_EMPTYPATH) != 0)
+ error = kern_fstat(td, fd, sbp);
return (error);
+ }
error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED, td);
if (error == 0) {
if (__predict_false(hook != NULL))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 10:37 AM (10 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14696171
Default Alt Text
D31530.id93660.diff (1 KB)
Attached To
Mode
D31530: fstatat(2): handle non-vnode file descriptors for AT_EMPTY_PATH
Attached
Detach File
Event Timeline
Log In to Comment