From 830b8c521829e0403502ffe5a278a0351e144f3f Mon Sep 17 00:00:00 2001 From: jruoho Date: Mon, 13 Jul 2020 09:38:57 +0000 Subject: [PATCH] Do not report status code 500 to blocklistd(8) Add -DNO_BLOCKLIST_SUPPORT to Makefile.boot. --- libexec/httpd/Makefile.boot | 2 +- libexec/httpd/bozohttpd.8 | 12 +++++------- libexec/httpd/bozohttpd.c | 5 ++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/libexec/httpd/Makefile.boot b/libexec/httpd/Makefile.boot index 8bf7534de06e..74be409faedd 100644 --- a/libexec/httpd/Makefile.boot +++ b/libexec/httpd/Makefile.boot @@ -6,7 +6,7 @@ CC= cc OPT= -O LARGE_CFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -LOCAL_CFLAGS= -DNO_LUA_SUPPORT -D_GNU_SOURCE +LOCAL_CFLAGS= -DNO_LUA_SUPPORT -DNO_BLOCKLIST_SUPPORT -D_GNU_SOURCE CFLAGS= $(OPT) $(LARGE_CFLAGS) $(LOCAL_CFLAGS) GROFF= groff -Tascii diff --git a/libexec/httpd/bozohttpd.8 b/libexec/httpd/bozohttpd.8 index bb8eae2873bc..368efecb9c68 100644 --- a/libexec/httpd/bozohttpd.8 +++ b/libexec/httpd/bozohttpd.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: bozohttpd.8,v 1.81 2020/07/11 08:10:52 jruoho Exp $ +.\" $NetBSD: bozohttpd.8,v 1.82 2020/07/13 09:38:57 jruoho Exp $ .\" .\" $eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $ .\" @@ -466,16 +466,14 @@ compilation option. .Pp Upon occurrence, .Nm -reports three HTTP status codes to +reports two HTTP status codes to .Xr blocklistd 8 as failures: .Em 401 -(``Unauthorized'') , -.Em 403 -(``Forbidden'') , +(``Unauthorized'') and -.Em 500 -(``Internal Server Error'') . +.Em 403 +(``Forbidden'') . Of these, .Em 401 is the one received upon authorization failure with the diff --git a/libexec/httpd/bozohttpd.c b/libexec/httpd/bozohttpd.c index 378814528d18..10f16357f704 100644 --- a/libexec/httpd/bozohttpd.c +++ b/libexec/httpd/bozohttpd.c @@ -1,4 +1,4 @@ -/* $NetBSD: bozohttpd.c,v 1.116 2020/07/11 08:10:52 jruoho Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.117 2020/07/13 09:38:57 jruoho Exp $ */ /* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */ @@ -2297,8 +2297,7 @@ bozo_http_error(bozohttpd_t *httpd, int code, bozo_httpreq_t *request, pfilter_notify(BLOCKLIST_AUTH_FAIL, code); break; - case 403: /* FALLTHROUGH */ - case 500: + case 403: pfilter_notify(BLOCKLIST_ABUSIVE_BEHAVIOR, code); break; }