From owner-freebsd-ports-bugs@FreeBSD.ORG Sat May 22 06:30:04 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EAF51065673 for ; Sat, 22 May 2010 06:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 60FFA8FC1A for ; Sat, 22 May 2010 06:30:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o4M6U4uS004374 for ; Sat, 22 May 2010 06:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o4M6U4eN004373; Sat, 22 May 2010 06:30:04 GMT (envelope-from gnats) Resent-Date: Sat, 22 May 2010 06:30:04 GMT Resent-Message-Id: <201005220630.o4M6U4eN004373@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Anonymous Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE62D106566C for ; Sat, 22 May 2010 06:25:03 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4128FC1E for ; Sat, 22 May 2010 06:25:02 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so1072704fgb.13 for ; Fri, 21 May 2010 23:25:02 -0700 (PDT) Received: by 10.87.69.29 with SMTP id w29mr4911071fgk.35.1274509501014; Fri, 21 May 2010 23:25:01 -0700 (PDT) Received: from localhost (95-25-188-72.broadband.corbina.ru [95.25.188.72]) by mx.google.com with ESMTPS id d4sm5538091fga.20.2010.05.21.23.25.00 (version=SSLv3 cipher=RC4-MD5); Fri, 21 May 2010 23:25:00 -0700 (PDT) Message-Id: <86aars4fod.fsf@gmail.com> Date: Sat, 22 May 2010 10:24:34 +0400 From: Anonymous To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: ports/146816: [patch] Mk/bsd.port.mk: loosen SU_CMD & su(1) cohesion for make {, rm}config X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2010 06:30:04 -0000 >Number: 146816 >Category: ports >Synopsis: [patch] Mk/bsd.port.mk: loosen SU_CMD & su(1) cohesion for make {,rm}config >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat May 22 06:30:03 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Anonymous >Release: FreeBSD 9.0-CURRENT amd64 >Organization: >Environment: __MAKE_CONF=~/.make.conf PORTSDIR=/a/freebsd-ports, owned by regular user >Description: Allow using sudo(1) directly in SU_CMD, e.g. SU_CMD=eval sudo -E instead of SU_CMD=sudo -E sh -c This removes some specific cases that presume `su -c' or `sh -c', e.g. $ su -c 'cmd1; cmd2' $ su -c 'cmd > file' This shouldn't affect default usage SU_CMD=su root -c >How-To-Repeat: >Fix: --- a.diff begins here --- Index: Mk/bsd.port.mk =================================================================== RCS file: /a/.cvsup/ports/Mk/bsd.port.mk,v retrieving revision 1.638 diff -u -p -r1.638 bsd.port.mk --- Mk/bsd.port.mk 12 May 2010 19:57:57 -0000 1.638 +++ Mk/bsd.port.mk 22 May 2010 06:16:43 -0000 @@ -6073,7 +6073,7 @@ config: .if ${UID} != 0 && !defined(INSTALL_AS_USER) @optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \ ${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \ - (${SU_CMD} "${SH} -c \"${MKDIR} $${optionsdir} 2> /dev/null\"") || \ + ${SU_CMD} "${MKDIR} $${optionsdir} 2> /dev/null" || \ (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \ ${ECHO_MSG} "===> Returning to user credentials" .else @@ -6133,7 +6133,8 @@ config: done; \ if [ `${ID} -u` != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \ ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONSFILE}"; \ - ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONSFILE}"; \ + ${SU_CMD} "${CP} $${TMPOPTIONSFILE} ${OPTIONSFILE}"; \ + ${SU_CMD} "${CHMOD} +r $${TMPOPTIONSFILE} ${OPTIONSFILE}"; \ ${ECHO_MSG} "===> Returning to user credentials"; \ else \ ${CAT} $${TMPOPTIONSFILE} > ${OPTIONSFILE}; \ @@ -6226,8 +6227,8 @@ rmconfig: optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \ if [ `${ID} -u` != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \ ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONSFILE} and $${optionsdir}"; \ - ${SU_CMD} "${RM} -f ${OPTIONSFILE} ; \ - ${RMDIR} $${optionsdir}"; \ + ${SU_CMD} "${RM} -f ${OPTIONSFILE}"; \ + ${SU_CMD} "${RMDIR} $${optionsdir}"; \ ${ECHO_MSG} "===> Returning to user credentials"; \ else \ ${RM} -f ${OPTIONSFILE}; \ --- a.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: