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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2F3C3138334 for ; Sun, 8 Jul 2018 09:18:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A4A0E0815; Sun, 8 Jul 2018 09:18:27 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E60A4E0815 for ; Sun, 8 Jul 2018 09:18:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6223E335C76 for ; Sun, 8 Jul 2018 09:18:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D8F1D349 for ; Sun, 8 Jul 2018 09:18:23 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1531041495.fcbb02811f1e1318129bae04bdc5df16affa58a5.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/sudo/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-admin/sudo/sudo-9999.ebuild X-VCS-Directories: app-admin/sudo/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: fcbb02811f1e1318129bae04bdc5df16affa58a5 X-VCS-Branch: master Date: Sun, 8 Jul 2018 09:18:23 +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-Archives-Salt: f4186753-047f-44cc-ae57-4d67734c6789 X-Archives-Hash: dc9512a92f448b18f236f304cb563bf9 commit: fcbb02811f1e1318129bae04bdc5df16affa58a5 Author: Lars Wendler gentoo org> AuthorDate: Sun Jul 8 09:13:40 2018 +0000 Commit: Lars Wendler gentoo org> CommitDate: Sun Jul 8 09:18:15 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcbb0281 app-admin/sudo: Synced live ebuild. Package-Manager: Portage-2.3.41, Repoman-2.3.9 app-admin/sudo/sudo-9999.ebuild | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/app-admin/sudo/sudo-9999.ebuild b/app-admin/sudo/sudo-9999.ebuild index 863a0c4289f..bfac67e52ac 100644 --- a/app-admin/sudo/sudo-9999.ebuild +++ b/app-admin/sudo/sudo-9999.ebuild @@ -74,16 +74,23 @@ src_prepare() { elibtoolize } -set_rootpath() { - # FIXME: secure_path is a compile time setting. using ROOTPATH - # is not perfect, env-update may invalidate this, but until it +set_secure_path() { + # FIXME: secure_path is a compile time setting. using PATH or + # ROOTPATH is not perfect, env-update may invalidate this, but until it # is available as a sudoers setting this will have to do. einfo "Setting secure_path ..." # first extract the default ROOTPATH from build env - ROOTPATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}") - if [[ -z ${ROOTPATH} ]] ; then - ewarn " Failed to find ROOTPATH, please report this" + SECURE_PATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; + echo "${ROOTPATH}") + case "${SECURE_PATH}" in + */usr/sbin*) ;; + *) SECURE_PATH=$(unset PATH; + . "${EPREFIX}"/etc/profile.env; echo "${PATH}") + ;; + esac + if [[ -z ${SECURE_PATH} ]] ; then + ewarn " Failed to detect SECURE_PATH, please report this" fi # then remove duplicate path entries @@ -96,18 +103,18 @@ set_rootpath() { einfo " Duplicate entry ${thisp} removed..." fi done - ROOTPATH=${newpath#:} + SECURE_PATH=${newpath#:} } - cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}} + cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${SECURE_PATH:+:${SECURE_PATH}} # finally, strip gcc paths #136027 rmpath() { local e newpath thisp IFS=: - for thisp in ${ROOTPATH} ; do + for thisp in ${SECURE_PATH} ; do for e ; do [[ $thisp == $e ]] && continue 2 ; done newpath+=:$thisp done - ROOTPATH=${newpath#:} + SECURE_PATH=${newpath#:} } rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*' @@ -115,8 +122,8 @@ set_rootpath() { } src_configure() { - local ROOTPATH - set_rootpath + local SECURE_PATH + set_secure_path # audit: somebody got to explain me how I can test this before I # enable it.. - Diego @@ -129,7 +136,7 @@ src_configure() { --with-env-editor --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo --with-rundir="${EPREFIX}"/var/run/sudo - --with-secure-path="${ROOTPATH}" + --with-secure-path="${SECURE_PATH}" --with-vardir="${EPREFIX}"/var/db/sudo --without-linux-audit --without-opie