summaryrefslogtreecommitdiff
path: root/resolv/nss_dns
AgeCommit message (Collapse)Author
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2017-09-26resolv/nss_dns/dns-host.c: Fix typo in commentFlorian Weimer
And only the resolv/map*.h actually contain implementations.
2017-09-06nss_dns: Remove dead PTR IPv4-to-IPv6 mapping codeFlorian Weimer
2017-08-07Consistently use uintN_t not u_intN_t everywhere.Joseph Myers
This patch changes the remaining uses of the old nonstandard u_intN_t types in glibc to use the C99 uintN_t instead, except for the definitions of those typedefs and the tests of them in the c++-types test. This follows the previous such fix for libm, and being consistent in using uintN_t makes sense as a global cleanup. Tested for x86_64, and with build-many-glibcs.py. * catgets/catgets.c (catgets): Use uintN_t instead of u_intN_t. * catgets/catgetsinfo.h (struct catalog_obj): Likewise. (struct catalog_info): Likewise. * inet/htontest.c (lo): Likewise. (foo): Likewise. * inet/inet_lnaof.c (inet_lnaof): Likewise. * inet/inet_net.c (inet_network): Likewise. * inet/inet_netof.c (inet_netof): Likewise. * inet/rcmd.c (__ivaliduser): Likewise. (iruserok): Likewise. * locale/loadlocale.c (_nl_intern_locale_data): Likewise. * locale/programs/locale-spec.c (locale_special): Likewise. * nis/nis_findserv.c (struct findserv_req): Likewise. (__nis_findfastest_with_timeout): Likewise. * nss/test-netdb.c (test_network): Likewise. * resolv/inet_neta.c (inet_neta): Likewise. * resolv/ns_date.c (ns_datetosecs): Likewise. (SECS_PER_DAY): Likewise. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. * resolv/res_comp.c (__putlong): Likewise. (__putshort): Likewise. (_getlong): Likewise. (_getshort): Likewise. * resolv/res_debug.c (p_time): Likewise. (precsize_ntoa): Likewise. (precsize_aton): Likewise. (latlon2ul): Likewise. (loc_aton): Likewise. (loc_ntoa): Likewise. * resolv/res_hconf.c (struct netaddr): Likewise. (_res_hconf_reorder_addrs): Likewise. * sunrpc/clnt_tcp.c (clnttcp_call): Likewise. (clnttcp_control): Likewise. * sunrpc/clnt_udp.c (clntudp_call): Likewise. (clntudp_control): Likewise. * sunrpc/clnt_unix.c (clntunix_call): Likewise. (clntunix_control): Likewise. * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise. * sunrpc/rpc/auth.h (union des_block): Likewise. * sunrpc/tst-udp-nonblocking.c (do_test): Likewise. * sunrpc/xdr_rec.c (struct rec_strm): Likewise. (xdrrec_create): Likewise. (xdrrec_endofrecord): Likewise. (flush_out): Likewise. * sunrpc/xdr_stdio.c (xdrstdio_getlong): Likewise. (xdrstdio_putlong): Likewise. * sysdeps/unix/sysv/linux/errqueue.h (struct sock_extended_err): Likewise.
2017-07-03resolv: Mirror the entire resolver configuration in struct resolv_confFlorian Weimer
This commit adds the remaining unchanging members (which are loaded from /etc/resolv.conf) to struct resolv_conf. The extended name server list is currently not used by the stub resolver. The switch depends on a cleanup: The _u._ext.nssocks array stores just a single socket, and needs to be replaced with a single socket value. (The compatibility gethostname implementation does not use the extended addres sort list, either. Updating the compat code is not worthwhile.)
2017-07-03resolv: Introduce struct resolv_context [BZ #21668]Florian Weimer
struct resolv_context objects provide a temporary resolver context which does not change during a name lookup operation. Only when the outmost context is created, the stub resolver configuration is verified to be current (at present, only against previous res_init calls). Subsequent attempts to obtain the context will reuse the result of the initial verification operation. struct resolv_context can also be extended in the future to store data which needs to be deallocated during thread cancellation.
2017-06-19resolv: Report allocation errors in __res_vinitFlorian Weimer
2017-04-19nss_dns: Correct parentheses for the __glibc_unlikely argumentFlorian Weimer
This fixes commit bee05c9d58a34ec5886faf3b56ecaa56355d94bf.
2017-04-19resolv: Replace __builtin_expect with __glibc_unlikely/__glibc_likelyFlorian Weimer
2017-04-04nss_dns: Replace local declarations with declarations from a header fileFlorian Weimer
2017-04-04nss_dns: Remove superfluous dn_expand call from network handlingFlorian Weimer
2017-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
2016-12-31CVE-2015-5180: resolv: Fix crash with internal QTYPE [BZ #18784]Florian Weimer
Also rename T_UNSPEC because an upcoming public header file update will use that name.
2016-12-31resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582]Florian Weimer
2016-10-07resolv: Remove RES_USEBSTRING and its implementation [BZ #20629]Florian Weimer
In ns_name_ntop, the NS_CMPRSFLGS check is no longer needed because labellen (called earlier) already rejects everything which is not a plain label (compression references and extended label types).
2016-10-07resolv: Remove RES_NOIP6DOTINT and its implementationFlorian Weimer
2016-04-28resolv: Remove SUNSECURITY preprocessor conditionalsFlorian Weimer
The macro is never defined.
2016-04-28resolv: Remove RESOLVSORT preprocess conditionalsFlorian Weimer
2016-04-27nss_dns: Skip over non-PTR records in the netent code [BZ #19868]Florian Weimer
This requires additional checks for the RDATA length and the availability of record metadata.
2016-04-27nss_dns: Remove custom offsetof macro definitionFlorian Weimer
2016-04-27nss_dns: Check address length before creating addrinfo result [BZ #19831]Florian Weimer
Previously, we allocated room in the result space before the check, leaving uninitialized data there in case the check failed. This also consolidates the behavior between single (A or AAAA) and dual (A and AAAA in parallel) queries. Single queries checked the record length against the QTYPE, not the RRTYPE.
2016-04-27resolv, nss_dns: Remove remaining syslog logging [BZ #19862]Florian Weimer
The fix for bug 14841 only removed part of the logging.
2016-04-27nss_dns: Validate RDATA length against packet length [BZ #19830]Florian Weimer
In _nss_dns_getcanonname_r, a check for the availability of RR metadata was missing as well.
2016-04-11nss_dns: Fix assertion failure in _nss_dns_getcanonname_r [BZ #19865]Florian Weimer
2016-03-29CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879]Florian Weimer
The defensive copy is not needed because the name may not alias the output buffer.
2016-02-16CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).Carlos O'Donell
* A stack-based buffer overflow was found in libresolv when invoked from libnss_dns, allowing specially crafted DNS responses to seize control of execution flow in the DNS client. The buffer overflow occurs in the functions send_dg (send datagram) and send_vc (send TCP) for the NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC family. The use of AF_UNSPEC triggers the low-level resolver code to send out two parallel queries for A and AAAA. A mismanagement of the buffers used for those queries could result in the response of a query writing beyond the alloca allocated buffer created by _nss_dns_gethostbyname4_r. Buffer management is simplified to remove the overflow. Thanks to the Google Security Team and Red Hat for reporting the security impact of this issue, and Robert Holiday of Ciena for reporting the related bug 18665. (CVE-2015-7547) See also: https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html https://sourceware.org/ml/libc-alpha/2016-02/msg00418.html
2016-01-04Update copyright dates with scripts/update-copyrights.Joseph Myers
2015-06-22Record TTL also for DNS PTR queries (bug 18513)Andreas Schwab
This allows nscd to manage proper TTL for GETHOSTBYADDR[v6] requests.
2015-04-21CVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]Arjun Shankar
2015-02-24Skip logging for DNSSEC responses [BZ 14841]Siddhesh Poyarekar
DNSSEC defines a number of response types that one me expect when the DO bit is set. We don't process any of them, but since we do allow setting the DO bit, skip them without logging an error since it is only a nuisance. Tested on x86_64. [BZ #14841] * resolv/gethnamaddr.c (getanswer): Skip logging if RES_USE_DNSSEC is set. * resolv/nss_dns/dns-host.c (getanswer_r): Likewise.
2015-01-02Update copyright dates with scripts/update-copyrights.Joseph Myers
2014-12-16Avoid infinite loop in nss_dns getnetbyname [BZ #17630]Florian Weimer
2014-07-01Remove MULTI_PTRS_ARE_ALIASES in dns-hosts.cSiddhesh Poyarekar
The code in gethnamaddr.c for gethostbyaddr used and set this macro to allow multiple PTR records to be added as aliases. This was useful for gethostbyaddr since it returns a hostent structure, which can return aliases. The gethnamaddr.c source however is unused in glibc since pretty much forever. Instead, the DNS lookup bits for gethostbyaddr (as well as getnameinfo) are implemented in dns-hosts.c and in that implementation all but one (the first one) of the multiple PTR records are ignored. Since gethnamaddr.c is essentially dead code, ignore that implementation and replace the MULTI_PTRS_ARE_ALIASES bit with a comment mentioning that bind adds PTR records as aliases while we don't.
2014-02-19Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answerAndreas Schwab
Instead of trying to guess whether the second buffer needs to be freed set a flag at the place it is allocated
2014-02-16Deduplicate resolv/nss_dns/dns-host.cOndřej Bílka
In resolv/nss_dns/dns-host.c one of code path duplicated code after that. We merge these paths.
2014-02-13Fix memory leak in _nss_dns_gethostbyname4_r with big DNS answerAndreas Schwab
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-06-07Avoid use of "register" as optimization hint.Joseph Myers
2013-05-16Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2013-01-01Add script to update copyright notices and reformat some to facilitate its use.Joseph Myers
2012-11-19Return EAI_SYSTEM if we're out of file descriptorsSiddhesh Poyarekar
Resolves BZ #14719.
2012-07-12Avoid duplicate DNS requests if answer is longer than a implementationJeroen van Bemmel
limit [BZ #14307] * sysdeps/posix/getaddrinfo.c (gaih_inet): Increase the size of the temporary buffer used to invoke __gethostbyname2_r, __gethostbyaddr_r and gethostbyname4_r to make room for struct host_data / struct gaih_addrtuple. * resolv/nss_dns/dns-host.c (global scope): Move definition of implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS to header file nss/nsswitch.h. * nss/nsswitch.h (global scope): Add definition of implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS (moved from resolv/nss_dns/dns-host.c).
2012-03-31Merge copyright years in resolv/nss_dns/dns-host.cSiddhesh Poyarekar
2012-03-30Consider TTL of CNAME record and return minimum TTL in the chainSiddhesh Poyarekar
[BZ #13928] A DNS request consists of multiple resources combined into a single hostent, including multiple CNAME records that may have been assigned different TTL values. In such a case, nscd should take the least TTL among all of the resources as the timeout for the hostent before it is reloaded in its cache so that the hostent remains stale in the database for the least amount of time.
2012-03-30 * resolv/nss_dns/dns-host.c: Update copyright year.Jeff Law
2012-03-28 [BZ #13760]Jeff Law
* resolv/nss_dns/dns-host.c (gaih_getanswer): Look for errno in the right place. Discard and retry query if response is larger than input buffer size.
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert
2011-06-10Quash some new warnings from GCC 4.6.Roland McGrath