From nobody Tue May 02 15:12:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9k900Fd6z494GX; Tue, 2 May 2023 15:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9k8z6PWmz4FYj; Tue, 2 May 2023 15:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683040371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UKoBdg+HQaXykZF2yJIZkV12X5nbiw90PT5xCT0kGyA=; b=sJK+XEYwioocHvCv5VWviuMGMho6FM5v7YiRrlQxhSa9zfaPJwBKg04QvceaKO1eqXaET+ czeiIDAUMJN6GwSCWADw7cFb5suous+k8LIiUpyw62Qf6lCXb5DsX3kjUG+3OgKUZn5UOd PaZUd4D/Rl5dr2x9l9JsdAIBB1fqGlANjCV5aaPJJIKk1P9/dUymM2fFxnj9qko76/0y5x kwgyFSEqvS057zCFJ2BgqQK1HcSlfrsz16iRnk4IEwSXAsdQqCmzY5t5c7M/sUfAwURmrQ eRoM9AgBIA39e1ui1FGHK9f0Q/ymuzz9oYmJ6ABG1QqmBnVxOZgjUEfzgSusfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683040371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UKoBdg+HQaXykZF2yJIZkV12X5nbiw90PT5xCT0kGyA=; b=gDJ/2ce2avDMyHS/G0QdJCSGVa/VtAab1zVWrt39EN/0az5XyeYPfuOP/5Mp17+SJp0qdH /mF2muDDTa+h9/nLNnWW3/HGw5u6NW4OVS5QLirwcRbjhc1qvhmzu3dxH6pSpXAUo/NnOE iRuN5clcZAHC3Io5fa+Ge4mzHXTZceHSPYt6DpL0xP4qsGPTtnVrlzcJ8ZfE8FFn3qqjrj yf1mHYgZhveqrmlc1HK/o8HXaTlgaW2ctbwaDbfPuKSBWg7y4lBco3KwM19gGV4HEWgcYi gPBxOP8egLuPgMliwc0HrcVAYqvz06fz9kJqHxBxWGHYgiNH2m7nORnQNz9FPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683040371; a=rsa-sha256; cv=none; b=S0W81LV0XGpfKGQYxV4h/Q5+sbykGA1NNlirpLqG6Frs0VzRC0BdKREhEZBDBMNPb8F1BS O8rgvG8+tSeRA/TJPo2X6djLB7Tl848QL0L2MOWWK5gu/utBA+eDme3b2M5lNJT5ZCZWl/ 0xkkbASE0NVQ/gf6WPCM8YeAO+1SiJY9emxs8XZjpz7nzgCuth1ZBhJ0D7Lg4RceWhrs2g DSzxqh/lTrpti7pWJwuEGZxT4IfVfptPu4ntQFHdhY8MwnkTOiUFrx4t9tPVDqe43gRQ3H 0ah9qF+DcJaSChJZFfMlj4RgnYrd/iUX2ww9nG5XkIo+/7yfDlgO2Qzd6XVMrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9k8z5QLczspP; Tue, 2 May 2023 15:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 342FCpxX056203; Tue, 2 May 2023 15:12:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342FCpbN056202; Tue, 2 May 2023 15:12:51 GMT (envelope-from git) Date: Tue, 2 May 2023 15:12:51 GMT Message-Id: <202305021512.342FCpbN056202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a1d71cebc05c - main - fstatat(2): restore AT_EMPTY_PATH handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1d71cebc05ccfeedf95f2db3e94b17270167888 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a1d71cebc05ccfeedf95f2db3e94b17270167888 commit a1d71cebc05ccfeedf95f2db3e94b17270167888 Author: Konstantin Belousov AuthorDate: 2023-05-02 15:11:39 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-02 15:11:39 +0000 fstatat(2): restore AT_EMPTY_PATH handling Fixes: cb858340dcbf214cc4c4d78dbb741620d7b3a252 Reported by: markj Sponsored by: The FreeBSD Foundation --- sys/kern/vfs_syscalls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 5c0a291e3b0b..d68af4ea4d51 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2438,8 +2438,12 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights); - 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); NDFREE_PNBUF(&nd); vput(nd.ni_vp);