From owner-svn-src-stable-12@freebsd.org Thu Feb 6 18:40:37 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5ECD233B8A; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6gn5sFQz4Qfl; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C46261FF8D; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016IebJa012254; Thu, 6 Feb 2020 18:40:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Iebmd012253; Thu, 6 Feb 2020 18:40:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002061840.016Iebmd012253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 6 Feb 2020 18:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357634 - in stable: 11/contrib/netbsd-tests/lib/libc/c063 12/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/contrib/netbsd-tests/lib/libc/c063 12/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:40:38 -0000 Author: kevans Date: Thu Feb 6 18:40:37 2020 New Revision: 357634 URL: https://svnweb.freebsd.org/changeset/base/357634 Log: MFC r357195, r357556: O_SEARCH test fixes r357195: netbsd-tests: libc: use correct modes in O_SEARCH tests The current code clearly intended for these to be octal based on the values used, but the octal prefix was forgotten. Add it now for correctness, but note that we don't currently execute these tests. This has been submitted upstream as misc/54902, so I've omitted the standard FreeBSD markers that we tend to put into netbsd-tests for upstream-candidate identification. r357556: O_SEARCH tests: plug trivial fd leak Coverity correctly reports this as a resource leak. It's an admittedly minor one, but plug it anyways. This has been submitted upstream as misc/54939. Modified: stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:37:38 2020 (r357633) +++ stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:40:37 2020 (r357634) @@ -79,7 +79,7 @@ ATF_TC_BODY(o_search_perm1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == EACCES); @@ -109,12 +109,12 @@ ATF_TC_BODY(o_search_root_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -141,12 +141,12 @@ ATF_TC_BODY(o_search_unpriv_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -173,7 +173,7 @@ ATF_TC_BODY(o_search_perm2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == -1); ATF_REQUIRE(errno == EACCES); @@ -202,11 +202,11 @@ ATF_TC_BODY(o_search_root_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -232,11 +232,11 @@ ATF_TC_BODY(o_search_unpriv_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -260,6 +260,7 @@ ATF_TC_BODY(o_search_notdir, tc) ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == ENOTDIR); + ATF_REQUIRE(close(dfd) == 0); } ATF_TP_ADD_TCS(tp)