chiark
/
gitweb
/
~mdw
/
userv-utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
www-cgi/: Allow customization of the environment filters.
[userv-utils]
/
www-cgi
/
ucgi.c
diff --git
a/www-cgi/ucgi.c
b/www-cgi/ucgi.c
index 006f8ae4cd93223986d15c146967d032908eeefa..a2ebe64a4b0e18d9247216bfd71c4b6965d5069e 100644
(file)
--- a/
www-cgi/ucgi.c
+++ b/
www-cgi/ucgi.c
@@
-30,7
+30,7
@@
#include "ucgi.h"
#include "ucgi.h"
-static const char *const envok[] = {
+static const char *const
default_
envok[] = {
"AUTH_TYPE",
"CONTENT_TYPE",
"CONTENT_LENGTH",
"AUTH_TYPE",
"CONTENT_TYPE",
"CONTENT_LENGTH",
@@
-73,7
+73,8
@@
static void add_userv_var(const char *fulln,
int main(int argc, const char **argv) {
char *username;
int main(int argc, const char **argv) {
char *username;
- const char *slash2, *pathi, *av;
+ const char *slash2, *pathi, *ev, *av;
+ const char *const *envok;
size_t usernamelen, l;
struct buildargs args;
pid_t child, rchild;
size_t usernamelen, l;
struct buildargs args;
pid_t child, rchild;
@@
-91,6
+92,14
@@
int main(int argc, const char **argv) {
if (argc > MAX_ARGS) error("too many arguments");
if (argc > MAX_ARGS) error("too many arguments");
+ ev= getenv("UCGI_ENV_FILTER");
+ if (ev)
+ envok= load_filters(LOADF_MUST, ev, LF_END);
+ else {
+ envok= load_filters(0, "/etc/userv/ucgi.env-filter", LF_END);
+ if (!envok) envok= default_envok;
+ }
+
pathi= getenv("PATH_INFO");
if (!pathi) error("PATH_INFO not found");
D( if (debugmode) {
pathi= getenv("PATH_INFO");
if (!pathi) error("PATH_INFO not found");
D( if (debugmode) {