summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormbalmer <mbalmer@openbsd.org>2008-05-21 08:57:38 +0000
committermbalmer <mbalmer@openbsd.org>2008-05-21 08:57:38 +0000
commit681d511896aab20d84fdc2fa14abb25c5019e413 (patch)
tree7b1e985fe5fb94067533913ca5e3accf77daf582
parentThe default address family to be used is stored in a global variable. If (diff)
downloadwireguard-openbsd-681d511896aab20d84fdc2fa14abb25c5019e413.tar.xz
wireguard-openbsd-681d511896aab20d84fdc2fa14abb25c5019e413.zip
Document and implement -U option, fix usage information for '-?'.
Documentation corrections and spelling by jmc.
-rw-r--r--usr.sbin/httpd/README.IPv66
-rw-r--r--usr.sbin/httpd/htdocs/manual/ipv6.html5
-rw-r--r--usr.sbin/httpd/httpd.812
-rw-r--r--usr.sbin/httpd/src/main/http_main.c12
4 files changed, 25 insertions, 10 deletions
diff --git a/usr.sbin/httpd/README.IPv6 b/usr.sbin/httpd/README.IPv6
index 47349830709..e9bd4c9d1b0 100644
--- a/usr.sbin/httpd/README.IPv6
+++ b/usr.sbin/httpd/README.IPv6
@@ -1,4 +1,4 @@
-$OpenBSD: README.IPv6,v 1.1 2008/05/13 20:09:19 mbalmer Exp $
+$OpenBSD: README.IPv6,v 1.2 2008/05/21 08:57:38 mbalmer Exp $
IPv6 support for the OpenBSD httpd(8)
@@ -12,8 +12,10 @@ Basically you can write IPv6 address where IPv4 address fits.
extra command-line argument:
-4 Assume IPv4 address on ambiguous directives (default)
-6 Assume IPv6 address on ambiguous directives
+ -U Don't assume a specific address family on ambigous
+ directives
- The above two can be used, for example, to disambiguate
+ The above options can be used, for example, to disambiguate
"BindAddress *".
base commands:
diff --git a/usr.sbin/httpd/htdocs/manual/ipv6.html b/usr.sbin/httpd/htdocs/manual/ipv6.html
index cb2e46e5c55..29503958804 100644
--- a/usr.sbin/httpd/htdocs/manual/ipv6.html
+++ b/usr.sbin/httpd/htdocs/manual/ipv6.html
@@ -38,10 +38,13 @@ Basically you can write IPv6 address where IPv4 address fits.
<dl>
<dt>-4</dt><dd>Assume IPv4 address on ambiguous directives (default)</dd>
<dt>-6</dt><dd>Assume IPv6 address on ambiguous directives</dd>
+<dt>-U</dt><dd>Don't assume a specific address family on ambiguous
+directives</dd>
</dl>
<p>
-The above two can be used, for example, to disambiguate "BindAddress *".
+The above options can be used to remove ambiguities in directives,
+for example "BindAddress *".
</p>
<h2>base commands</h2>
diff --git a/usr.sbin/httpd/httpd.8 b/usr.sbin/httpd/httpd.8
index c17f6beb6d2..7e549e5a42f 100644
--- a/usr.sbin/httpd/httpd.8
+++ b/usr.sbin/httpd/httpd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: httpd.8,v 1.29 2008/05/09 12:59:59 jmc Exp $
+.\" $OpenBSD: httpd.8,v 1.30 2008/05/21 08:57:38 mbalmer Exp $
.\" Copyright (c) 1995-1997 David Robinson. All rights reserved.
.\" Copyright (c) 1997-1999 The Apache Group. All rights reserved.
.\" Copyright (c) 1998-1999 Bob Beck. All rights reserved.
@@ -50,7 +50,7 @@
.\" Supercomputing Applications, University of Illinois, Urbana-Champaign.
.\" For more information on the Apache Group and the Apache HTTP server
.\" project, please see <http://www.apache.org/>.
-.Dd $Mdocdate: May 9 2008 $
+.Dd $Mdocdate: May 21 2008 $
.Dt HTTPD 8
.Os
.Sh NAME
@@ -59,7 +59,7 @@
.Sh SYNOPSIS
.Nm httpd
.Bk -words
-.Op Fl 46FhLlSTtuVvX
+.Op Fl 46FhLlSTtUuVvX
.Op Fl C Ar directive
.Op Fl c Ar directive
.Op Fl D Ar parameter
@@ -162,7 +162,9 @@ The options are as follows:
.It Fl 4
Assume IPv4 addresses on ambiguous directives (default).
Along with
-.Fl 6 ,
+.Fl 6
+and
+.Fl U ,
this can be used to remove ambiguities in cases such as "BindAddress *".
.It Fl 6
Assume IPv6 addresses on ambiguous directives.
@@ -231,6 +233,8 @@ code of 0 (Syntax OK) or return code not equal to 0 (Syntax Error).
Run syntax tests for configuration files only, including DocumentRoot checks.
The program immediately exits after this syntax parsing with either a return
code of 0 (Syntax OK) or return code not equal to 0 (Syntax Error).
+.It Fl U
+Do not assume a specific address familiy for ambiguous specifications.
.It Fl u
By default
.Nm
diff --git a/usr.sbin/httpd/src/main/http_main.c b/usr.sbin/httpd/src/main/http_main.c
index ace88475e8d..28db0863353 100644
--- a/usr.sbin/httpd/src/main/http_main.c
+++ b/usr.sbin/httpd/src/main/http_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: http_main.c,v 1.50 2008/05/09 08:06:28 mbalmer Exp $ */
+/* $OpenBSD: http_main.c,v 1.51 2008/05/21 08:57:38 mbalmer Exp $ */
/* ====================================================================
* The Apache Software License, Version 1.1
@@ -694,13 +694,15 @@ static void usage(char *bin)
for (i = 0; i < strlen(bin); i++)
pad[i] = ' ';
pad[i] = '\0';
- fprintf(stderr, "Usage: %s [-FhLlSTtuVvX] [-C directive] [-c directive] [-D parameter]\n", bin);
+ fprintf(stderr, "Usage: %s [-46FhLlSTtUuVvX] [-C directive] [-c directive] [-D parameter]\n", bin);
fprintf(stderr, " %s [-d serverroot] [-f config]\n", pad);
fprintf(stderr, "Options:\n");
fprintf(stderr, " -C directive : process directive before reading config files\n");
fprintf(stderr, " -c directive : process directive after reading config files\n");
fprintf(stderr, " -D parameter : define a parameter for use in <IfDefine name> directives\n");
fprintf(stderr, " -d serverroot : specify an alternate initial ServerRoot\n");
+ fprintf(stderr, " -4 : assume IPv4 for ambigous directirves (default)\n");
+ fprintf(stderr, " -6 : assume IPv6 for ambigous directives\n");
fprintf(stderr, " -F : run main process in foreground, for process supervisors\n");
fprintf(stderr, " -f config : specify an alternate ServerConfigFile\n");
fprintf(stderr, " -h : list available command line options (this page)\n");
@@ -709,6 +711,7 @@ static void usage(char *bin)
fprintf(stderr, " -S : show parsed settings (currently only vhost settings)\n");
fprintf(stderr, " -T : run syntax check for config files (without docroot check)\n");
fprintf(stderr, " -t : run syntax check for config files (with docroot check)\n");
+ fprintf(stderr, " -U : unspecified address family for ambigous directives\n");
fprintf(stderr, " -u : unsecure mode: do not chroot into ServerRoot\n");
fprintf(stderr, " -V : show compile settings\n");
fprintf(stderr, " -v : show version number\n");
@@ -3248,7 +3251,7 @@ int REALMAIN(int argc, char *argv[])
ap_setup_prelinked_modules();
while ((c = getopt(argc, argv,
- "D:C:c:xXd:Ff:vVlLR:StThu46"
+ "D:C:c:xXd:Ff:vVlLR:StThUu46"
#ifdef DEBUG_SIGSTOP
"Z:"
#endif
@@ -3324,6 +3327,9 @@ int REALMAIN(int argc, char *argv[])
case 'u':
ap_server_chroot = 0;
break;
+ case 'U':
+ ap_default_family = PF_UNSPEC;
+ break;
case '?':
usage(argv[0]);
}