From owner-freebsd-bugs Wed Sep 9 19:00:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA02300 for freebsd-bugs-outgoing; Wed, 9 Sep 1998 19:00:11 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA02212 for ; Wed, 9 Sep 1998 19:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id TAA17436; Wed, 9 Sep 1998 19:00:00 -0700 (PDT) Received: from midten.fast.no (midten.fast.no [195.139.251.11]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA01409 for ; Wed, 9 Sep 1998 18:55:22 -0700 (PDT) (envelope-from tegge@not.fast.no) Received: from not.fast.no (IDENT:tegge@not.fast.no [195.139.251.12]) by midten.fast.no (8.9.1/8.9.1) with ESMTP id DAA08062 for ; Thu, 10 Sep 1998 03:55:13 +0200 (CEST) Received: (from tegge@localhost) by not.fast.no (8.8.8/8.8.8) id DAA13840; Thu, 10 Sep 1998 03:55:12 +0200 (CEST) (envelope-from tegge@not.fast.no) Message-Id: <199809100155.DAA13840@not.fast.no> Date: Thu, 10 Sep 1998 03:55:12 +0200 (CEST) From: Tor Egge Reply-To: tegge@not.fast.no To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/7876: gethostbyname flags temporary failure as unknown host Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7876 >Category: bin >Synopsis: gethostbyname flags temporary failure as unknown host >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 9 19:00:00 PDT 1998 >Last-Modified: >Originator: Tor Egge >Organization: Fast Search & Transfer ASA >Release: FreeBSD 3.0-CURRENT i386 >Environment: FreeBSD 3.0-current from Jul 30 1998 FreeBSD not.fast.no 3.0-CURRENT FreeBSD 3.0-CURRENT #15: Sat Sep 5 18:24:21 CEST 1998 root@not.fast.no:/usr/src/sys/compile/NOT_SMP i386 >Description: If hosts is after bind in /etc/host.conf, the error code from the DNS lookup is overwritten by the error code from the /etc/hosts lookup. This means that temporary lookup failures are incorrectly flagged as permanent lookup failures. >How-To-Repeat: Add rules to sendmail 8.9.1 to reject mail from hosts not registered in DNS. Be a victim of routing problems, cutting you off from all root name servers. Wait for cached entries to time out in your local name server. Discover that sendmail has bounced email from a machine properly registered in DNS. >Fix: Index: lib/libc/net/gethostnamadr.c =================================================================== RCS file: /home/ncvs/src/lib/libc/net/gethostnamadr.c,v retrieving revision 1.13 diff -u -r1.13 gethostnamadr.c --- gethostnamadr.c 1997/12/25 04:21:08 1.13 +++ gethostnamadr.c 1998/09/10 01:23:36 @@ -136,6 +136,7 @@ { struct hostent *hp = 0; int nserv = 0; + int tempfail = NETDB_SUCCESS; if (!service_done) init_services(); @@ -143,12 +144,17 @@ while (!hp) { switch (service_order[nserv]) { case SERVICE_NONE: + if (tempfail != NETDB_SUCCESS && + h_errno == HOST_NOT_FOUND) + h_errno = tempfail; return NULL; case SERVICE_HOSTS: hp = _gethostbyhtname(name, type); break; case SERVICE_BIND: hp = _gethostbydnsname(name, type); + if (hp == NULL) + tempfail = h_errno; break; case SERVICE_NIS: hp = _gethostbynisname(name, type); @@ -164,6 +170,7 @@ { struct hostent *hp = 0; int nserv = 0; + int tempfail = NETDB_SUCCESS; if (!service_done) init_services(); @@ -171,12 +178,17 @@ while (!hp) { switch (service_order[nserv]) { case SERVICE_NONE: - return 0; + if (tempfail != NETDB_SUCCESS && + h_errno == HOST_NOT_FOUND) + h_errno = tempfail; + return NULL; case SERVICE_HOSTS: hp = _gethostbyhtaddr(addr, len, type); break; case SERVICE_BIND: hp = _gethostbydnsaddr(addr, len, type); + if (hp == NULL) + tempfail = h_errno; break; case SERVICE_NIS: hp = _gethostbynisaddr(addr, len, type); >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message