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


No differences found