]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fstatat(2): handle non-vnode file descriptors for AT_EMPTY_PATH
authorKonstantin Belousov <kib@FreeBSD.org>
Fri, 13 Aug 2021 17:40:10 +0000 (20:40 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 13 Aug 2021 21:17:18 +0000 (00:17 +0300)
commit9446d9e88fd7b203fa50c015f29b636db5b1d52b
treeef06e5540a0d6ac7a41fafdd30360711ee8ef23b
parent6b25b4a73fbe56e15d094895b4c7acdb424ee80d
fstatat(2): handle non-vnode file descriptors for AT_EMPTY_PATH

Set NIRES_EMPTYPATH earlies, to have use of EMPTYPATH recorded even if
we are going to return error.  When namei_setup() refused to accept dirfd,
which is not of the vnode type, and indicated by ENOTDIR error return,
fall back to kern_fstat(dirfd).

Reported by: dchagin
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31530
sys/kern/vfs_lookup.c
sys/kern/vfs_syscalls.c