Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!ut-ngp!infotel!pollux!bobkat!m5d From: m5d@bobkat.UUCP (Mike McNally ) Newsgroups: comp.unix.wizards Subject: execvp Message-ID: <452@bobkat.UUCP> Date: Wed, 21-Jan-87 10:21:59 EST Article-I.D.: bobkat.452 Posted: Wed Jan 21 10:21:59 1987 Date-Received: Thu, 22-Jan-87 20:14:31 EST Reply-To: m5d@bobkat.UUCP (Mike McNally (dlsh)) Distribution: na Organization: Digital Lynx, Inc; Dallas, TX Lines: 29 My 4.2BSD documentation for execl(3) describes a "bug" involving failed attempts to execute the shell to run a supposed command file. According to the "man" page, If execvp is called to execute a file that turns out to be a shell command file, and if it is impossible to execute the shell, the values of argv[0] and argv[-1] will be modified before return. This seemed very strange to me. Which "argv"? Why does it mess with argv[-1]?? I wrote a fake version of execve(2) which prints the address of the argument list passed to it, then sets "errno" to ENOEXEC and returns. This fools execvp, which then tries to run the shell. The argument list passed the second time is somewhere on the stack; it isn't my original "argv" at all. In short I can't cause this "bug" to manifest itself; does it really exist? -- **** **** **** At Digital Lynx, we're almost in Garland, but not quite **** **** **** Mike McNally Digital Lynx Inc. Software (not hardware) Person Dallas TX 75243 uucp: {texsun,killer,infotel}!pollux!bobkat!m5 (214) 238-7474