[62176] trunk/base/src/macports1.0/macports.tcl

jmr at macports.org jmr at macports.org
Wed Dec 30 07:35:26 PST 2009


Revision: 62176
          http://trac.macports.org/changeset/62176
Author:   jmr at macports.org
Date:     2009-12-30 07:35:23 -0800 (Wed, 30 Dec 2009)
Log Message:
-----------
attempt to change euid/egid for svn sync only if running as root

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2009-12-30 14:57:49 UTC (rev 62175)
+++ trunk/base/src/macports1.0/macports.tcl	2009-12-30 15:35:23 UTC (rev 62176)
@@ -1801,14 +1801,18 @@
                     ui_debug $svn_commandline
                     if {
                         [catch {
-                            set euid [geteuid]
-                            set egid [getegid]
-                            ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
-                            setegid [name_to_gid [file attributes $portdir -group]]
-                            seteuid [name_to_uid [file attributes $portdir -owner]]
+                            if {[getuid] == 0} {
+                                set euid [geteuid]
+                                set egid [getegid]
+                                ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
+                                setegid [name_to_gid [file attributes $portdir -group]]
+                                seteuid [name_to_uid [file attributes $portdir -owner]]
+                            }
                             system $svn_commandline
-                            seteuid $euid
-                            setegid $egid
+                            if {[getuid] == 0} {
+                                seteuid $euid
+                                setegid $egid
+                            }
                         }]
                     } {
                         ui_debug "$::errorInfo"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091230/af70742a/attachment.html>


More information about the macports-changes mailing list