Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/httpd As proposed in:
details: https://anonhg.NetBSD.org/src/rev/385e7b2dc090
branches: trunk
changeset: 815546:385e7b2dc090
user: agc <agc%NetBSD.org@localhost>
date: Tue May 24 21:18:29 2016 +0000
description:
As proposed in:
http://mail-index.netbsd.org/tech-userlevel/2016/05/18/msg009999.html
and
https://www.netbsd.org/~agc/bozo-20160517.diff
add a patch to httpd to return the version string of httpd itself, and use the
-G option on the command line to enable this. This gives httpd the ability to
show, from the command line, what version is running.
% /usr/build/obj/x86_64/usr/src/libexec/httpd/bozohttpd -G
bozohttpd version bozohttpd/20160415
%
diffstat:
libexec/httpd/CHANGES | 3 +++
libexec/httpd/bozohttpd.8 | 10 +++++++---
libexec/httpd/bozohttpd.c | 8 +++++++-
libexec/httpd/bozohttpd.h | 4 +++-
libexec/httpd/main.c | 14 ++++++++++++--
5 files changed, 32 insertions(+), 7 deletions(-)
diffs (127 lines):
diff -r cb90aa0c4991 -r 385e7b2dc090 libexec/httpd/CHANGES
--- a/libexec/httpd/CHANGES Tue May 24 20:32:33 2016 +0000
+++ b/libexec/httpd/CHANGES Tue May 24 21:18:29 2016 +0000
@@ -1,5 +1,8 @@
$eterna: CHANGES,v 1.78 2011/11/18 01:25:11 mrg Exp $
+changes in bozohttpd 20160517:
+ o add a bozo_get_version() function which returns the version number
+
changes in bozohttpd 20160415:
o add search-word support for CGI
o fix a security issue in CGI suffix handler support which would
diff -r cb90aa0c4991 -r 385e7b2dc090 libexec/httpd/bozohttpd.8
--- a/libexec/httpd/bozohttpd.8 Tue May 24 20:32:33 2016 +0000
+++ b/libexec/httpd/bozohttpd.8 Tue May 24 21:18:29 2016 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: bozohttpd.8,v 1.59 2016/04/15 17:57:21 mrg Exp $
+.\" $NetBSD: bozohttpd.8,v 1.60 2016/05/24 21:18:29 agc Exp $
.\"
.\" $eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
.\"
@@ -26,7 +26,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 12, 2015
+.Dd May 17, 2016
.Dt BOZOHTTPD 8
.Os
.Sh NAME
@@ -34,7 +34,7 @@
.Nd hyper text transfer protocol version 1.1 daemon
.Sh SYNOPSIS
.Nm
-.Op Fl EHVXefhnsu
+.Op Fl EGHVXefhnsu
.Op Fl C Ar suffix cgihandler
.Op Fl I Ar port
.Op Fl L Ar prefix script
@@ -132,6 +132,10 @@
flag from
.Nm
detaching from the tty and going into the background.
+.It Fl G
+Get the
+.Nm
+version string, print it on standard output, and exit.
.It Fl H
Causes directory index mode to hide files and directories
that start with a period, except for
diff -r cb90aa0c4991 -r 385e7b2dc090 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Tue May 24 20:32:33 2016 +0000
+++ b/libexec/httpd/bozohttpd.c Tue May 24 21:18:29 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bozohttpd.c,v 1.80 2016/04/15 17:57:21 mrg Exp $ */
+/* $NetBSD: bozohttpd.c,v 1.81 2016/05/24 21:18:29 agc Exp $ */
/* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */
@@ -2375,3 +2375,9 @@
return 1;
}
+
+int
+bozo_get_version(char *buf, size_t size)
+{
+ return snprintf(buf, size, "%s", SERVER_SOFTWARE);
+}
diff -r cb90aa0c4991 -r 385e7b2dc090 libexec/httpd/bozohttpd.h
--- a/libexec/httpd/bozohttpd.h Tue May 24 20:32:33 2016 +0000
+++ b/libexec/httpd/bozohttpd.h Tue May 24 21:18:29 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bozohttpd.h,v 1.45 2016/04/15 17:57:21 mrg Exp $ */
+/* $NetBSD: bozohttpd.h,v 1.46 2016/05/24 21:18:29 agc Exp $ */
/* $eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $ */
@@ -367,4 +367,6 @@
int bozo_set_pref(bozohttpd_t *, bozoprefs_t *, const char *, const char *);
char *bozo_get_pref(bozoprefs_t *, const char *);
+int bozo_get_version(char */*buf*/, size_t /*size*/);
+
#endif /* BOZOHTTOPD_H_ */
diff -r cb90aa0c4991 -r 385e7b2dc090 libexec/httpd/main.c
--- a/libexec/httpd/main.c Tue May 24 20:32:33 2016 +0000
+++ b/libexec/httpd/main.c Tue May 24 21:18:29 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.13 2015/12/28 07:37:59 mrg Exp $ */
+/* $NetBSD: main.c,v 1.14 2016/05/24 21:18:29 agc Exp $ */
/* $eterna: main.c,v 1.6 2011/11/18 09:21:15 mrg Exp $ */
/* from: eterna: bozohttpd.c,v 1.159 2009/05/23 02:14:30 mrg Exp */
@@ -118,6 +118,7 @@
" and private key file\n"
"\t\t\tin pem format and enable bozohttpd in SSL mode");
#endif /* NO_SSL_SUPPORT */
+ bozowarn(httpd, " -G print version number and exit");
bozoerr(httpd, 1, "%s failed to start", progname);
}
@@ -148,7 +149,7 @@
*/
while ((c = getopt(argc, argv,
- "C:EHI:L:M:P:S:U:VXZ:bc:defhi:np:st:uv:x:z:")) != -1) {
+ "C:EGHI:L:M:P:S:U:VXZ:bc:defhi:np:st:uv:x:z:")) != -1) {
switch (c) {
case 'L':
@@ -351,6 +352,15 @@
#endif /* NO_DIRINDEX_SUPPORT */
+ case 'G':
+ {
+ char version[128];
+
+ bozo_get_version(version, sizeof(version));
+ printf("bozohttpd version %s\n", version);
+ }
+ return 0;
+
default:
usage(&httpd, progname);
/* NOTREACHED */
Home |
Main Index |
Thread Index |
Old Index