Commit Graph

11 Commits

Author SHA1 Message Date
Omar Polo 3e5418099f [cgi] always set some variables 2021-02-01 13:48:23 +00:00
Omar Polo 67528c1f82 don't add the query to argv
FRC3875 says that if the query does not contain any unecnoded "="
characters, we SHOULD treat the query string as a "search-string",
split in on "+" and add every word to the CGI argv.

In launch_cgi it's too late because iri->query is the *decoded* query!

I have in mind some refactoring around how we decode things, so this
is postponed.
2021-02-01 12:28:30 +00:00
Omar Polo 2fafa2d23e bring the CGI implementation in par with GLV-1.12556 2021-02-01 11:11:43 +00:00
Omar Polo 7808978667 fix computed offset
Oh my, this is such a stupid mistake.  It went undiscovered only
because I always used CGI scripts on the first vhost (and hence the
offset would be 0) and never on the others.
2021-02-01 08:38:48 +00:00
Omar Polo 1078229283 unveil x the vhosts directories 2021-01-25 15:02:55 +00:00
Omar Polo 28ec617809 sync the CGI environment with the manpage
while there also add SERVER_PROTOCOL
2021-01-24 10:06:48 +00:00
Omar Polo 0baf6bed2a pass the fd, not the path! 2021-01-24 09:53:54 +00:00
Omar Polo 05748e49fe chdir to the vhost root before exec'ing the CGI script 2021-01-24 09:15:05 +00:00
Omar Polo 710a71b2bb don't leak file descriptors 2021-01-19 18:16:09 +00:00
Omar Polo 568a09c220 fix requri construction
when we switched from one process to two, I introduced a small
optimisation: empty string are not send, so we receive NULL.
Constructing requri we need to make sure that relpath is not null.
2021-01-18 15:25:49 +00:00
Omar Polo 881a9dd9c2 split into two processes: listener and executor
this way, we can sandbox the listener with seccomp (todo) or capsicum
(already done) and still have CGI scripts.  When we want to exec, we
tell the executor what to do, the executor executes the scripts and
send the fd backt to the listener.
2021-01-16 19:41:34 +00:00