From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DB4C1158015 for ; Wed, 27 Dec 2023 21:18:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 25F432BC01B; Wed, 27 Dec 2023 21:18:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 02A5E2BC01B for ; Wed, 27 Dec 2023 21:18:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1B46F340806 for ; Wed, 27 Dec 2023 21:18:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 80C93119 for ; Wed, 27 Dec 2023 21:18:28 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1703689772.cb788dd9acf9f48a9c4934920ebadaa942fe0682.ulm@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: /, bin/ X-VCS-Repository: proj/portage X-VCS-Files: NEWS bin/ebuild.sh X-VCS-Directories: bin/ / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: cb788dd9acf9f48a9c4934920ebadaa942fe0682 X-VCS-Branch: master Date: Wed, 27 Dec 2023 21:18:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ce516981-ca12-43c4-a986-96961130ba27 X-Archives-Hash: 24d56f69bd3c50d9423fa14266d80f8d commit: cb788dd9acf9f48a9c4934920ebadaa942fe0682 Author: Ulrich Müller gentoo org> AuthorDate: Sun Dec 24 10:54:27 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Wed Dec 27 15:09:32 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cb788dd9 ebuild.sh: Warn about colon-separated argument in sandbox functions According to PMS and the Devmanual, only a single item is allowed as argument for addread, addwrite, adddeny and addpredict: https://projects.gentoo.org/pms/8/pms.html#x1-12300012.3.3 https://devmanual.gentoo.org/function-reference/sandbox-functions/ The previous usage message (contrary to Devmanual policy) had been added in commit 0c6454261c514f021a4ddce2415a68773027ed6a. Bug: https://bugs.gentoo.org/920654 Signed-off-by: Ulrich Müller gentoo.org> NEWS | 4 ++++ bin/ebuild.sh | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e1e47d0a2e..40fdfd9ea2 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,10 @@ Features: * emerge: depclean now returns with failure if no packages are matched (bug #917120) +Bug fixes: +* addread, addwrite, adddeny, addpredict: Warn about passing a colon-separated + list of paths as argument (bug #920654). + portage-3.0.58 (2023-12-14) -------------- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index dc8d205f9a..c9f7c04e28 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -162,7 +162,10 @@ fi __sb_append_var() { local _v=$1 ; shift local var="SANDBOX_${_v}" - [[ -z $1 || -n $2 ]] && die "Usage: add$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${_v}") " + [[ $# -eq 1 ]] || die "Usage: add${_v,,} " + # Make this fatal after 2024-12-31 + [[ ${1} == *:* ]] \ + && eqawarn "QA Notice: add${_v,,} called with colon-separated argument" export ${var}="${!var:+${!var}:}$1" } # bash-4 version: @@ -173,8 +176,9 @@ addwrite() { __sb_append_var WRITE "$@" ; } adddeny() { __sb_append_var DENY "$@" ; } addpredict() { __sb_append_var PREDICT "$@" ; } +addread / +addread "${PORTAGE_TMPDIR}/portage" addwrite "${PORTAGE_TMPDIR}/portage" -addread "/:${PORTAGE_TMPDIR}/portage" [[ -n ${PORTAGE_GPG_DIR} ]] && addpredict "${PORTAGE_GPG_DIR}" # Avoid sandbox violations in temporary directories.