[70139] branches/release_1_9/base/src/port1.0

jmr at macports.org jmr at macports.org
Fri Jul 30 03:25:51 PDT 2010


Revision: 70139
          http://trac.macports.org/changeset/70139
Author:   jmr at macports.org
Date:     2010-07-30 03:25:51 -0700 (Fri, 30 Jul 2010)
Log Message:
-----------
merge r70138 from trunk:
 can't trust file writable when euid has been changed

Revision Links:
--------------
    http://trac.macports.org/changeset/70138

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

Modified: branches/release_1_9/base/src/port1.0/portactivate.tcl
===================================================================
--- branches/release_1_9/base/src/port1.0/portactivate.tcl	2010-07-30 10:24:05 UTC (rev 70138)
+++ branches/release_1_9/base/src/port1.0/portactivate.tcl	2010-07-30 10:25:51 UTC (rev 70139)
@@ -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: branches/release_1_9/base/src/port1.0/portdeactivate.tcl
===================================================================
--- branches/release_1_9/base/src/port1.0/portdeactivate.tcl	2010-07-30 10:24:05 UTC (rev 70138)
+++ branches/release_1_9/base/src/port1.0/portdeactivate.tcl	2010-07-30 10:25:51 UTC (rev 70139)
@@ -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/1bf63bbb/attachment.html>


More information about the macports-changes mailing list