aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit36f8b0346763c9e48c0f659a3bc28649645ef5c4 (patch)
tree022e7023135b295c3eea2cc1d5345e4c0f4deb6b
parentd223bd5bcbc7169cc6059ddf87de06fa3e91a2a4 (diff)
downloadmandoc-36f8b0346763c9e48c0f659a3bc28649645ef5c4.tar.gz
mandoc-36f8b0346763c9e48c0f659a3bc28649645ef5c4.tar.zst
mandoc-36f8b0346763c9e48c0f659a3bc28649645ef5c4.zip
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cgi.c b/cgi.c
index 81040abf..1e77a20b 100644
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.132 2016/05/28 13:40:48 schwarze Exp $ */
+/* $Id: cgi.c,v 1.133 2016/07/09 19:58:36 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@usta.de>
@@ -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);