[70138] trunk/base/src/port1.0

jmr at macports.org jmr at macports.org
Fri Jul 30 03:24:07 PDT 2010


Revision: 70138
          http://trac.macports.org/changeset/70138
Author:   jmr at macports.org
Date:     2010-07-30 03:24:05 -0700 (Fri, 30 Jul 2010)
Log Message:
-----------
can't trust file writable when euid has been changed

Modified Paths:
--------------
    trunk/base/src/port1.0/portactivate.tcl
    trunk/base/src/port1.0/portdeactivate.tcl

Modified: trunk/base/src/port1.0/portactivate.tcl
===================================================================
--- trunk/base/src/port1.0/portactivate.tcl	2010-07-30 08:59:07 UTC (rev 70137)
+++ trunk/base/src/port1.0/portactivate.tcl	2010-07-30 10:24:05 UTC (rev 70138)
@@ -55,7 +55,7 @@
 
 proc portactivate::activate_start {args} {
     global prefix registry.installtype
-    if { ![file writable $prefix] && ${registry.installtype} == "image"} {
+    if { (![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)) && ${registry.installtype} == "image"} {
         # if install location is not writable, need root privileges
         elevateToRoot "activate"
     }

Modified: trunk/base/src/port1.0/portdeactivate.tcl
===================================================================
--- trunk/base/src/port1.0/portdeactivate.tcl	2010-07-30 08:59:07 UTC (rev 70137)
+++ trunk/base/src/port1.0/portdeactivate.tcl	2010-07-30 10:24:05 UTC (rev 70138)
@@ -50,7 +50,7 @@
 
 proc portdeactivate::deactivate_start {args} {
     global prefix registry.installtype
-    if { ![file writable $prefix] && ${registry.installtype} == "image"} {
+    if { (![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)) && ${registry.installtype} == "image"} {
         # if install location is not writable, need root privileges
         elevateToRoot "deactivate"
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100730/38eb7477/attachment-0001.html>


More information about the macports-changes mailing list