home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume30 / netvote / part01 / single / perlsu.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-19  |  392 b   |  24 lines

  1. /*
  2.  * PERLSU.C - SetUid wrapper for PERL
  3.  */
  4. #include <malloc.h>
  5. /*
  6.  * Here is the working directory. Should be defined on the command line
  7.  */
  8. #ifndef PWD
  9. #define PWD "./"
  10. #endif
  11.  
  12. main(argc,argv,envp) int argc; char *argv[]; char *envp[]; {
  13.   
  14.   char *buf;
  15.  
  16.   buf = malloc(sizeof(argv[0]) + 100);
  17.   strcpy(buf,PWD);
  18.   strcat(buf,argv[0]);
  19.   strcat(buf,".pl");
  20.   execve(buf,argv,envp);
  21. }
  22.  
  23.   
  24.