compiling as root?

paul beard paulbeard at
Sat Nov 24 08:10:40 PST 2007

On 11/24/07, Michael Thon <mike.thon at> wrote:
> Linux people generally recommend that you do not compile source code
> with a user that has superuser privileges, which I assume is a guard
> against possibly malicious commands that may be in the compile
> scripts.  When I install packages with macports (sudo port install
> xyz)  they're compiled by the root user.  I assume that the developers
> have thought about this and decided that it is not a security
> problem.  But I am curious, is it ok or not ok to compile source code
> as root?
> cheers

you can compile as any user, so long as you have permissions to write to
where you're doing it. It's the installation step that might require root.
This, I suspect, is part of the reason why MacPorts uses the /opt/local
sandbox and doesn't write to the other parts of the system.
Paul Beard /
<paulbeard at at>
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the macports-users mailing list