Execution of shell instruction in Portfile
Joshua Root
jmr at macports.org
Sun Oct 2 08:24:39 PDT 2011
On 2011-10-3 01:38 , Ryan Schmidt wrote:
>
> On Oct 2, 2011, at 08:40, Joshua Root wrote:
>
>> You can certainly change users with su or sudo as part of a shell
>> command you run with system or exec, but the real problem is knowing
>> which user you want to run the command as. There could be more than one
>> user that wants to use kdevelop on the machine, and the user who ran the
>> port install might not even be one of them.
>
> Also, you don't know whether the user has installed MacPorts as root or as another user; if the latter, you can't switch users.
You can check if [geteuid] == 0, not that it really helps in this situation.
- Josh
More information about the macports-dev
mailing list