Execution of shell instruction in Portfile

Joshua Root jmr at macports.org
Mon Oct 3 06:08:30 PDT 2011


On 2011-10-3 16:24 , Jordan K. Hubbard wrote:
> 
> On Oct 2, 2011, at 6:40 AM, 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.
> 
> That sounds like an orthogonal problem (some sort of ACL list of users
> for kdevelop to query) to the original query, which was how to drop
> privs.  Wouldn't the dropPrivileges function from portutil.tcl be the
> appropriate thing to do in this case?

I read the OP as wanting an automated alternative to having the user run
kbuildsycoca4 themselves. That's not the same as running it as the
macports user, which is what dropPrivileges would let you do.

- Josh


More information about the macports-dev mailing list