I have the following example program:
#include int main(int argc, char ** argv){ char buf[100]; printf(\"Please enter your name: \");
Using execve("/bin/sh", 0, 0); is cruel and unusual punishment for the shell. It gives it no arguments or environment at all - not even its own program name, nor even such mandatory environment variables as PATH or HOME.
execve("/bin/sh", 0, 0);