Module Name:    src
Committed By:   mrg
Date:           Mon Mar 14 05:58:36 UTC 2022

Modified Files:
        src/libexec/httpd: bozohttpd.c

Log Message:
in bozo_init_prefs(), default to returning 1 (success) and if a
bozo_set_pref() fails, return 0 instead.  fixes PR#54785 but with
a different patch.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/libexec/httpd/bozohttpd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.138 src/libexec/httpd/bozohttpd.c:1.139
--- src/libexec/httpd/bozohttpd.c:1.138	Tue Jan  4 06:08:14 2022
+++ src/libexec/httpd/bozohttpd.c	Mon Mar 14 05:58:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.138 2022/01/04 06:08:14 kim Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.139 2022/03/14 05:58:36 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -2520,26 +2520,26 @@ bozo_init_httpd(bozohttpd_t *httpd)
 int
 bozo_init_prefs(bozohttpd_t *httpd, bozoprefs_t *prefs)
 {
-	int rv = 0;
+	int rv = 1;
 
 	/* make sure everything is clean */
 	(void) memset(prefs, 0x0, sizeof(*prefs));
 
 	/* set up default values */
 	if (!bozo_set_pref(httpd, prefs, "server software", SERVER_SOFTWARE))
-		rv = 1;
+		rv = 0;
 	if (!bozo_set_pref(httpd, prefs, "index.html", INDEX_HTML))
-		rv = 1;
+		rv = 0;
 	if (!bozo_set_pref(httpd, prefs, "public_html", PUBLIC_HTML))
-		rv = 1;
+		rv = 0;
 	if (!bozo_set_pref(httpd, prefs, "ssl timeout", SSL_TIMEOUT))
-		rv = 1;
+		rv = 0;
 	if (!bozo_set_pref(httpd, prefs, "initial timeout", INITIAL_TIMEOUT))
-		rv = 1;
+		rv = 0;
 	if (!bozo_set_pref(httpd, prefs, "header timeout", HEADER_WAIT_TIME))
-		rv = 1;
+		rv = 0;
 	if (!bozo_set_pref(httpd, prefs, "request timeout", TOTAL_MAX_REQ_TIME))
-		rv = 1;
+		rv = 0;
 
 	return rv;
 }

Reply via email to