[81742] trunk/dports/devel/bugzilla/Portfile

jmr at macports.org jmr at macports.org
Thu Aug 4 10:10:46 PDT 2011


Revision: 81742
          http://trac.macports.org/changeset/81742
Author:   jmr at macports.org
Date:     2011-08-04 10:10:46 -0700 (Thu, 04 Aug 2011)
Log Message:
-----------
bugzilla: fix root privileges check not to rely on env(USER)

Modified Paths:
--------------
    trunk/dports/devel/bugzilla/Portfile

Modified: trunk/dports/devel/bugzilla/Portfile
===================================================================
--- trunk/dports/devel/bugzilla/Portfile	2011-08-04 17:09:34 UTC (rev 81741)
+++ trunk/dports/devel/bugzilla/Portfile	2011-08-04 17:10:46 UTC (rev 81742)
@@ -83,7 +83,7 @@
 
 destroot {
 	# Warn user if not running as root
-	if {$env(USER) != "root"} {
+	if {[geteuid] != 0} {
 		ui_msg "-----------------------------------------------------------"
 		ui_msg "Note that you are not running as root, so files installed"
 		ui_msg "by this port will not end up with proper ownership and"
@@ -96,7 +96,7 @@
 	ui_info "copying ${worksrcpath}\n     to ${destroot}${wwwRoot}/${name}"
 	system "cp -R ${worksrcpath}/. ${destroot}${wwwRoot}/${name}"
 	# Fix owner and group on installed data
-	if {$env(USER) == "root"} {
+	if {[geteuid] == 0} {
 		foreach item [exec find ${destroot}${wwwRoot}/${name} -type f] {
 			file attributes ${item} -permissions go+r -owner www -group www
 		}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110804/8c7b3d88/attachment.html>


More information about the macports-changes mailing list