summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mandoc/Makefile8
-rw-r--r--usr.bin/mandoc/cgi.c16
-rw-r--r--usr.bin/mandoc/man.cgi.825
3 files changed, 17 insertions, 32 deletions
diff --git a/usr.bin/mandoc/Makefile b/usr.bin/mandoc/Makefile
index e4c65206e66..fe1a7cc15ac 100644
--- a/usr.bin/mandoc/Makefile
+++ b/usr.bin/mandoc/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.101 2016/03/30 06:38:46 jmc Exp $
+# $OpenBSD: Makefile,v 1.102 2016/07/10 10:03:15 schwarze Exp $
.include <bsd.own.mk>
@@ -62,11 +62,5 @@ installcgi: man.cgi
${INSTALL} ${INSTALL_COPY} -S ${INSTALL_STRIP} \
-o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
man.cgi ${DESTDIR}/var/www/cgi-bin/man.cgi
- ${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}/var/www/man/mandoc/man1
- ${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}/var/www/man/mandoc/man8
- ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
- ${.CURDIR}/apropos.1 ${DESTDIR}/var/www/man/mandoc/man1/apropos.1
- ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
- ${.CURDIR}/man.cgi.8 ${DESTDIR}/var/www/man/mandoc/man8/man.cgi.8
.include <bsd.prog.mk>
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index 4b9e8da9690..f11ca893b28 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgi.c,v 1.72 2016/07/09 19:44:52 schwarze Exp $ */
+/* $OpenBSD: cgi.c,v 1.73 2016/07/10 10:03:15 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@usta.de>
@@ -468,9 +468,6 @@ validate_manpath(const struct req *req, const char* manpath)
{
size_t i;
- if ( ! strcmp(manpath, "mandoc"))
- return 1;
-
for (i = 0; i < req->psz; i++)
if ( ! strcmp(manpath, req->p[i]))
return 1;
@@ -497,9 +494,9 @@ pg_index(const struct req *req)
resp_searchform(req, FOCUS_QUERY);
printf("<p>\n"
"This web interface is documented in the\n"
- "<a href=\"/%s%smandoc/man8/man.cgi.8\">man.cgi</a>\n"
+ "<a href=\"/%s%sman.cgi.8\">man.cgi(8)</a>\n"
"manual, and the\n"
- "<a href=\"/%s%smandoc/man1/apropos.1\">apropos</a>\n"
+ "<a href=\"/%s%sapropos.1\">apropos(1)</a>\n"
"manual explains the query syntax.\n"
"</p>\n",
scriptname, *scriptname == '\0' ? "" : "/",
@@ -882,12 +879,7 @@ pg_show(struct req *req, const char *fullpath)
free(manpath);
return;
}
-
- if (strcmp(manpath, "mandoc")) {
- free(req->q.manpath);
- req->q.manpath = manpath;
- } else
- free(manpath);
+ free(manpath);
if ( ! validate_filename(file)) {
pg_error_badrequest(
diff --git a/usr.bin/mandoc/man.cgi.8 b/usr.bin/mandoc/man.cgi.8
index b92e0cdeb58..71c01c47bf2 100644
--- a/usr.bin/mandoc/man.cgi.8
+++ b/usr.bin/mandoc/man.cgi.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: man.cgi.8,v 1.17 2016/07/07 14:32:24 schwarze Exp $
+.\" $OpenBSD: man.cgi.8,v 1.18 2016/07/10 10:03:15 schwarze Exp $
.\"
.\" Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 7 2016 $
+.Dd $Mdocdate: July 10 2016 $
.Dt MAN.CGI 8
.Os
.Sh NAME
@@ -220,13 +220,16 @@ run
.Pp
.Dl make man.cgi
.Pp
-and copy the files to the proper locations.
-Reading the
-.Cm installcgi
-target in the
-.Pa Makefile
-can help with that, but do not run it without carefully checking it
-because the directory layouts of web servers vary greatly.
+and copy the resulting binary to the proper location,
+for example using the command:
+.Pp
+.Dl make installcgi
+.Pp
+In addition to that, make sure the default manpath contains the files
+.Pa man1/apropos.1
+and
+.Pa man8/man.cgi.8 ,
+or the documentation links at the bottom of the index page will not work.
.Ss URI interface
.Nm
uniform resource identifiers are not needed for interactive use,
@@ -367,10 +370,6 @@ Default
data directory containing all the manual trees.
Can be overridden by
.Dv MAN_DIR .
-.It Pa /man/mandoc/man1/apropos.1 , /man/mandoc/man8/man.cgi.8
-Manual pages documenting
-.Nm
-itself, linked from the index page.
.It Pa /man/manpath.conf
The list of available manpaths, one per line.
If any of the lines in this file contains a slash