View Single Post

   
  #3 (permalink)  
Old 01-18-2008, 07:38 PM
Bill Marcum
 
Posts: n/a
Default Re: C program(& script) for running commands

On 11 Sep 2006 06:11:31 -0700, richardrothwell@gmail.com
<richardrothwell@gmail.com> wrote:
> HI there, I have a small C program which acts as a wrapper to run an
> SUID shell script for running root commands. The current coding for
> this is as follows:
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(void)
> {
> system("/path/to/script");
> return(0);
>
> }
>
>
> But although the C prog will run the script, I need to develop this
> further so that i can run like this:
>
> ./wrapper.c date
>

Wouldn't you be reinventing the wheel of sudo? If you really want to do
this, you could study the sudo source code.


--
<Joy> that's a Kludge(TM)
<knghtbrd> It Works(tm)
<Joy> AIX works(TM)
<knghtbrd> no it doesn't
Reply With Quote