This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/19369] New: Default domain name not reset by res_ninit when "search" / "domain" entry is removed from resolv.conf
- From: "rob at robwu dot nl" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 16 Dec 2015 11:37:56 +0000
- Subject: [Bug network/19369] New: Default domain name not reset by res_ninit when "search" / "domain" entry is removed from resolv.conf
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19369
Bug ID: 19369
Summary: Default domain name not reset by res_ninit when
"search" / "domain" entry is removed from resolv.conf
Product: glibc
Version: 2.24
Status: NEW
Severity: normal
Priority: P2
Component: network
Assignee: rob at robwu dot nl
Reporter: rob at robwu dot nl
Target Milestone: ---
Created attachment 8850
--> https://sourceware.org/bugzilla/attachment.cgi?id=8850&action=edit
Repeatedly uses res_ninit, getaddrinfo, res_nclose.
When I call res_ninit(&_res), I expect resolver functions such as getaddrinfo
to use exactly the same configuration as if the program was run for the first
time (which then uses /etc/resolv.conf).
This is not the case for the "search" (or "domain") entries. When the "domain"
entry is removed, the resolver still uses the previously configured domain
name.
Steps to reproduce:
1. Compile the attached program (gcc -Wall getaddr.c). This program repeatedly
calls res_ninit, getaddrinfo("www", ...), res_nclose.
2. Edit /etc/resolv.conf, add "search example.com"
3. Run ./a.out www
4. Edit /etc/resolv.conf, remove "search example.com"
5. Run ./a.out www
Expected results:
At step 3, the following is output (because "www" -> "www.example.com", which
exists).
getaddrinfo("www") = 0
93.184.216.34:0
At step 5, the following should be output (or anything else that is not
"www.example.com", -2 = EAI_NONAME):
getaddrinfo("www") = -2
Actual results:
At step 5, the same result as step 3 is shown, which indicates that the default
domain suffix is not reset.
--
You are receiving this mail because:
You are on the CC list for the bug.