[MacPorts] #20330: Ports that require root access to build don't work if macportsuser is not root

MacPorts noreply at macports.org
Wed Jul 15 21:39:45 PDT 2009


#20330: Ports that require root access to build don't work if macportsuser is not
root
---------------------------+------------------------------------------------
 Reporter:  mta@…          |       Owner:  macports-tickets@…                   
     Type:  defect         |      Status:  new                                  
 Priority:  Normal         |   Milestone:                                       
Component:  base           |     Version:  1.8.0                                
 Keywords:  asroot         |        Port:                                       
---------------------------+------------------------------------------------
 The {target}.asroot option in portfiles doesn't seem to work.  This is
 because the code to test it in target_run in portutil.tcl is testing the
 wrong variable.  The result is that ports which require root access to
 install don't work right if macports is built with the with-install-user,
 with-install-group, and with-macports-user options (or with with-no-root-
 privileges which amounts to the same thing).

 Also reinplace sometimes needs root access to set the attributes on the
 new copy of the file it just changed.  This means that some ports (for
 example dbus) need "patch.asroot yes" just to do a reinplace in the post
 patch code.

 I've attached a patch that fixes both of these problems.  With this change
 dbus builds properly in a non-privileged macports running under sudo if
 you add "install.asroot yes" and "destroot.asroot yes" to its Portfile.
 Most of the build runs as macportsuser and only the installation parts run
 as root.

 There is also a kluge around line 100 in portdestroot.tcl which is
 probably not needed with these changes.  It escalates privileges to root
 if macports started as root, but isn't root now.  After the fix to make
 destroot.asroot work this shouldn't be needed anymore.  I verified that it
 isn't being executed, but didn't remove it.

-- 
Ticket URL: <http://trac.macports.org/ticket/20330>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list