Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Nov 2011 18:35:52 GMT
From:      Chris Rees <crees@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/162273: [trivial] [comment] bsd.commands.mk recommends incorrect usage of sudo
Message-ID:  <201111031835.pA3IZqJO012532@freefall.freebsd.org>
Resent-Message-ID: <201111031840.pA3Ie6E0012682@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         162273
>Category:       ports
>Synopsis:       [trivial] [comment] bsd.commands.mk recommends incorrect usage of sudo
>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:   Thu Nov 03 18:40:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD freefall.freebsd.org 8.2-STABLE FreeBSD 8.2-STABLE #4 r220774: Mon Apr 18 13:56:14 UTC 2011 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386


	
>Description:
	Using su -c is not synonymous with sudo sh -c ; the former preserves the environment, while the latter does not.  This bites one when running make install as non-root for example; any make vars set on command line are lost.
>How-To-Repeat:
	
>Fix:

	

--- bsd.commands.mk-su_cmd.diff begins here ---
Index: bsd.commands.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.commands.mk,v
retrieving revision 1.8
diff -u -r1.8 bsd.commands.mk
--- bsd.commands.mk	4 May 2011 22:33:13 -0000	1.8
+++ bsd.commands.mk	3 Nov 2011 18:29:10 -0000
@@ -79,7 +79,7 @@
 SORT?=		/usr/bin/sort
 STRIP_CMD?=	/usr/bin/strip
 # Command to run commands as privileged user
-# Example: "/usr/local/bin/sudo sh -c" to use "sudo" instead of "su"
+# Example: "/usr/local/bin/sudo -E sh -c" to use "sudo" instead of "su"
 SU_CMD?=	/usr/bin/su root -c
 SYSCTL?=	/sbin/sysctl
 TAIL?=		/usr/bin/tail
--- bsd.commands.mk-su_cmd.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111031835.pA3IZqJO012532>