summaryrefslogtreecommitdiff
path: root/lib/libc/asr
AgeCommit message (Collapse)Author
2015-11-23Remove support for "lookup yp" in /etc/resolv.conf. This historicalTheo de Raadt
wart is incompatible with pledge, because suddenly a "dns" operation needs "getpw" access to ypbind/ypserv, etc. file + dns access is enough for everyone, sorry if you were using that old SunOS 4.x style mechanism, but it is now gone. ok semarie millert florian
2015-11-05Set the name server counter in __res_state correctly if a nameserverAlexander Bluhm
from asr_ctx was skiped. Missed in previous commit. OK deraadt@
2015-11-05When filling the __res_state compatibiliy struct, a long list ofAlexander Bluhm
nameservers could overflow the dns search pointers. Restrict the number, size and address family of nameservers in res_init(3). This fixes a crash in sendmail. Only programs that use the bind resolver internals directly are affected. OK deraadt@ millert@
2015-10-28We are always using _PATH_RESCONF, so no need to remember the path onEric Faurot
the resolver. ok millert@ deraadt@
2015-10-28Remove support for [addr]:port syntax from the "nameserver" line.Theo de Raadt
This extension never made it to other systems. (pledge is also happy with this. The idea of DNS @ any port collides with pledge encouraring differentiation between DNS and non-DNS sockets) ok phessler jung sthen kettenis
2015-10-23Switch to using SOCK_DNS flag, rather than the dnssocket() andTheo de Raadt
dnssonnect() calls. Be a bit careful crossing over this, need a kernel no older than Monday. ok guenther tedu semarie
2015-10-18libc DNS functions will now use the new dnssocket() / dnsconnect()Theo de Raadt
system calls. These signal to the pledge kernel code that a DNS transaction is happening. These special sockets only work well with port 53 (there are some cute plans...). Programs calling pledge "inet" will not work! You need pledge "dns", and of course, you need a fairly fresh kernel. ok guenther kettenis tedu
2015-10-08fix conditionalsEric Faurot
ok deraadt@
2015-10-08Handle case where no hint is passed in. Found as a crash of fdm by jturner@Theo de Raadt
2015-10-07getaddrinfo_async() shouldn't unconditionally intialize the resolverTheo de Raadt
via _asr_use_resolver(). If the hint specifies for AI_NUMERICHOST, create a transient lookup context which won't try to open /etc/reslov.conf ok eric guenther
2015-10-07getaddrinfo() should not res_init() unconditionally, but allow lowerTheo de Raadt
layers to decide. The request could be AI_NUMERICHOST. [And the process could be tame()-constrained to not open /etc/resolv.conf] ok eric guenther
2015-10-05Wrap <resolv.h> so that internal calls go directPhilip Guenther
ok millert@
2015-10-03Initially eric developers asr as a side-load style library for async DNS.Theo de Raadt
When it was integrated as the main resolver, a bunch of strange initialization code remained. Start whittling away at this, piece by piece, to make it more clear. ok eric
2015-10-03missing asr* -> _asr* symbol rename for building with debug codeEric Faurot
ok jca@
2015-10-02make a && && & block more readable. no binary change.Theo de Raadt
discussed with otto
2015-09-20remove bogus includes of err.hEric Faurot
2015-09-20use _PATH_RESCONF directlyEric Faurot
2015-09-20remove unused static functionEric Faurot
2015-09-14Wrap <asr.h> so internal calls go direct and all the symbols are weakPhilip Guenther
2015-09-14Finish wrapping <netdb.h> so that calls go direct and the symbols are all weakPhilip Guenther
2015-09-09Hide all unnecessary asr / resolver related API with _ prefixes.Theo de Raadt
direction & ok guenther
2015-09-09Use SOCK_NONBLOCK in a couple more placesPhilip Guenther
ok deraadt@
2015-09-02use _PATH_RESCONFTheo de Raadt
2015-08-16Fix test against INADDR_LOOPBACKJeremie Courreges-Anglas
ok gilles@
2015-06-20Rename print_sockaddr() to avoid symbol visibility problemsJeremie Courreges-Anglas
print_sockaddr is internal to asr, and conflicts with ports/net/samba4. ok eric@
2015-06-04make sure to check for resolv.conf update the first time the resolverEric Faurot
is used after pid has changed. ok deraadt@
2015-05-29fix a possible off-by-one when reading /etc/hosts if it doesn't endEric Faurot
with a newline. ok jca@
2015-05-26simply use _PATH_HOSTS where appropriateEric Faurot
2015-05-25Kill outdated comment.Jeremie Courreges-Anglas
ok eric@
2015-05-25Skip search domains iteration if RES_DNSRCH and/or RES_DEFNAMES is unset.Eric Faurot
prodded by Brad ok jca@
2015-05-25getnameinfo(3) doesn't need to initialize the resolver when it's only usedEric Faurot
for address/port formatting (e.g. NI_NUMERICHOST). ok deraadt@ jca@
2015-05-05AI_ADDRCONFIG: skip loopback addresses, not loopback interfaces.Jeremie Courreges-Anglas
This is what RFC3493 suggests. Fixes AI_ADDRCONFIG on setups where global addresses are configured only on loopback interfaces. Discussed with and ok eric@ gilles@
2015-05-05Move the AI_ADDRCONFIG setup to its own function.Jeremie Courreges-Anglas
Input from and ok gilles@ eric@
2015-03-02gethostbyname(3) would fail when more than 16 addrs/aliases were returned.Bryan Steele
Bump MAXADDRS/ALIASES to the original of 35, and silently ignore extras instead of failing. Noticed by markson on freenode. OK eric@ "with revised diff", phessler@.
2015-02-14Limit AI_ADDRCONFIG effects to DNS queries.Jeremie Courreges-Anglas
This is what RFC 2553 initially described, sadly RFC 3493 stopped limiting scope to DNS. This can result in nonsensical failures with loopback addresses, link-local addresses, raw addresses and /etc/hosts entries. with and ok eric@ sperreault@
2015-01-30fix a possible NULL-deref when trying to deref ifa->ifa_addrGilles Chehade
ok eric@
2015-01-16Move to the <limits.h> universe.Theo de Raadt
review by millert, binary checking process with doug, concept with guenther
2015-01-14change _yp_domain[] to HOST_NAME_MAX+1, and re-arrange those who includeTheo de Raadt
it to get limits.h early enough
2014-11-18Nuke some obvious #include duplications.Kenneth R Westerback
ok espie@ deraadt@ millert@ tedu@
2014-11-02Fix a NULL deref when getting an actual result for an invalid hostnameEric Faurot
in gethostbyname(). Similar fix for getnetbyname(). ok deraadt@ daniel@ jca@
2014-09-15When fopen()ing internal to libc (the API doesn't support the usePhilip Guenther
of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@
2014-09-15Use _PATH_NETWORKS for "/etc/networks"Philip Guenther
ok miod@
2014-07-23Make queries using the search list for hostname lookups fail withEric Faurot
NO_DATA/EAI_NODATA when the hostname param is an empty string. So far, they were using the entries in the search list with no additional component, which is not really expected. reported by jsing@ and a few others ok deraadt@, "makes sense" jsing@
2014-05-13skip incomplete entries in /etc/hosts and /etc/networksEric Faurot
fix null deref spotted by Seth Hanford, pinpointed by dtucker@ ok florian@
2014-05-10remove warning by adding explicit parentheses around && within ||Charles Longeau
ok sperreault@
2014-04-28Implement AI_ADDRCONFIGsperreault
This is a getaddrinfo() flag that is defined thusly in RFC 3493: If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be returned only if an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. The loopback address is not considered for this case as valid as a configured address. For example, when using the DNS, a query for AAAA records should occur only if the node has at least one IPv6 address configured (other than IPv6 loopback) and a query for A records should occur only if the node has at least one IPv4 address configured (other than the IPv4 loopback). The flag is set by default when hints is NULL. ok Eric Faurot, Jason McIntyre
2014-04-17Don't default enable the debug functionality with its unprotected getenv().Philip Guenther
ok eric@ sthen@ deraadt@
2014-03-26Make the asr API public. Install asr.h to /usr/include.h and manpages.Eric Faurot
Include tweaks suggested by mpi@ ok deraadt@
2014-03-26update manpageEric Faurot
2014-03-25Cleanup and simplify the API to be exposed. Use better names forEric Faurot
structures, functions and defines. discussed with and ok deraadt@ guenther@