From d41d389658dad632dd8f2f2afa85d0f12e4ac574 Mon Sep 17 00:00:00 2001 From: reyk Date: Wed, 6 Aug 2014 20:29:54 +0000 Subject: [PATCH] Change grammar to remove a shift/reduce conflict that was introduced with the ssl options. "listen on $ip port 443 ssl" turns into "listen on $ip ssl port 443". ok florian@ --- etc/examples/httpd.conf | 4 ++-- usr.sbin/httpd/httpd.conf.5 | 4 ++-- usr.sbin/httpd/parse.y | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/examples/httpd.conf b/etc/examples/httpd.conf index c276797b8be..f8364fd37b9 100644 --- a/etc/examples/httpd.conf +++ b/etc/examples/httpd.conf @@ -1,4 +1,4 @@ -# $OpenBSD: httpd.conf,v 1.9 2014/08/05 18:01:10 reyk Exp $ +# $OpenBSD: httpd.conf,v 1.10 2014/08/06 20:29:54 reyk Exp $ # # Macros @@ -47,7 +47,7 @@ server "www.example.com" { # An HTTPS server using SSL/TLS server "secure.example.com" { - listen on 127.0.0.1 port 443 ssl + listen on 127.0.0.1 ssl port 443 # Define server-specific log files relative to /logs log { access "secure-access.log", error "secure-error.log" } diff --git a/usr.sbin/httpd/httpd.conf.5 b/usr.sbin/httpd/httpd.conf.5 index d0c91942a7b..da9730d0b20 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.28 2014/08/06 18:21:14 reyk Exp $ +.\" $OpenBSD: httpd.conf.5,v 1.29 2014/08/06 20:29:54 reyk Exp $ .\" .\" Copyright (c) 2014 Reyk Floeter .\" @@ -165,7 +165,7 @@ root directory of .Nm httpd and defaults to .Pa /run/slowcgi.sock . -.It Ic listen on Ar address Ic port Ar number Op Ic ssl +.It Ic listen on Ar address Oo Ic ssl Oc Ic port Ar number Set the listen address and port. .It Ic location Ar path { ... } Specify server configuration rules for a specific location. diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y index 532e56a394a..9a1e1221df5 100644 --- a/usr.sbin/httpd/parse.y +++ b/usr.sbin/httpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.33 2014/08/06 18:21:14 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.34 2014/08/06 20:29:54 reyk Exp $ */ /* * Copyright (c) 2007 - 2014 Reyk Floeter @@ -273,7 +273,7 @@ serveropts_l : serveropts_l serveroptsl nl | serveroptsl optnl ; -serveroptsl : LISTEN ON STRING port optssl { +serveroptsl : LISTEN ON STRING optssl port { struct addresslist al; struct address *h; struct server *s; @@ -290,14 +290,14 @@ serveroptsl : LISTEN ON STRING port optssl { YYERROR; } else s = srv; - if ($4.op != PF_OP_EQ) { + if ($5.op != PF_OP_EQ) { yyerror("invalid port"); free($3); YYERROR; } TAILQ_INIT(&al); - if (host($3, &al, 1, &$4, NULL, -1) <= 0) { + if (host($3, &al, 1, &$5, NULL, -1) <= 0) { yyerror("invalid listen ip: %s", $3); free($3); YYERROR; @@ -310,7 +310,7 @@ serveroptsl : LISTEN ON STRING port optssl { s->srv_conf.prefixlen = h->prefixlen; host_free(&al); - if ($5) { + if ($4) { s->srv_conf.flags |= SRVFLAG_SSL; } } -- 2.20.1