From owner-svn-src-head@freebsd.org Sun Jul 12 17:16:57 2020 Return-Path: Delivered-To: svn-src-head@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 C6FB5369CB8; Sun, 12 Jul 2020 17:16:57 +0000 (UTC) (envelope-from ngie@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4YNn4sJjz3Xf7; Sun, 12 Jul 2020 17:16:57 +0000 (UTC) (envelope-from ngie@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 85BC227A59; Sun, 12 Jul 2020 17:16:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06CHGvPv099027; Sun, 12 Jul 2020 17:16:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06CHGvgM099026; Sun, 12 Jul 2020 17:16:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <202007121716.06CHGvgM099026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sun, 12 Jul 2020 17:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363132 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 363132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2020 17:16:57 -0000 Author: ngie Date: Sun Jul 12 17:16:57 2020 New Revision: 363132 URL: https://svnweb.freebsd.org/changeset/base/363132 Log: Don't leave `path` behind when executing `:chflags_success` Prior to this change a `SF_IMMUTABLE` chflagsat(2)'ed file (`path`) was left behind, which sabotaged kyua(1) from being able to clean up the work directory, This resulted in unnecessary work for folks having to clean up the work directory on non-disposable systems, which defaults to `/tmp`. Use `UF_OFFLINE` instead of `SF_IMMUTABLE`, in part because setting `SF_IMMUTABLE` isn't relevant to the test and `SF_IMMUTABLE` cannot be cleared at all securelevels, as pointed out by @asomers. Additional work is required to catch cases like this upfront in the future to avoid tester headache. See PR # 247765 for more details/followup. Suggested by: asomers Reviewed By: asomers, #tests MFC after: 1 week PR: 247761 Sponsored by: DellEMC Differential Revision: https://reviews.freebsd.org/D25561 Modified: head/tests/sys/audit/file-attribute-modify.c Modified: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- head/tests/sys/audit/file-attribute-modify.c Sun Jul 12 15:57:29 2020 (r363131) +++ head/tests/sys/audit/file-attribute-modify.c Sun Jul 12 17:16:57 2020 (r363132) @@ -704,7 +704,7 @@ ATF_TC_BODY(chflagsat_success, tc) /* File needs to exist to call chflagsat(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(0, chflagsat(AT_FDCWD, path, SF_IMMUTABLE, 0)); + ATF_REQUIRE_EQ(0, chflagsat(AT_FDCWD, path, UF_OFFLINE, 0)); check_audit(fds, successreg, pipefd); close(filedesc); } @@ -726,7 +726,7 @@ ATF_TC_BODY(chflagsat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, SF_IMMUTABLE, 0)); + ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, UF_OFFLINE, 0)); check_audit(fds, failurereg, pipefd); }