[81696] trunk/dports/net/fping/Portfile

jmr at macports.org jmr at macports.org
Thu Aug 4 07:20:01 PDT 2011


Revision: 81696
          http://trac.macports.org/changeset/81696
Author:   jmr at macports.org
Date:     2011-08-04 07:19:58 -0700 (Thu, 04 Aug 2011)
Log Message:
-----------
fping: fix check for root privileges not to rely on env(USER)

Modified Paths:
--------------
    trunk/dports/net/fping/Portfile

Modified: trunk/dports/net/fping/Portfile
===================================================================
--- trunk/dports/net/fping/Portfile	2011-08-04 14:10:09 UTC (rev 81695)
+++ trunk/dports/net/fping/Portfile	2011-08-04 14:19:58 UTC (rev 81696)
@@ -1,4 +1,5 @@
 # $Id$
+
 PortSystem		1.0
 
 name			fping
@@ -28,7 +29,7 @@
 post-destroot {
 	system "ln -s fping.8 ${destroot}${prefix}/share/man/man8/fping6.8"
 	# Check if user is running as root
-	if {$env(USER) == "root"} {
+	if {[geteuid] == 0} {
 		system "chmod 4511 ${destroot}${prefix}/sbin/fping"
 		system "chmod 4511 ${destroot}${prefix}/sbin/fping6"
 	} else {
@@ -41,4 +42,3 @@
 		system "chmod 0511 ${destroot}${prefix}/sbin/fping6"
 	}
 }
-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110804/48825da5/attachment.html>


More information about the macports-changes mailing list