httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <stodd...@raleigh.ibm.com>
Subject Re: [patch-final 1.3.13] defaulted servername
Date Wed, 14 Jun 2000 20:54:17 GMT
I'll review it but it will be later this evening or tomorrow.

Bill

----- Original Message ----- 
From: William A. Rowe, Jr. <wrowe@lnd.com>
To: <new-httpd@apache.org>
Sent: Wednesday, June 14, 2000 4:04 PM
Subject: RE: [patch-final 1.3.13] defaulted servername


> Here is the final patch... it gets around several otherwise fatal
> errors by using a numeric IP hostname.  Failure of gethostname()
> is compensated by the host name "127.0.0.1".  In all cases (unlike
> the current code) their assumption is reported and logged as an
> error, to push them to properly set the ServerName directive.
> 
> *Please* review and vote... I agree with the assertion that the
> users should RTFM... but that doesn't always happen, even in Unix :-)
> These error messages are more comprehensive, and I've localized all
> the changes to the ap_get_local_host function.
> 
> Bill
> 
> p.s. I consider change to httpd.conf-dist-win manditory, since it is 
> now out of sync with httpd.conf-dist.
> 
> > From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> > Sent: Sunday, June 11, 2000 1:57 PM
> > 
> > My proposed solution is attached.  I'm sure someone else could
> > do better, or improve upon this...
> > 
> > > From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> > > Sent: Sunday, June 11, 2000 1:17 PM
> > > 
> > > This is -not- a Win32 post, for those trying to avoid filling their
> > > heads with that drivel :-)  Please read on...
> > > 
> > > I've been waiting for some space on my overly full plate to 
> > > look for the 'correct' solution to this...
> > > 
> > > > From: stoddard@locus.apache.org [mailto:stoddard@locus.apache.org]
> > > > Sent: Wednesday, May 24, 2000 12:53 PM
> > > > 
> > > > stoddard    00/05/24 10:53:20
> > > > 
> > > >   Modified:    conf     httpd.conf-dist-win
> > > >                src      CHANGES
> > > >   Log:
> > > >   Win32: Set ServerName to 127.0.0.1 in the default windows 
> > > httpd.conf file.
> > > >   PR: 5509, 5783, 5953, 5903, 5983, 5259, 5515, 5858
> > > >   
> > > >   Submitted by: Oliver Wendemuth <owendemuth@ko.hbv.de>
> > > >   
> > > >   Index: httpd.conf-dist-win
> > > >   
> > > ===================================================================
> > > >   @@ -230,7 +230,7 @@
> > > >    # You will have to access it by its address (e.g., 
> > > http://123.45.67.89/)
> > > >    # anyway, and this will make redirections work in a  sensible way.
> > > >    #
> > > >   -#ServerName new.host.name
> > > >   +ServerName 127.0.0.1
> > > 
> > > Why then, doesn't the existing default code work in Win32?
> > > 
> > > First, MS allows a user to 'name' their machine with a 
> > > completely bogus
> > > name, and this is what is being retrieved (joes pc would be 
> > > an example).
> > > 
> > > Second, ap_get_local_host() has the following code (BEOS 
> > path omitted)
> > > 
> > >     if (gethostname(str, sizeof(str) - 1) != 0) {
> > > perror("Unable to gethostname");
> > > exit(1);
> > >     }  // we are good so far...
> > >     str[sizeof(str) - 1] = '\0';
> > >     if ((!(p = gethostbyname(str))) || (!(server_hostname = 
> > > find_fqdn(a, p)))) {
> > >       // and we land here because find_fdqn fails...
> > > fprintf(stderr, "%s: cannot determine local host 
> > > name.\n", ap_server_argv0);
> > > 
> > > Ok, so digging down into find_fdqn()
> > > 
> > >     if (!strchr(p->h_name, '.')) {  // we refuse any name 
> > > sans the '.'s
> > > for (x = 0; p->h_aliases[x]; ++x) {
> > >     if (strchr(p->h_aliases[x], '.') &&
> > > (!strncasecmp(p->h_aliases[x], p->h_name, 
> > > strlen(p->h_name))))
> > > return ap_pstrdup(a, p->h_aliases[x]);
> > > }
> > > return NULL;  // and uneqivocably die here...
> > > 
> > > so this is no solution.  Two options from here (others may choose):
> > > 
> > > 1) On failure of find_fdqn, return the ip address string 
> > > -rather than die-
> 
> This is the attached patch.
> 
> > > 2) Accept bogosity of a non-'.' name with -strong warnings- 
> > >    that the private name will not be recognized by the 
> > >    network-at-large, and continue.
> 
> I finally rejected this solution out of hand.
> 
> > > In -either- case we will proceed to look for an fdqn, if one 
> > > is available.
> > > 
> > > Neither solution is complete - we should be attempting a true 
> > > reverse-dns
> > > test, but I'll let someone else commit that if it's their desire.
> > > 
> > > Which solution (or what other solution) can we live with to kill the
> > > explicit ServerName in the 1.3.13 httpd.conf-dist-win?
> > 
> > This patch is a variation of option 1, with additional warnings that
> > assumptions have been made...
> 
> And I think this is key for *ALL* platforms to be warned that the server
> conf is an assumption!
> 


Mime
View raw message