chiark / gitweb /
www-cgi/: Centralize environment variable filtering.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 30 Jan 2013 00:09:47 +0000 (00:09 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 2 Feb 2013 13:31:03 +0000 (13:31 +0000)
commitf601a2c663d9135dec19172a593502864d10393e
tree31c4ffd0a297740bb447da51919a44c47160866b
parent77a36cae0e59a1e17c12c71fd7ff49be0958b11d
www-cgi/: Centralize environment variable filtering.

Rather than have a different loop in each program which trundles through
a filter list picking up environment variables and doing things to the
ones that match, invent a new function `filter_environment' which does
the job, with extra steroids.

The new function works the other way around: it iterates over the
environment, comparing each variable to the filter list.  It also
supports some simple prefix-matching (`*' suffix) and blacklisting (`!'
prefix) operations.

Some new limits are introduced, on the maximum length of an environment
variable name, and the total number of variables accepted by `ucgi':
this is because these are no longer limited implicitly by the whitelist,
since it may contain wildcards and suchlike.
www-cgi/ucgi.c
www-cgi/ucgi.h
www-cgi/ucgicommon.c
www-cgi/ucgitarget.c