From nobody Tue Jan 07 02:46:37 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 4YRwRd6Cmrz5kfdY; Tue, 07 Jan 2025 02:46:37 +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 4YRwRd5hpjz4QLg; Tue, 7 Jan 2025 02:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217997; 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=FhQ2Wmu+hfdIDLERfDtgP0V4qWGIF0LOncXxNzJqY6U=; b=Jzg8quGovZLH27923htU4UcurLgkMWiIV5doQAU66eBHfvAqUjzD+IyZ8PlEDKvg7yk/w9 7a60q3/MV7hkz66ueEAAGr8nQiScZnpVjU7tT3H6fSqrOh3ItcUod+nZTzgVbftrUy0vGl gl/yXPjysYCkgcP+Y1knrbSqTU74DRo6kU70pYP+gNsC0qiNtrRhUN/uRNHhFswvYJG0eZ Zu8D8bFumdVCv65z0uMxb19itlU84mx9Q2gtmHgt13jfIrNR59l6oKuz7nZFcoXC5meD+Y Z0hcKFWOv5ya77uKt8gzt0hKVoHz5414UBeEzwN94geAg+LyJ+jO6Ba0ESfUhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217997; 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=FhQ2Wmu+hfdIDLERfDtgP0V4qWGIF0LOncXxNzJqY6U=; b=uwa6giXsxwG+zrk5kVI8No1tdmoYEgmLCP06aCeGaRF8WIjvbfqFMS+Yez8CIn2CuyxbiW ax2ov0CmNSjrwSH/MUizOLYfxkBH0RcIp3+h0cPi9rpPiW2gyvXfCf1qhYgjP0+sd8TBv2 OxiG/n4SqYsTBSR0FZnXbhYAHGomx0l8MRyi6H/TSbd7pZzoeGj6cjDzrobxoX+6Aba4CQ iqYZKSLmExkNmJcDZ4u4n7D5MEaV9ONUW+oaDlsQoHN4RAX3CJWSFPsCoE3Od7HmIln55/ b0xzTyEbRk33GOGb5IkmRrEWwg0GLIzitoBBEh+wFPwMRFT9cRLKZqV7yh0xTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736217997; a=rsa-sha256; cv=none; b=A1O/BIwOrtThIUYNOPvZSA4IJsqPxovUxrbjrexInExmDJeCz2nhWvqlJUW8gTUlLmkTjV i9Awbcr5kUui5KIeF3WQTgjL1XBgtQ27+dZL2tbxiBWcsOz5yPS7Ok0sbzBGq4nCHcW7fm TPJVUDn/59btS95g/FHswqk7n49cgLUqubb27BAYmS90w8mS0Yr0vPREzXirXdf2vKpDIT GLFJaZ0gk/8IulqS+FT9l5dDqrC+05Ezhc6Z/d6zKPeUUe63gxeNvdWo4ZsFgpbEFngWKy gask7MQ6L7NwrlkkgqDvi7zxLdqM0nIc8FnkaqxHucrc4cx+hUsyIhnBR3myHA== 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 4YRwRd528kzrqH; Tue, 07 Jan 2025 02:46:37 +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 5072kbp6084164; Tue, 7 Jan 2025 02:46:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072kbhR084159; Tue, 7 Jan 2025 02:46:37 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:46:37 GMT Message-Id: <202501070246.5072kbhR084159@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: 749b3b2c0629 - main - path_test: adjust test for open(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: 749b3b2c0629f44f6b0044992dfb2ce5ac7e562b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=749b3b2c0629f44f6b0044992dfb2ce5ac7e562b commit 749b3b2c0629f44f6b0044992dfb2ce5ac7e562b Author: Konstantin Belousov AuthorDate: 2025-01-06 22:07:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-07 02:46:19 +0000 path_test: adjust test for open(O_PATH | O_CREAT) Instead of failing, it must succeed now. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48332 --- tests/sys/file/path_test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index 911c7c7075f0..b3b8b7cebd4d 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -684,10 +684,14 @@ ATF_TC_BODY(path_io, tc) size_t page_size; int error, fd, pathfd, sd[2]; - /* It shouldn't be possible to create new files with O_PATH. */ + /* It is allowed to create new files with O_PATH. */ snprintf(path, sizeof(path), "path_io.XXXXXX"); ATF_REQUIRE_MSG(mktemp(path) == path, FMT_ERR("mktemp")); - ATF_REQUIRE_ERRNO(ENOENT, open(path, O_PATH | O_CREAT, 0600) < 0); + pathfd = open(path, O_PATH | O_CREAT, 0600); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open(O_PATH|O_CREAT)")); + /* Ensure that this is indeed O_PATH fd */ + ATF_REQUIRE_ERRNO(EBADF, write(pathfd, path, strlen(path)) == -1); + CHECKED_CLOSE(pathfd); /* Create a non-empty file for use in the rest of the tests. */ mktfile(path, "path_io.XXXXXX");