From nobody Mon Apr 11 02:07:46 2022 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 8E3161A928E9; Mon, 11 Apr 2022 02:07:47 +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 4KcC1G6MkWz3LH5; Mon, 11 Apr 2022 02:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649642867; 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=bMPhwNh3FCBqpkwublrtjJ74dcD4LE1OZTAlsuQLHLo=; b=DvvoMg+wtGGCsrhmvvORJxIYpNy4nwAkwRShawoqPFLhrvXOkmZcAmN9s5BZP4QifG7zeu FLkVjj3e2JhzxzHBHZuz8dWY6vZBuEfFW1bYRaWaAeow79LceQBuzwiMbtHhPrukesVOtX OITci3g2olBdY88RI781+w01B6KHqVdTcaNepYnHSdzrXzmpsGBe/Xr7NCUMxhF+UIhDlb 2G17QcqFSxxDGqwuoaOJUWXJUwN285ktY404LZa/9I/ZSYg07VGb0BNYBuVu4iiMjIybQL uZKuwGRevT9LIMlQccyLcThxVuuvw6BQjXDnCaVBJUZHCgBHDCUDlJSGrS5xhw== 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 840791A422; Mon, 11 Apr 2022 02:07:46 +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 23B27k89086386; Mon, 11 Apr 2022 02:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23B27k8G086385; Mon, 11 Apr 2022 02:07:46 GMT (envelope-from git) Date: Mon, 11 Apr 2022 02:07:46 GMT Message-Id: <202204110207.23B27k8G086385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Enji Cooper Subject: git: 368552395021 - stable/12 - Don't leave `path` behind when executing `:chflags_success` 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: ngie X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 36855239502112971385bae3147ffb4f0a06ae93 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649642867; 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=bMPhwNh3FCBqpkwublrtjJ74dcD4LE1OZTAlsuQLHLo=; b=XcUNs394q2XMUxQPCMZDbKvrFvVEZ1BlAcmNGD72oWD9ODBUB50FW4g27JdBpy59CXkezr Jd4x6jY7UUI9IBmhCu/goSZb+7uQbEvHDHc1j7qsKLe/gwc46HMVXXEjMQZPGIy+LDhvF3 MjTA1l5gK8v+rCocLoP26MBTMTZt8CI+UKQ6KX1muI8cLKZnk8RN4qLTNITjXsJoqhJmx2 WC9iItQqZXW1trKT4Yac9EpZJnk67ikaaK/Xw79x69oCK65t+5tweQ1mt4hpFAyl8cqGRM XJMSDJkM2TYGk5L3+vsjwjGOqyxch7FIKytcgaIitqxrrP8nVuP3Upm4CGygIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649642867; a=rsa-sha256; cv=none; b=bn+lxNNCKk7FT/cp0fWXTxBaJ/WijGCZZC8Nd8dmj8NSeBf6uwVOmCzcu9FFo6oz0NXhs5 uS0BW+8+jaIzSuEiGC0rBBnHN/inDaKJHlF2kMV9yTF7oS1PRKE7lUe1a8GyghuOJj2YNA L15Z92SorH3GEixCwBKg5WTu3cgGprTC0dnmKBQKMl6QypoSwh/gp+RBvsI8RVgnufqpVU rsEuMdLeVSXSAVFsWInuspdIwS1+5KNhBGb2jm43BhBSSKdbyEVeguvcEknOJtstZexrSS 0uv4Nk0yvEehcZriuUIhPY4oyP1Y6wdS4jV04piu8kVy4vpwYPDPxFUV4qnp7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=36855239502112971385bae3147ffb4f0a06ae93 commit 36855239502112971385bae3147ffb4f0a06ae93 Author: Enji Cooper AuthorDate: 2020-07-12 17:16:57 +0000 Commit: Enji Cooper CommitDate: 2022-04-11 01:26:49 +0000 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 (cherry picked from commit cdb9318eed3852fbedc75e1cfba969ec161e2daa) --- tests/sys/audit/file-attribute-modify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/audit/file-attribute-modify.c b/tests/sys/audit/file-attribute-modify.c index 1701b6add7eb..8df1d6d2d95f 100644 --- a/tests/sys/audit/file-attribute-modify.c +++ b/tests/sys/audit/file-attribute-modify.c @@ -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); }