wiki:pmagrath

Version 5 (modified by pmagrath@…, 16 years ago) (diff)

Revised plan as a result of email exchange with Raim.

Paul Magrath

  • IRC Nick: pmagrath
  • E-Mail: pmagrath AT macports.org

I'm a student of Computer Science at Trinity College Dublin and one of the Google Summer of Code 2008 participants working on improving MacPorts.

My GSoC mentor is Rainer Müller.

I'm available in #macports on FreeNode as pmagrath.

branches/gsoc08-privileges

Summary

To implement facility to reduce need to execute MacPorts as root.

The Plan

The proposal is to implement a number of improvements to the MacPorts code base in order to reduce the need to execute MacPorts with root privileges.

Reduce need for actions to run as root

MacPorts operations which do not explicitly need root privileges will be re-coded so that they will run with normal user privileges. Examples would include fetching, extracting and building the port.

Portfile Format

The portfile format shall be extended with an additional attribute to mark those ports that can not be installed without root privileges, such as those requiring StartupItems.

Privilege Escaltion

I would feel that the best behavior for if MacPorts is requested to perform a privileged operation for a port, if it currently has no privileged access would be for the user to be given the choice of elevating privileges (by evoking sudo), installing in a fakeroot or aborting. The complications are that there is currently no way of knowing whether a port needs privileges, creating a fakeroot mechanism, cleanly elevating and de-elevating privileges.

MacPorts Group

It would be a good idea to create an additional group macports which users are allowed to run any port command. So /opt/local would be owned by the group macports with g+rw. (Gentoo's portage does something like this.)

This will allow users who are members of the new macports group to have full write permissions to /opt and its subfolders, and hence to install ports which only affect that hierarchy to install those ports without requiring root privileges.

Privilege Dropping

Examine how we could drop root privileges for building. So we still run port using sudo, but for the actual building root privileges are dropped and the configure/build phase runs with the privileges of the current user only (or of some new unprivileged macports user?). Of course this needs investigation how the permissions inside the workpath need to be set to accomplish this.

Install MacPorts in your home directory easily

Modify some of the configure scripts. Currently, if you want to install a MacPorts tree into your home, you need to configure it like this manually:

./configure \ --prefix=~/macports \ --with-install-user=foo \ --with-install-group=foo \ --with-tclpackage=~/Library/Tcl

It'd be great if this could be done with one switch only. For example:

./configure \ --prefix=~/macports \ --without-root-privileges

This will allow users to install packages into their own ~/.macports/opt instead of /opt when non root users wish to install ports for their own use only.

Goals

1) Implementation of the improvements outlined above.
2) Ability to easily install common packages without root privileges.
3) (Stretch) Easy use of MacPorts without root user account activation.

Tickets

Reported Tickets

Ticket Summary Status Owner Type Priority Milestone
No tickets found

Assigned Tickets

No results

On CC

No results

Back to the MacPorts developers page