summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/cgi.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-07-09 19:44:52 +0000
committerschwarze <schwarze@openbsd.org>2016-07-09 19:44:52 +0000
commit86f4328b8fa757e0974b8dcb3348dde500f3d0a1 (patch)
treea385aaa23ea765fe0f5c76abf4fb4bbed03d932c /usr.bin/mandoc/cgi.c
parentSimplify the i.MX6 platform code. The list of board devices is now (diff)
downloadwireguard-openbsd-86f4328b8fa757e0974b8dcb3348dde500f3d0a1.tar.xz
wireguard-openbsd-86f4328b8fa757e0974b8dcb3348dde500f3d0a1.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.
Diffstat (limited to 'usr.bin/mandoc/cgi.c')
-rw-r--r--usr.bin/mandoc/cgi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index 1a16b60407f..4b9e8da9690 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgi.c,v 1.71 2016/05/28 13:40:44 schwarze Exp $ */
+/* $OpenBSD: cgi.c,v 1.72 2016/07/09 19:44:52 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@usta.de>
@@ -1024,7 +1024,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);