gnosek/fcgiwrap — pull request #12 by Lekensteyn (2013-04-13 12:52:25+00:00)
Title: Add `-p path` option to restrict scripts

As discussed in #11. This patch adds a option to dumb-match the execution path. Globbing, regex matching or matching the leading path is deliberately not done for performance reasons, but more importantly, to keep the code concise and clear.

---
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.