summaryrefslogtreecommitdiff
path: root/fcgiwrap.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't free socket_url at exitGrzegorz Nosek2015-04-191-3/+2
| | | | | | While this generally is the right thing to do, we don't clean up the rest of the memory (we're exiting in a moment, anyway) and conditionally freeing a single variable seems wrong.
* Return the new fd directly from setup_socket()Grzegorz Nosek2015-04-191-4/+8
| | | | | We either have a proper descriptor (>0) or an error (<0) so we don't strictly need the fd_out parameter
* Use-after-free fixJohan Ström2014-08-151-4/+6
|
* SIGTERM, not SIGQUIT..Johan Ström2014-08-151-1/+1
|
* Clean up unix socket on exit so we can start properly.Johan Ström2014-08-151-3/+30
| | | | | If unix socket is not cleaned up, we will fail to bind on it the next startup round (Address already in use).
* prefork: Fix 100% CPU usage in parent processPeter Wu2014-01-091-1/+1
| | | | | | | | | When a child process is terminated, the parent calls waitpid() to check for dead children. This returns -1 on error (e.g. there are no other children or a signal interrupted waitpid()), the pid (> 0) for dead children OR 0 if there are some children which are still alive. Fixes gnosek/fcgiwrap#18.
* Add `-p path` option to restrict scriptsPeter Wu2013-04-131-2/+27
| | | | | | | | | | | | | If the purpose of fcgiwrap is to wrap cgit, then I want to be sure that no other program can be executed under the privileges of the fcgiwrap user. When the option `-p path` is given, only the programs specified by `path` are allowed to execute (multiple occurrences of `-p` are merged to form a list of allowed programs). Note that this value will be matched literally, no attempt is done to canonicalize the path. This also implies that glob patterns or directories will never match.
* Bump version numberGrzegorz Nosek2013-02-031-1/+1
|
* Add help for -f optionGrzegorz Nosek2013-02-031-0/+1
|
* Close FCGI socket before executing scriptGrzegorz Nosek2013-02-031-0/+2
| | | | | We do it in a rather violent way to avoid FCGI shutdown (the parent must keep the socket alive and working)
* Unify CGI error handlingGrzegorz Nosek2013-02-031-7/+7
| | | | | | | | | | | | Use the same error handler for 403s and 502s. This basically ports the required fixes from error_403 (previous commit) to the 502 error on failed exec(). Two user-visible side effects: - error message now says "403 Forbidden" instead of "403" - failed exec() gets logged over stderr (also, use \r\n instead of \n as a line seprator but that has been fixed up by the parent process before).
* Fix 403 error handlingGrzegorz Nosek2013-02-031-19/+21
| | | | | | | | | Report 403 errors over normal stdout/stderr (after setting up the pipes). Properly reporting the error response over stdout requires: - flushing the I/O, which would otherwise get buffered - skipping atexit handlers (would otherwise close the FCGI connection cleanly, interfering with the parent process still trying to talk over it)
* Check file permissions even when we get full path over FastCGIGrzegorz Nosek2013-02-031-0/+2
| | | | | It's not a security issue (executing the file would fail, anyway) but it's a sensible sanity check.
* Cleanup -Wmissing-prototypes compiler warningsDave Reisner2012-08-191-5/+5
|
* Add support for socket activation via systemdDave Reisner2012-08-191-0/+12
| | | | | | This prevents the need for starting fcgiwrap explicitly, or using a tool such as spawn-fcgi. The type of socket does not matter, we merely accept a single FD passed from pid 1 and listen on it.
* split listen() logic into separate functionDave Reisner2012-08-191-18/+24
|
* Create -f option to allow sending stderr to fcgi logsJoseph Gooch2011-12-081-2/+10
|
* fixing compilation under FreeBSDQuentin Stievenart2010-08-161-0/+1
|
* Add `-s' option to enable binding by fcgiwrap itselfGrzegorz Nosek2010-06-031-2/+123
| | | | This should ease testing and deployment in simpler cases
* Use SCRIPT_FILENAME environment variable when availableGrzegorz Nosek2010-06-031-1/+5
| | | | | | If present, it overrides DOCUMENT_ROOT and SCRIPT_NAME and prevents mangling of PATH_INFO. Should allow cleaner configs when script names don't come from request URIs directly.
* adjusted option _-c_ help textW-Mark Kubacki2010-05-251-1/+1
|
* fcgiwrap to rely on definitions provided by autoconf/autoreconfW-Mark Kubacki2010-05-251-4/+4
|
* nitpicks as described in today's email to MarkJordi Mallach2010-05-251-4/+4
| | | | Signed-off-by: W-Mark Kubacki <wmark@hurrikane.de>
* help screen, along with version set to 1.0W-Mark Kubacki2010-03-221-1/+13
|
* Compile fixes for OpenBSDGrzegorz Nosek2009-07-171-2/+3
| | | | Thanks to Toni Mueller, original author of the patch
* Officially release fcgiwrap under the MIT licenceGrzegorz Nosek2009-03-171-0/+25
|
* Close child's pipe ends after dup2()ing them to the right placesGrzegorz Nosek2009-03-171-0/+4
| | | | Thanks to Fenixk19 for the report and patch.
* Better diagnostics for 403 errorsGrzegorz Nosek2009-02-281-12/+19
| | | | Passed via FastCGI stderr, so should end up in webserver's error log
* Simple prefork supportGrzegorz Nosek2009-02-281-2/+81
| | | | (start as fcgiwrap -c <num-children>, with a suitable socket on FD 0)
* Don't eat characters after final CR/LFGrzegorz Nosek2008-12-031-2/+2
|
* Restore default SIGCHLD handler (also SIGPIPE for completeness)Grzegorz Nosek2008-06-101-0/+2
|
* Keep passing data from CGI to FastCGI even after a descriptor closes earlyGrzegorz Nosek2008-06-101-1/+1
|
* Fix CR/LF mangling to skip response bodyGrzegorz Nosek2008-05-051-0/+5
|
* Split out passing the request to a separate functionGrzegorz Nosek2008-05-051-6/+17
|
* Fix off-by-one while walking the bufferGrzegorz Nosek2008-03-221-1/+1
|
* Use a much prettier state machineGrzegorz Nosek2008-03-221-53/+71
|
* Implement a simple state machine to fixup CGI reply line endingsGrzegorz Nosek2008-03-221-8/+88
|
* Inherit environment from parent in CGI processesGrzegorz Nosek2008-03-221-0/+68
|
* Fix classic off-by-one in select() callGrzegorz Nosek2008-03-161-1/+1
|
* Send CGI stderr to real stderr, not to fastcgi streamGrzegorz Nosek2008-03-161-2/+20
|
* Use INT_MIN instead of -1 as sentinel in max_va()Grzegorz Nosek2008-03-161-2/+5
|
* Chdir to script's directory before exec (per CGI spec)Grzegorz Nosek2008-03-161-0/+15
|
* Mostly rewritten for robustness and prettier codeGrzegorz Nosek2007-09-301-44/+159
|
* Improved CGI permission logicGrzegorz Nosek2007-03-101-9/+37
| | | | Symlinks are now allowed if owner matches
* Initial commitGrzegorz Nosek2007-03-101-0/+170