summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-07-09 19:58:36 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-07-09 19:58:36 +0000
commit83eb0bf972913c3f32bb3c29ab718b5af3a96e39 (patch)
tree366b748b38a0ce9c16335bedbfcb5158961260bd
parentb6a822a4dc76589a8b7fd22e49ed0514c5c971e4 (diff)
downloadmandoc-83eb0bf972913c3f32bb3c29ab718b5af3a96e39.tar.gz
Do not treat PATH_INFO as a complete path if it doesn't contain
a manpath. For example, this makes http://man.openbsd.org/mandoc work as expected. Bug reported by tb@, reminded by Svyatoslav Mishyn.
-rw-r--r--cgi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgi.c b/cgi.c
index ce7e1242..f9249c0e 100644
--- a/cgi.c
+++ b/cgi.c
@@ -1026,7 +1026,7 @@ main(void)
if (*path != '\0') {
parse_path_info(&req, path);
- if (access(path, F_OK) == -1)
+ if (req.q.manpath == NULL || access(path, F_OK) == -1)
path = "";
} else if ((querystring = getenv("QUERY_STRING")) != NULL)
parse_query_string(&req, querystring);