summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2018-06-13 15:08:24 +0000
committerreyk <reyk@openbsd.org>2018-06-13 15:08:24 +0000
commitde6c234a34e292f05dd3ef28eea4c4936fe7daa6 (patch)
treebf383ab158a89af17450f8da5974dee7414cc99c /usr.sbin/httpd
parentAvoid a timing side-channel leak when generating DSA and ECDSA signatures. (diff)
downloadwireguard-openbsd-de6c234a34e292f05dd3ef28eea4c4936fe7daa6.tar.xz
wireguard-openbsd-de6c234a34e292f05dd3ef28eea4c4936fe7daa6.zip
Rename httpd.conf "root strip" option to "request strip".
"root strip" was semantically incorrect and did cause some confusion as it never stripped the root but the client's request path. Discussed with many. Heads up: this is a grammar change that also affects acme-client(1) configurations (see current.html). OK claudio@
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r--usr.sbin/httpd/httpd.conf.518
-rw-r--r--usr.sbin/httpd/parse.y15
2 files changed, 25 insertions, 8 deletions
diff --git a/usr.sbin/httpd/httpd.conf.5 b/usr.sbin/httpd/httpd.conf.5
index b1f82c195c1..79d3af529bf 100644
--- a/usr.sbin/httpd/httpd.conf.5
+++ b/usr.sbin/httpd/httpd.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: httpd.conf.5,v 1.96 2018/06/11 12:12:51 reyk Exp $
+.\" $OpenBSD: httpd.conf.5,v 1.97 2018/06/13 15:08:24 reyk Exp $
.\"
.\" Copyright (c) 2014, 2015 Reyk Floeter <reyk@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: June 11 2018 $
+.Dd $Mdocdate: June 13 2018 $
.Dt HTTPD.CONF 5
.Os
.Sh NAME
@@ -458,12 +458,18 @@ instead of the log files.
Disable any previous
.Ic block
in a location.
-.It Ic root Ar option
-Configure the document root and options for the request path.
+.It Ic request Ar option
+Configure the options for the request path.
Valid options are:
.Bl -tag -width Ds
-.It Ar directory
-Set the document root of the server.
+.It Ic strip Ar number
+Strip
+.Ar number
+path components from the beginning of the request path before looking
+up the stripped-down path at the document root.
+.El
+.It Ic root Ar directory
+Configure the document root of the server.
The
.Ar directory
is a pathname within the
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y
index 6827a9d2775..0dc283b2705 100644
--- a/usr.sbin/httpd/parse.y
+++ b/usr.sbin/httpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.101 2018/06/11 10:04:12 denis Exp $ */
+/* $OpenBSD: parse.y,v 1.102 2018/06/13 15:08:24 reyk Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -491,6 +491,7 @@ serveroptsl : LISTEN ON STRING opttls port {
YYERROR;
}
}
+ | request
| root
| directory
| logformat
@@ -809,7 +810,17 @@ rootflags : STRING {
free($1);
srv->srv_conf.flags |= SRVFLAG_ROOT;
}
- | STRIP NUMBER {
+ ;
+
+request : REQUEST requestflags
+ | REQUEST '{' optnl requestflags_l '}'
+ ;
+
+requestflags_l : requestflags optcommanl requestflags_l
+ | requestflags optnl
+ ;
+
+requestflags : STRIP NUMBER {
if ($2 < 0 || $2 > INT_MAX) {
yyerror("invalid strip number");
YYERROR;