[69453] trunk/base/src

jmr at macports.org jmr at macports.org
Tue Jul 6 10:06:31 PDT 2010


Revision: 69453
          http://trac.macports.org/changeset/69453
Author:   jmr at macports.org
Date:     2010-07-06 10:06:30 -0700 (Tue, 06 Jul 2010)
Log Message:
-----------
change euid back to root in a few more places where it's needed

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/package1.0/portarchive.tcl
    trunk/base/src/port1.0/portinstall.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2010-07-06 17:02:47 UTC (rev 69452)
+++ trunk/base/src/macports1.0/macports.tcl	2010-07-06 17:06:30 UTC (rev 69453)
@@ -155,6 +155,9 @@
         }
     }
     if {$::logenabled} {
+        if {[getuid] == 0 && [geteuid] != 0} {
+            seteuid 0
+        }
         if {[catch {macports::ch_logging $mport} err]} {
             ui_debug "Logging disabled, error opening log file: $err"
             return

Modified: trunk/base/src/package1.0/portarchive.tcl
===================================================================
--- trunk/base/src/package1.0/portarchive.tcl	2010-07-06 17:02:47 UTC (rev 69452)
+++ trunk/base/src/package1.0/portarchive.tcl	2010-07-06 17:06:30 UTC (rev 69453)
@@ -290,6 +290,10 @@
     global archive.meta archive.metaname archive.metapath
     global os.platform
 
+    if {[getuid] == 0 && [geteuid] != 0} {
+        elevateToRoot "archive"
+    }
+
     # Create archive destination path (if needed)
     if {![file isdirectory ${archive.fulldestpath}]} {
         file mkdir ${archive.fulldestpath}

Modified: trunk/base/src/port1.0/portinstall.tcl
===================================================================
--- trunk/base/src/port1.0/portinstall.tcl	2010-07-06 17:02:47 UTC (rev 69452)
+++ trunk/base/src/port1.0/portinstall.tcl	2010-07-06 17:06:30 UTC (rev 69453)
@@ -62,8 +62,10 @@
     ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $name $version $revision $portvariants]"
     
     # start gsoc08-privileges
-    if { ![file writable $prefix] } {
+    if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
         # if install location is not writable, need root privileges to install
+        # Also elevate if started as root, since 'file writable' doesn't seem
+        # to take euid into account.
         elevateToRoot "install"
     }
     # end gsoc08-privileges
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100706/52f5874a/attachment.html>


More information about the macports-changes mailing list