Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 23344 invoked by uid 500); 7 Jul 2000 13:57:30 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 23328 invoked from network); 7 Jul 2000 13:57:29 -0000 From: "William A. Rowe, Jr." To: Subject: RE: more 1.3 ServerName gripes Date: Fri, 7 Jul 2000 08:52:58 -0500 Message-ID: <000201bfe81b$5262f040$345985d0@corecomm.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <200007070314.DAA14617@hand.dotat.at> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Importance: Normal > From: Tony Finch [mailto:dot@dotat.at] > Sent: Thursday, July 06, 2000 10:15 PM > > OK, maybe my configuration is screwy, but I'm being bitten by this > code in find_fqdn() in util.c: > > if (!strchr(p->h_name, '.')) { > 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; > } > return ap_pstrdup(a, (void *) p->h_name); > > On my laptop hand.dotat.at I have arranged for the hostname to usually > resolve to 127.0.0.1 so that things work OK when the net isn't there; > a reverse lookup of 127.0.0.1 returns the primary name "localhost" and > the aliases "hand" and "hand.dotat.at". Obviously I would like > find_fqdn() to return "hand.dotat.at" but the strncasecmp() prevents > this. > > I want to remove it; can anyone think of a reason why I shouldn't? Yes... I'd look at a patch like this instead: if (!strchr(p->h_name, '.')) { 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]); } for (x = 0; p->h_aliases[x]; ++x) { if (strchr(p->h_aliases[x], '.')) return ap_pstrdup(a, p->h_aliases[x]); } } This way, if you had a localhost.dotat.at - then it would pick it up as the primary preference. Since you don't, it will pick up the first dotted alias it can find.