Wed Mar 8 00:39:44 2017 UTC ()
Put back a netbsd-6* workaround accidentally removed in ticket 1437:
Explicitly initialize uid to avoid a gcc warning.


(snj)
diff -r1.30.6.3 -r1.30.6.4 src/libexec/httpd/bozohttpd.c

cvs diff -r1.30.6.3 -r1.30.6.4 src/libexec/httpd/bozohttpd.c (expand / switch to unified diff)

--- src/libexec/httpd/bozohttpd.c 2017/03/07 07:16:08 1.30.6.3
+++ src/libexec/httpd/bozohttpd.c 2017/03/08 00:39:44 1.30.6.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bozohttpd.c,v 1.30.6.3 2017/03/07 07:16:08 snj Exp $ */ 1/* $NetBSD: bozohttpd.c,v 1.30.6.4 2017/03/08 00:39:44 snj Exp $ */
2 2
3/* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */ 3/* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */
4 4
5/* 5/*
6 * Copyright (c) 1997-2017 Matthew R. Green 6 * Copyright (c) 1997-2017 Matthew R. Green
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -2233,27 +2233,27 @@ int @@ -2233,27 +2233,27 @@ int
2233bozo_set_defaults(bozohttpd_t *httpd, bozoprefs_t *prefs) 2233bozo_set_defaults(bozohttpd_t *httpd, bozoprefs_t *prefs)
2234{ 2234{
2235 return bozo_init_httpd(httpd) && bozo_init_prefs(httpd, prefs); 2235 return bozo_init_httpd(httpd) && bozo_init_prefs(httpd, prefs);
2236} 2236}
2237 2237
2238/* set the virtual host name, port and root */ 2238/* set the virtual host name, port and root */
2239int 2239int
2240bozo_setup(bozohttpd_t *httpd, bozoprefs_t *prefs, const char *vhost, 2240bozo_setup(bozohttpd_t *httpd, bozoprefs_t *prefs, const char *vhost,
2241 const char *root) 2241 const char *root)
2242{ 2242{
2243 struct passwd *pw; 2243 struct passwd *pw;
2244 extern char **environ; 2244 extern char **environ;
2245 static char *cleanenv[1] = { NULL }; 2245 static char *cleanenv[1] = { NULL };
2246 uid_t uid; 2246 uid_t uid = 0;
2247 int uidset = 0; 2247 int uidset = 0;
2248 char *chrootdir; 2248 char *chrootdir;
2249 char *username; 2249 char *username;
2250 char *portnum; 2250 char *portnum;
2251 char *cp; 2251 char *cp;
2252 int dirtyenv; 2252 int dirtyenv;
2253 2253
2254 dirtyenv = 0; 2254 dirtyenv = 0;
2255 2255
2256 if (vhost == NULL) { 2256 if (vhost == NULL) {
2257 httpd->virthostname = bozomalloc(httpd, MAXHOSTNAMELEN+1); 2257 httpd->virthostname = bozomalloc(httpd, MAXHOSTNAMELEN+1);
2258 if (gethostname(httpd->virthostname, MAXHOSTNAMELEN+1) < 0) 2258 if (gethostname(httpd->virthostname, MAXHOSTNAMELEN+1) < 0)
2259 bozoerr(httpd, 1, "gethostname"); 2259 bozoerr(httpd, 1, "gethostname");