Execution of shell instruction in Portfile

Ryan Schmidt ryandesign at macports.org
Sun Oct 2 23:54:24 PDT 2011


On Oct 3, 2011, at 00: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?

That still assumes you had elevated privileges to begin with. You wouldn't if your MacPorts install isn't installed as root.

You also can't get a complete list of users who might want to use a port. There might be users created in the future that would like to use it.



More information about the macports-dev mailing list