Xref: utzoo comp.unix.questions:9122 comp.lang.c:12388 Path: utzoo!attcan!uunet!mcvax!ukc!stc!john From: john@tcom.stc.co.uk (John Blair) Newsgroups: comp.unix.questions,comp.lang.c Subject: General Unix/C question Keywords: userid Make su segmentation core Message-ID: <641@jura.tcom.stc.co.uk> Date: 2 Sep 88 14:23:00 GMT Organization: STC Telecomms, Harlow Technical Centre, Harlow. ESSEX Lines: 20 Below is the program I use to run a unix command under the userid of the program owner. However when the command passed is Make with parameters and stdout and stderr file redirection I sometimes get segmentation problems and core dumped. If I "su" as the userid of the program owner and execute the same Make command I do not get segmentation problems. What is wrong with the C program? /* note, this must run with set uid on execution */ main(argc,argv) int argc; char * argv[]; { setuid(geteuid()); setgid(getegid()); execvp(argv[1],argv+1); }