[69513] trunk/base/src/port1.0/portutil.tcl

jmr at macports.org jmr at macports.org
Thu Jul 8 10:24:15 PDT 2010


Revision: 69513
          http://trac.macports.org/changeset/69513
Author:   jmr at macports.org
Date:     2010-07-08 10:24:15 -0700 (Thu, 08 Jul 2010)
Log Message:
-----------
elevate back to root after completing targets

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

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2010-07-08 14:46:27 UTC (rev 69512)
+++ trunk/base/src/port1.0/portutil.tcl	2010-07-08 17:24:15 UTC (rev 69513)
@@ -1466,7 +1466,11 @@
                 return 0
             } else {
                 # run the activate target but ignore its (completed) dependencies
-                return [target_run [lindex [dlist_search $dlist provides $target] 0]]
+                set result [target_run [lindex [dlist_search $dlist provides $target] 0]]
+                if {[getuid] == 0 && [geteuid] != 0} {
+                    setegid 0; seteuid 0
+                }
+                return $result
             }
         }
     }
@@ -1486,6 +1490,10 @@
 
     set dlist [dlist_eval $dlist "" target_run]
 
+    if {[getuid] == 0 && [geteuid] != 0} {
+        setegid 0; seteuid 0
+    }
+
     if {[llength $dlist] > 0} {
         # somebody broke!
         set errstring "Warning: the following items did not execute (for $name):"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100708/97a14132/attachment.html>


More information about the macports-changes mailing list