From 36f8b0346763c9e48c0f659a3bc28649645ef5c4 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 9 Jul 2016 19:58:36 +0000 Subject: 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. --- cgi.c | 4 ++-- 1 file 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 * Copyright (c) 2014, 2015, 2016 Ingo Schwarze @@ -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); -- cgit v1.2.3-56-ge451