This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[bill@kayhay.com] libc/1625: resolver ignores "multi on" in /etc/host.conf



Hi glibc folks,

we received the appended bug report.  IMHO we cannot support "multi on"
at all with glibc (at least not in /etc/hosts) - and should remove the
support for parsing "multi on" from res_hconf.c.  We parse this
correctly - but never use it at all.

Does somebody see a way to fix this?

Andreas



Topics:
   libc/1625: resolver ignores "multi on" in /etc/host.conf


----------------------------------------------------------------------

Date: Fri, 3 Mar 2000 01:15:54 -0500
From: bill@kayhay.com
To: bugs@gnu.org
Subject: libc/1625: resolver ignores "multi on" in /etc/host.conf
Message-Id: <200003030615.BAA20008@delysid.gnu.org>


>Number:         1625
>Category:       libc
>Synopsis:       resolver ignores "multi on" in /etc/host.conf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Fri Mar 03 01:20:01 EST 2000
>Last-Modified:
>Originator:     bill@kayhay.com
>Organization:
net
>Release:        2.1.2
>Environment:
RedHat 6.1
>Description:
If my /etc/hosts file contains two entries for one host, eg.:
10.0.0.2   bar
10.0.0.3   bar
then, if /etc/host.conf contains the line "multi on", gethostbyname(bar) 
returns only the first entry.  That is, if ptr = gethostbyname(bar), then
ptr->h_addr_list[1] == NULL.
>How-To-Repeat:
Insert the above entries (or equivalent) in /etc/hosts, then run the 
following small program.

/* Test the resolver's "multi" option */

#include <stdio.h>
#include <netdb.h>
#include <arpa/inet.h>

int main (void) {

  struct hostent *myptr;
  int i;

  if ( (myptr = gethostbyname ("bar")) != NULL) {

    for (i=0; myptr->h_addr_list[i] != NULL; i++) {     

      printf("%s: %s\n", myptr->h_name,
             inet_ntoa (*(struct in_addr*)myptr->h_addr_list[i]));
    }
  }

  return 0;
}%0
>Fix:
>Audit-Trail:
>Unformatted:


------------------------------

End of forwardmvElKi Digest
***************************



-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]