[wplug] Quick script/SU(or SUDO) question

Tom Rhodes trhodes at FreeBSD.org
Thu Jul 13 19:28:44 EDT 2006


On Thu, 13 Jul 2006 12:58:26 -0400
"Ben Beige" <dariuscardren at gmail.com> wrote:

> I'm working on a small C program to allow a  suere to start 1 program
> from another users home directory w/o access to that directory,
> niether of the users should need root access oor to know the others
> password to make this sucessful. I've got the basic structure down,
> but it asks for a password  if ran this way, waht would I need to
> compile the password into this too? Sinnce it's just not all that
> useful if the other party needs to have my passowrd to run it.
> 
> Code so far:
> 
>      #include <stdlib.h>
> 
>      int main(void)
>      {
>           system("su user -c /home/user/apppath/startup &");
>           return null;
>      }

This looks like a bad idea.  I mean, you can alter the permissions
of the application, or perhaps hard code permission settings
inside of the program.

Idealy you would just want to inherit the user's environment
and access the utility as them to not only avoid password
issues, but possible access control violations.

-- 
Tom Rhodes


More information about the wplug mailing list