You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Martin Kraemer <Ma...@mch.sni.de> on 1998/01/20 13:02:43 UTC

[PORT] execve() starting #! scripts

Hi,

I am currently working on a patch that wraps the execle() and execve()
calls in order to (#ifdef NEED_HASHBANG_EMUL) allow them to execute
scripts even when the underlying operating system doesn't allow direct
starting of hashbang-scripts.

*   This patch, when #defined in, wraps the two system calls, catches
    possible ENOEXEC errors and merges the #! argv and the original argv
    and finally retries to execve() the interpreter. (not recursive!)

*   I took the #!-parser from tcsh because I know it works reliably.
    Similar code is there already for OS/2 and Win32 (two different
    parsers!) but they do their job _before_ calling the spawn* functions.
    These routines could take advantage of the hashbang parser as well.

I thought of adding either an os/unix/os_execve.c or an ap/ap_execve.c
source file, with conf.h re#defining execve() to ap_execve() if the
NEED_HASHBANG_EMUL define is set.

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request