installer doesn't modify root path

Harald Hanche-Olsen hanche at math.ntnu.no
Tue Feb 2 07:22:17 PST 2016


-----Original Message-----
From: Brandon Allbery <allbery.b at gmail.com>
Date: 2 February 2016 at 16:06:18

> On Tue, Feb 2, 2016 at 9:57 AM, Harald Hanche-Olsen  
> wrote:
>  
> > Well, you did not say in the bug report that you were using sudo, so no
> > wonder it got closed.
>  
> ? sudo is the recommended way to do this.

Yes, but the way the bug report was phrased, it was very easy to suspect that either a root shell had been run using “sudo -i”, or perhaps even by enabling the root account and logging in as root – which is definitely not recommended, but I have seen this suggestion in the wild – though not recently.

> > My own systems are too heavily modified at the moment for me to be sure,
> > but I have a file /etc/paths.d/45-macports containing the two lines
> >
> > /opt/local/bin
> > /opt/local/sbin
> >
>  
> This is not standard.

Okay, now I am curious. How does the macports installation manipulate the path? As far as I know, the above method is standard, even though it may not be what macports does. (If I installed that file there, I must have done it because it didn’t work otherwise.)

> I would also suspect a sudoers modification here. The default should retain
> the user's PATH,

That’s what I am finding too, after some experimentation. Even the sudo man page agrees, though only if you read it really carefully.

– Harald



More information about the macports-users mailing list