From admin@spare.westbend.net  Wed Mar 21 19:31:50 2001
Return-Path: <admin@spare.westbend.net>
Received: from spare.westbend.net (spare.westbend.net [216.106.246.5])
	by hub.freebsd.org (Postfix) with ESMTP id 6DA8337B71E
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Mar 2001 19:31:50 -0800 (PST)
	(envelope-from admin@spare.westbend.net)
Received: (from root@localhost)
	by spare.westbend.net (8.11.1/8.11.1) id f2M3Vnt71508;
	Wed, 21 Mar 2001 21:31:49 -0600 (CST)
	(envelope-from admin)
Message-Id: <200103220331.f2M3Vnt71508@spare.westbend.net>
Date: Wed, 21 Mar 2001 21:31:49 -0600 (CST)
From: "Scot W. Hetzel" <hetzels@westbend.net>
Reply-To: hetzels@westbend.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: [MAINTAINER] www/apache13-fp - Apache 1.3.19 sig 11 when ap_get_local_host() is called
X-Send-Pr-Version: 3.2

>Number:         25979
>Category:       ports
>Synopsis:       [MAINTAINER] www/apache13-fp - Apache 1.3.19 sig11 when ap_get_local_host() is called
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 21 19:40:01 PST 2001
>Closed-Date:    Thu Mar 22 16:21:06 PST 2001
>Last-Modified:  Thu Mar 22 16:21:22 PST 2001
>Originator:     Scot W. Hetzel
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
West Bend Internet
>Environment:


>Description:

When ServerName directive in httpd.conf is not set the Apache server will
cause a Sig 11 in ap_get_local_host().

See the following discussion for more info on this problem:

  http://docs.freebsd.org/cgi/getmsg.cgi?fetch=620754+0+current/freebsd-stable

>How-To-Repeat:

Don't set ServerName directive in httpd.conf.

>Fix:

Either set ServerName directive in httpd.conf or apply the following patch to
src/main/util.c.

NOTE: A Similar patch should be applied to the other Apache 1.3.19 ports.

--- patch-fj.orig	Sun Sep 26 21:52:25 1999
+++ patch-fj	Wed Mar 21 21:13:46 2001
@@ -1,6 +1,6 @@
---- src/main/util.c.orig	Sat Aug 14 03:35:50 1999
-+++ src/main/util.c	Mon Sep  6 13:12:55 1999
-@@ -635,7 +635,7 @@
+--- src/main/util.c.orig	Thu Feb  1 04:06:37 2001
++++ src/main/util.c	Wed Mar 21 21:12:35 2001
+@@ -708,7 +708,7 @@
      char *res;
  
      for (x = 0; (*line)[x]; x++) {
@@ -9,3 +9,20 @@
  	    pos = x;
  	    break;
  	}
+@@ -2040,7 +2040,6 @@
+ 	ap_log_error(APLOG_MARK, APLOG_WARNING, NULL,
+ 	             "%s: gethostname() failed to determine ServerName\n",
+                      ap_server_argv0);
+-	server_hostname = ap_pstrdup(a, "127.0.0.1");
+     }
+     else 
+     {
+@@ -2048,7 +2047,7 @@
+         if ((!(p = gethostbyname(str))) 
+             || (!(server_hostname = find_fqdn(a, p)))) {
+             /* Recovery - return the default servername by IP: */
+-            if (p->h_addr_list[0]) {
++            if (p && p->h_addr_list[0]) {
+                 ap_snprintf(str, sizeof(str), "%pA", p->h_addr_list[0]);
+ 	        server_hostname = ap_pstrdup(a, str);
+                 /* We will drop through to report the IP-named server */
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jeh 
State-Changed-When: Thu Mar 22 16:21:06 PST 2001 
State-Changed-Why:  
Committed.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25979 
>Unformatted:
