chiark / gitweb /
www-cgi/: Allow customization of the environment filters.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 30 Jan 2013 00:35:02 +0000 (00:35 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 2 Feb 2013 13:31:04 +0000 (13:31 +0000)
commitf7b4be5ac332970bb5937ae586cea6de64d14f66
treea421cf10899451528769dc4a9b597df70c148015
parenta8e8db26410497a781ca36f59951201d55711f3a
www-cgi/: Allow customization of the environment filters.

Sites can now configure `ucgi's environment filters, and end users can
configure `ucgitarget's filters.

By default, `ucgi' will look in `/etc/userv/ucgi.env-filter', but if
`UCGI_ENV_FILTER' is set in its environment, it will look there
instead.  The filter may contain wildcards and so on.

By default, `ucgitarget' looks in `.userv/ucgitarget.env-filter', or
`/etc/userv/ucgitarget.env-filter', if the former doesn't exist; but if
passed a `-e FILTER' option on its command line, it will look in the
file FILTER instead.  This filter may /not/ contain wildcards.

In both cases, if an explicitly named filter file can't be found then
the program fails; if the default filter files can't be found then they
fall back to built-in lists.

The reason for the asymmetry in interfaces is: it's hard to pass
command-line options to CGI scripts from webservers, but pretty easy to
set environment variables; whereas it's hard to pass environment
variables to a service program in a Userv configuration file, but easy
to pass command-line arguments.
www-cgi/ucgi.c
www-cgi/ucgi.h
www-cgi/ucgicommon.c
www-cgi/ucgitarget.c