chiark / gitweb /
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.