Simple C program to execute another program

Used if you need a simple chmod+s on a script. Compile a simple c app and then set it to chmod+s and then your script will run as the specified user.

Sample code:

#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
  execl("/usr/bin/svn", "svn", "export", "", "--username", 
"dtbaker", "--password", "bar",
 "/var/www/path/to/somewhere/", "--force",  (const char *) NULL);

Leave a Reply

Your email address will not be published.