aboutsummaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-04-28 12:43:17 +0000
committerOmar Polo <op@omarpolo.com>2021-04-28 12:43:17 +0000
commit9cc630aa63cfd22553912b5a1fc41a71776cb272 (patch)
treeb1fa171477f23a869acdc374797a91ff638bdd78 /parse.y
parente6ca8eb1561ade7484a0249ffd1234cdf94e2562 (diff)
added ``env'' option to define environment vars for CGI scripts
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 12 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 0646f13..df62e81 100644
--- a/parse.y
+++ b/parse.y
@@ -59,7 +59,7 @@ void advance_loc(void);
%token TIPV6 TPORT TPROTOCOLS TMIME TDEFAULT TTYPE
%token TCHROOT TUSER TSERVER TPREFORK
-%token TLOCATION TCERT TKEY TROOT TCGI TLANG TLOG TINDEX TAUTO
+%token TLOCATION TCERT TKEY TROOT TCGI TENV TLANG TLOG TINDEX TAUTO
%token TSTRIP TBLOCK TRETURN TENTRYPOINT TREQUIRE TCLIENT TCA
%token TERR
@@ -133,6 +133,17 @@ servopt : TCERT TSTRING { host->cert = ensure_absolute_path($2); }
memmove($2, $2+1, strlen($2));
host->entrypoint = $2;
}
+ | TENV TSTRING TSTRING {
+ struct envlist *e;
+
+ e = xcalloc(1, sizeof(*e));
+ e->name = $2;
+ e->value = $3;
+ if (TAILQ_EMPTY(&host->env))
+ TAILQ_INSERT_HEAD(&host->env, e, envs);
+ else
+ TAILQ_INSERT_TAIL(&host->env, e, envs);
+ }
| TKEY TSTRING { host->key = ensure_absolute_path($2); }
| TROOT TSTRING { host->dir = ensure_absolute_path($2); }
| locopt