[79689] trunk/base/src
jmr at macports.org
jmr at macports.org
Thu Jun 23 10:21:03 PDT 2011
Revision: 79689
http://trac.macports.org/changeset/79689
Author: jmr at macports.org
Date: 2011-06-23 10:21:02 -0700 (Thu, 23 Jun 2011)
Log Message:
-----------
don't try to drop privileges if macportsuser does not exist
Modified Paths:
--------------
trunk/base/src/macports1.0/macports.tcl
trunk/base/src/port1.0/portutil.tcl
Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl 2011-06-23 16:37:27 UTC (rev 79688)
+++ trunk/base/src/macports1.0/macports.tcl 2011-06-23 17:21:02 UTC (rev 79689)
@@ -1630,6 +1630,8 @@
proc mportexec {mport target} {
set workername [ditem_key $mport workername]
+ # check for existence of macportsuser and use fallback if necessary
+ $workername eval validate_macportsuser
# check variants
if {[$workername eval check_variants $target] != 0} {
return 1
Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl 2011-06-23 16:37:27 UTC (rev 79688)
+++ trunk/base/src/port1.0/portutil.tcl 2011-06-23 17:21:02 UTC (rev 79689)
@@ -2507,6 +2507,15 @@
}
}
+proc validate_macportsuser {} {
+ global macportsuser
+ if {[getuid] == 0 && $macportsuser != "root" &&
+ ([existsuser $macportsuser] == 0 || [existsgroup $macportsuser] == 0 )} {
+ ui_warn "configured user/group $macportsuser does not exist, will build as root"
+ set macportsuser "root"
+ }
+}
+
# dependency analysis helpers
### _libtest is private; subject to change without notice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110623/b22cd87a/attachment.html>
More information about the macports-changes
mailing list