[72237] trunk/base/src/package1.0/portmpkg.tcl
jmr at macports.org
jmr at macports.org
Thu Oct 7 19:47:34 PDT 2010
Revision: 72237
http://trac.macports.org/changeset/72237
Author: jmr at macports.org
Date: 2010-10-07 19:47:32 -0700 (Thu, 07 Oct 2010)
Log Message:
-----------
regain root privileges when mportexec'ing dependencies in portmpkg (#26463)
Modified Paths:
--------------
trunk/base/src/package1.0/portmpkg.tcl
Modified: trunk/base/src/package1.0/portmpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portmpkg.tcl 2010-10-08 02:45:55 UTC (rev 72236)
+++ trunk/base/src/package1.0/portmpkg.tcl 2010-10-08 02:47:32 UTC (rev 72237)
@@ -86,13 +86,17 @@
}
proc portmpkg::make_one_package {portname portversion destination} {
- global prefix package.destpath package.flat
+ global prefix package.destpath package.flat macportsuser
if {[catch {set res [mport_lookup $portname]} result]} {
global errorInfo
ui_debug "$errorInfo"
ui_error "port lookup failed: $result"
return 1
}
+ if {[getuid] == 0 && [geteuid] != 0} {
+ setegid 0; seteuid 0
+ set deprivileged 1
+ }
foreach {name array} $res {
array set portinfo $array
@@ -105,6 +109,10 @@
}
unset portinfo
}
+ if {[info exists deprivileged]} {
+ setegid [uname_to_gid "$macportsuser"]
+ seteuid [name_to_uid "$macportsuser"]
+ }
}
proc portmpkg::package_mpkg {portname portversion portrevision} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101007/8d8c6a9d/attachment.html>
More information about the macports-changes
mailing list