ports/162273: [trivial] [comment] bsd.commands.mk recommends incorrect usage of sudo

Chris Rees crees at FreeBSD.org
Thu Nov 3 18:40:06 UTC 2011


>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 at 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:



More information about the freebsd-ports-bugs mailing list