Why was the macports user implemented

Ryan Schmidt ryandesign at macports.org
Wed Aug 31 19:51:22 PDT 2011


On Aug 31, 2011, at 20:38, Gregory Seidman wrote:

> On Wed, Aug 31, 2011 at 03:09:33PM -0400, Jeremy Lavergne wrote:
>>> Please explain to me like if I were a four-year old, why was the user
>>> 'macports' implemented?
>> 
>> The user was created to address this problem:
>> Portfiles and the packages they install can contain arbitrary code, and
>> should not be trusted unless they are signed and that packager is trusted.
> [...]
>> The typical way of implementing this is creating a user and group, so
>> permissions on files can be set to `macports:macports`.
> 
> While we're on the topic, I recently got a new Mac and used the OS X
> Migration Assistant to move stuff over.

That's not particularly supported. Quite often when people migrate they're also switching OS version or processor architecture, in which case a full rebuild of all ports is required. We document this on our migration page:

https://trac.macports.org/wiki/Migration


> It automatically copied all of
> macports, but did not create the macports user and group. I eventually did
> it manually (by digging into the Makefile for the MacPorts source install),
> but I was wondering if there was some automated way to recreate the user if
> it gets blown away somehow.

The only automated way I know of would be to reinstall MacPorts, which is one of the steps in the migration instructions linked to above.


> Yes, I understand that this is a rare occurrence, and I'm not saying there
> necessarily *should* be an automated way, I'm just wondering if there is. I
> could also envision a "ports sanity-check" command that not only recreates
> the user but checks into any number of potential issues.

I believe MacPorts already includes a sanity check for whether the macports user exists; if it does not, you should be getting errors when running any commands that would use that user.




More information about the macports-users mailing list