diff --exclude='*~' -urN lighttpd-1.3.11.orig/src/mod_cgi.c lighttpd-1.3.11/src/mod_cgi.c --- lighttpd-1.3.11.orig/src/mod_cgi.c 2005-02-22 22:22:46.000000000 -0500 +++ lighttpd-1.3.11/src/mod_cgi.c 2005-02-23 06:24:09.490319288 -0500 @@ -690,12 +690,14 @@ #ifndef __WIN32 - /* stat the exec file */ - if (-1 == (stat(cgi_handler->ptr, &st))) { - log_error_write(srv, __FILE__, __LINE__, "sbss", - "stat for cgi-handler", cgi_handler, - "failed:", strerror(errno)); - return -1; + if (cgi_handler->used > 1) { + /* stat the exec file */ + if (-1 == (stat(cgi_handler->ptr, &st))) { + log_error_write(srv, __FILE__, __LINE__, "sbss", + "stat for cgi-handler", cgi_handler, + "failed:", strerror(errno)); + return -1; + } } if (pipe(to_cgi_fds)) {