From nobody Tue Jan 07 02:46:36 2025 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 4YRwRc5tMzz5kg1N; Tue, 07 Jan 2025 02:46:36 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRwRc5Lpdz4QLf; Tue, 7 Jan 2025 02:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217996; 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=OfT1ZseaU246fVZ9dw0n3SFnJXyooHj24QcR5kOM528=; b=RamlpWvgIw25ynAGaSzZtb4MNg5Sy2wWH8GiSUAjeyT3xq/dFDYnUtuxECdOXSO+zSeIiZ 48A86/IZfaUkyNsbtqKxrEklnRLTvWSxEuYjM9qbNx87bpVSWbyfwrdYEo+nK0dHHQA0yd 14UMUhpklEIAiE6T4YgQh/8aE726KyV/RNJWplOfqY6cSl7nnr6Wvu5NpVBXvJ4gWOzUNT 5DBcaYAqfa1p4WuwSGBWolXWtvC7i8jRX3itwDrs5Nl6AOko2yAbfAr9T/6kYp7b7spmTY iYkxgAmd7ib9ijEF8RkzCyRuBYtMimb1866IfjRqHK7CH3FavW+8dX3/qKEPzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217996; 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=OfT1ZseaU246fVZ9dw0n3SFnJXyooHj24QcR5kOM528=; b=OCnAYihnjF0v/H5bPMSjFzu1ONfqlonIw1OfCptktinN2nEodn/fCWy8wtRwe252MfkkH+ GW34wFVu2VV+GPhl9SWduvuQj3aWMFVp7x7zpL4hnG8P8IUdhueUBKo83MTk+rDsIm/bb4 MGT6tEY7yAEviXBMHx8JbA0QHB0zyhPEhZqRZdz4j5YTuBD7yC8m9lkYDt3uaR5Awbug67 bfl0l1Ys8N0HrfQpu8drk1PDtSMj2IYOQ0kZ2JJENULY/gHQ+2UHgbdctrFf6O9zge1qJy +Jt5wrYLuPslvTd9nbCDk4cXKfC9EQ//+kfoDKIrv2IlIMbfGWLfTtS0fdFgQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736217996; a=rsa-sha256; cv=none; b=dx/4KJkqolVr8AEsR3M0s0abTLBmWWYNotI8qtmTGtjdDiaIjpngF4JDJWOYtRfXep966o wDOsbQwCOgRtAGmoL7H1S+d1e+83JuvRI+LSLZkKgdmhd4JTICQwyFm3mTNoCVzgx+hW3f W4R/cBOPwF7m7FPDFes7HQUa5LgjIsGQOYFELC67lVvSbtu2nLOGPSsvCgb1zQOt09EuMw 2IwN9g5k8TwUVu/Lq7uf7UUI2qW+KJEyWJSZgciMM7aMH+m09x/x1eRzvMy3KB1fQjpvvK ihKyP9VBqPCKu74mBfjUzRqHOeWPpG5ytX7dUzfBSPJSi6ATxd2X3LlBufv9lA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YRwRc4fvgzrYV; Tue, 07 Jan 2025 02:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072kaIf084113; Tue, 7 Jan 2025 02:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072ka1a084110; Tue, 7 Jan 2025 02:46:36 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:46:36 GMT Message-Id: <202501070246.5072ka1a084110@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: cc0d806f63e8 - main - open(2): allow O_PATH | O_CREAT 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: cc0d806f63e833b9e011c0665905b2208b436c8b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cc0d806f63e833b9e011c0665905b2208b436c8b commit cc0d806f63e833b9e011c0665905b2208b436c8b Author: Konstantin Belousov AuthorDate: 2025-01-06 11:01:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-07 02:46:18 +0000 open(2): allow O_PATH | O_CREAT There is no reason to disallow creating the file opened for path. More, it might be a useful feature together with O_EXCL. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48332 --- sys/kern/vfs_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 7a1677c945e3..bbd67c2b0326 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1185,7 +1185,7 @@ openatfp(struct thread *td, int dirfd, const char *path, * except O_EXEC is ignored. */ if ((flags & O_PATH) != 0) { - flags &= ~(O_CREAT | O_ACCMODE); + flags &= ~O_ACCMODE; } else if ((flags & O_EXEC) != 0) { if (flags & O_ACCMODE) return (EINVAL);