Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 30 Apr 2014 12:02:17 -0400
From: John Mudd <johnbmudd@...il.com>
To: musl <musl@...ts.openwall.com>
Subject: gethostbyname and resolv.conf

FYI: Looks like the musl gethostbyname() doesn't use the "search" command
in the resolv.conf file.


$ cat test_gethostbyname.c
#include <stdio.h>
#include <netdb.h>

int main(int argc, char *argv[])
{
    struct hostent *lh = gethostbyname(argv[1]);

    if (lh)
        puts(lh->h_name);
    else
        herror("gethostbyname");

    return 0;
}
$


$ make  test_gethostbyname
gcc     test_gethostbyname.c   -o test_gethostbyname
$ test_gethostbyname lifeline.rx30.com
lifeline.rx30.com
$ test_gethostbyname lifeline
lifeline.rx30.com
$


$ make  test_gethostbyname
musl-gcc -fno-stack-protector    test_gethostbyname.c   -o
test_gethostbyname
$ test_gethostbyname lifeline.rx30.com
lifeline.rx30.com
$ test_gethostbyname lifeline
gethostbyname: Non-recoverable error
$


$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search rx30.com
$

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.