From owner-dev-commits-src-all@freebsd.org Wed Feb 3 16:23:39 2021 Return-Path: Delivered-To: dev-commits-src-all@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 0DE5653BC54; Wed, 3 Feb 2021 16:23:39 +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 4DW6SB6zzxz4qNh; Wed, 3 Feb 2021 16:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E2C9C24203; Wed, 3 Feb 2021 16:23:38 +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 113GNcvU044702; Wed, 3 Feb 2021 16:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113GNckF044701; Wed, 3 Feb 2021 16:23:38 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:23:38 GMT Message-Id: <202102031623.113GNckF044701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: b67df8d7c203 - main - diff: Use unprivileged_user with report_identical test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b67df8d7c203a139b5afbe72e1947fbb8c32dc73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 16:23:39 -0000 The branch main has been updated by olivier (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b67df8d7c203a139b5afbe72e1947fbb8c32dc73 commit b67df8d7c203a139b5afbe72e1947fbb8c32dc73 Author: Olivier Cochard AuthorDate: 2021-02-03 16:18:59 +0000 Commit: Olivier Cochard CommitDate: 2021-02-03 16:18:59 +0000 diff: Use unprivileged_user with report_identical test Approved by: bapt Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28466 --- usr.bin/diff/tests/diff_test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 60b56f0d9067..b9d1698d982e 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -228,13 +228,18 @@ label_body() -s exit:1 diff --label hello --label world `which diff` `which ls` } +report_identical_head() +{ + atf_set "require.config" unprivileged_user +} report_identical_body() { + UNPRIVILEGED_USER=$(atf_config_get unprivileged_user) printf "\tA\n" > A printf "\tB\n" > B chmod -r B atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \ - -o empty diff -s A B + -o empty su -m "$UNPRIVILEGED_USER" -c 'diff -s A B' } non_regular_file_body()