about summary refs log tree commit diff
path: root/resolv/res_query.c
Commit message (Collapse)AuthorAgeFilesLines
* resolv: Lift domain search list limits [BZ #19569] [BZ #21475]Florian Weimer2017-07-031-5/+6
| | | | | | | This change uses the extended resolver state in struct resolv_conf to store the search list. If applications have not patched the _res object directly, this extended search list will be used by the stub resolver during name resolution.
* resolv: Introduce struct resolv_context [BZ #21668]Florian Weimer2017-07-031-126/+172
| | | | | | | | | | | | 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.
* resolv: Remove DEBUG from resolv/res_query.cFlorian Weimer2017-06-301-36/+0
|
* resolv: Move res_query, res_search res_querydomain, hostaliasFlorian Weimer2017-06-301-1/+56
| | | | From res_data.c to query.c
* resolv: Replace __builtin_expect with __glibc_unlikely/__glibc_likelyFlorian Weimer2017-04-191-1/+1
|
* resolv: Remove EDNS fallback [BZ #21369]Florian Weimer2017-04-131-15/+1
| | | | | | EDNS is disabled by default (so there is interoperability issue), and the fallback code is problematic because it prevents an application from obtaining DNSSEC data after a FORMERR response.
* resolv: Reduce EDNS payload size to 1200 bytes [BZ #21361]Florian Weimer2017-04-131-4/+19
| | | | This hardens the stub resolver against fragmentation-based attacks.
* resolv: Remove internal and unused definitions from <resolv.h>Florian Weimer2017-04-131-0/+1
| | | | | | | The RES_F_* constants are only used with the private _res._flags member. RES_EXHAUSTIVE is unused. The removed function declarations refer to functions not actually exported by glibc, so they are unusable by applications.
* CVE-2015-5180: resolv: Fix crash with internal QTYPE [BZ #18784]Florian Weimer2016-12-311-3/+3
| | | | | Also rename T_UNSPEC because an upcoming public header file update will use that name.
* resolv: Remove SCCS and RCS keywordsFlorian Weimer2016-04-281-5/+0
|
* CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).Carlos O'Donell2016-02-161-0/+3
| | | | | | | | | | | | | | | | | | | | * 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
* BZ#16469: resolv: skip leading dot in domain to searchAlexandre Oliva2014-11-211-3/+14
| | | | | | | | | | | | | This should only happen if the domain to search is the root, represented as "." rather than by an empty string. Skipping it here prevents libc_res_nquerydomain from duplicating the trailing dot, which would cause the domain name compression to fail. for ChangeLog [BZ #16469] * resolv/res_query.c (__libc_res_nsearch): Skip leading dot in search domain names.
* BZ#16469: don't drop trailing dot in res_nquerydomain(..., name, NULL, ...)Alexandre Oliva2014-11-211-11/+2
| | | | | | | | | | | | | | | | If we drop it here, we will fail to detect a duplicate trailing dot later on. Retaining, OTOH, has no ill effects whatsoever, and it even saves us the trouble of copying the domain name minus the trailing dot, like we used to do. for ChangeLog [BZ #16469] * NEWS: Update. * resolv/res_query.c (__libc_res_nquerydomain): Retain trailing dot. * posix/tst-getaddrinfo5.c: New. * posix/Makefile (tests): Add it.
* Check value at resplen2 if it is not NULLSiddhesh Poyarekar2014-07-081-4/+5
| | | | | | | There was a typo in the previous patch due to which resplen2 was checked for non-zero instead of the value at resplen2. Fix that and improve the condition by checking resplen2 for non-NULL (instead of answerp2) and also adding the check in a third place.
* Do not fail if one of the two responses to AF_UNSPEC fails (BZ #14308)Siddhesh Poyarekar2014-04-301-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Fixes BZ #14308, #12994, #13651] AF_UNSPEC results in sending two queries in parallel, one for the A record and the other for the AAAA record. If one of these is a referral, then the query fails, which is wrong. It should return at least the one successful response. The fix has two parts. The first part makes the referral fall back to the SERVFAIL path, which results in using the successful response. There is a bug in that path however, due to which the second part is necessary. The bug here is that if the first response is a failure and the second succeeds, __libc_res_nsearch does not detect that and assumes a failure. The case where the first response is a success and the second fails, works correctly. This condition is produced by buggy routers, so here's a crude interposable library that can simulate such a condition. The library overrides the recvfrom syscall and modifies the header of the packet received to reproduce this scenario. It has two key variables: mod_packet and first_error. The mod_packet variable when set to 0, results in odd packets being modified to be a referral. When set to 1, even packets are modified to be a referral. The first_error causes the first response to be a failure so that a domain-appended search is performed to test the second part of the __libc_nsearch fix. The driver for this fix is a simple getaddrinfo program that does an AF_UNSPEC query. I have omitted this since it should be easy to implement. I have tested this on x86_64. The interceptor library source: /* Override recvfrom and modify the header of the first DNS response to make it a referral and reproduce bz #845218. We have to resort to this ugly hack because we cannot make bind return the buggy response of a referral for the AAAA record and an authoritative response for the A record. */ #define _GNU_SOURCE #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdbool.h> #include <endian.h> #include <dlfcn.h> #include <stdlib.h> /* Lifted from resolv/arpa/nameser_compat.h. */ typedef struct { unsigned id :16; /*%< query identification number */ #if BYTE_ORDER == BIG_ENDIAN /* fields in third byte */ unsigned qr: 1; /*%< response flag */ unsigned opcode: 4; /*%< purpose of message */ unsigned aa: 1; /*%< authoritive answer */ unsigned tc: 1; /*%< truncated message */ unsigned rd: 1; /*%< recursion desired */ /* fields * in * fourth * byte * */ unsigned ra: 1; /*%< recursion available */ unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */ unsigned ad: 1; /*%< authentic data from named */ unsigned cd: 1; /*%< checking disabled by resolver */ unsigned rcode :4; /*%< response code */ #endif #if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN /* fields * in * third * byte * */ unsigned rd :1; /*%< recursion desired */ unsigned tc :1; /*%< truncated message */ unsigned aa :1; /*%< authoritive answer */ unsigned opcode :4; /*%< purpose of message */ unsigned qr :1; /*%< response flag */ /* fields * in * fourth * byte * */ unsigned rcode :4; /*%< response code */ unsigned cd: 1; /*%< checking disabled by resolver */ unsigned ad: 1; /*%< authentic data from named */ unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */ unsigned ra :1; /*%< recursion available */ #endif /* remaining * bytes * */ unsigned qdcount :16; /*%< number of question entries */ unsigned ancount :16; /*%< number of answer entries */ unsigned nscount :16; /*%< number of authority entries */ unsigned arcount :16; /*%< number of resource entries */ } HEADER; static int done = 0; /* Packets to modify. 0 for the odd packets and 1 for even packets. */ static const int mod_packet = 0; /* Set to true if the first request should result in an error, resulting in a search query. */ static bool first_error = true; static ssize_t (*real_recvfrom) (int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen); void __attribute__ ((constructor)) init (void) { real_recvfrom = dlsym (RTLD_NEXT, "recvfrom"); if (real_recvfrom == NULL) { printf ("Failed to get reference to recvfrom: %s\n", dlerror ()); printf ("Cannot simulate test\n"); abort (); } } /* Modify the second packet that we receive to set the header in a manner as to reproduce BZ #845218. */ static void mod_buf (HEADER *h, int port) { if (done % 2 == mod_packet || (first_error && done == 1)) { printf ("(Modifying header)"); if (first_error && done == 1) h->rcode = 3; else h->rcode = 0; /* NOERROR == 0. */ h->ancount = 0; h->aa = 0; h->ra = 0; h->arcount = 0; } done++; } ssize_t recvfrom (int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen) { ssize_t ret = real_recvfrom (sockfd, buf, len, flags, src_addr, addrlen); int port = htons (((struct sockaddr_in *) src_addr)->sin_port); struct in_addr addr = ((struct sockaddr_in *) src_addr)->sin_addr; const char *host = inet_ntoa (addr); printf ("\n*** From %s:%d: ", host, port); mod_buf (buf, port); printf ("returned %zd\n", ret); return ret; }
* Fix typo in comment in res_query.cJoseph Anthony Pasquale Holsten2014-04-111-1/+1
|
* Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answerAndreas Schwab2014-02-191-19/+26
| | | | | Instead of trying to guess whether the second buffer needs to be freed set a flag at the place it is allocated
* Use glibc_likely instead __builtin_expect.Ondřej Bílka2014-02-101-1/+1
|
* Fix assertion failures in resolver (BZ #13013).Aurelien Jarno2012-11-301-15/+15
| | | | | | | [BZ #13013] * resolv/res_query.c(__libc_res_nquery): Assign hp and hp2 depending n and resplen2 to catch cases where answer equals answerp2.
* [network] Avoid out ouf bounds read in __libc_res_nquerydomainJeff Law2012-02-291-3/+7
| | | | | | | 2012-02-28 Jeff Law <law@redhat.com> * resolv/res_query.c (__libc_res_nquerydomain): Avoid out of bounds read.
* Clean up internal fopen usesUlrich Drepper2011-11-151-1/+1
| | | | No need to ever not use c and e.
* Use size_t for strlen resultsAndreas Schwab2011-07-201-1/+1
|
* Backport BIND code to query name as TLD.Ulrich Drepper2011-05-071-6/+8
|
* Define and implement RES_USE_DNSSEC option in resolver.Adam Tkac2009-07-271-4/+4
|
* [BZ #10128]Ulrich Drepper2009-05-091-0/+7
| | | | | | | 2009-05-05 Aurelien Jarno <aurelien@aurel32.net> [BZ #10128] * resolv/res_query.c (__libc_res_nquery): If one query returns NOTIMP or FORMERR and the other NOERROR, don't raise an error.
* Fix tests for existence of second reply.Ulrich Drepper2008-10-241-3/+3
|
* * resolv/res_query.c (__libc_res_nquery): Add a few casts.Ulrich Drepper2008-10-241-4/+4
|
* * resolv/res_send.c (__libc_res_nsend): Take additional parameter. cvs/fedora-glibc-20080728T2320Ulrich Drepper2008-07-281-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use it instead of locally defined resplen2 variable. (res_nsend): Adjust for __libc_res_nsend interface change. (send_vc): Initialize *resplen2 if necessary. Read length of package into an appropriately aligned variable. Store converted length in new variable and use it appropriately. Add branch prediction help. * resolv/res_query.c (__libc_res_nquery): Take additional parameter and pass it on to __libc_res_nsend. Adjust all callers. (__libc_res_nsearch): Likewise. (__libc_res_nqeurydomain): Likewise. * resolv/nss_dns/dns-host.c: Adjust for __libc_res_nsearch interface change. (_nss_dns_gethostbyname4): Don't unconditionally allocate tmp array. Define resplen2 variable and pass it to __libc_res_nsearch and then to gaih_getanswer. (getanswer_r): In case of incorrect DNS data don't overread buffer. Add branch prediction. (gaih_getanswer_slice): Likewise. Check for invalid data types. (gaih_getanswer): Don't decode second slice if first one failed due to a too small buffer. Don't let not found status of second decoder shadow results of the first. * resolv/gethnamaddr.c (gethostbyname2): Adjust for __libc_res_nsearch and __libc_res_nquery interface changes (gethostbyaddr): Adjust for __libc_res_nquery interface change. * include/resolv.h: Adjust prototypes for __libc_res_nquery, __libc_res_nsearch, and __libc_res_nsend. * resolv/nss_dns/dns-canon.c: Adjust for __libc_res_nquery interface change. * resolv/nss_dns/dns-network.c: Adjust for __libc_res_nquery and __libc_res_nsearch interface changes.
* * resolv/res_query.c (__libc_res_nquery): Issue debug message onlyUlrich Drepper2008-07-091-2/+4
| | | | if DEBUG is defined.
* * resolv/res_query.c (__libc_res_nquery): Align buffer for T_AAAAUlrich Drepper2008-07-091-4/+20
| | | | query. Adjust buffer size computation for padding.
* * resolv/res_query.c (__libc_res_nquery): In case one of twoUlrich Drepper2008-05-191-0/+15
| | | | | | | | answer was too short don't try to read that answer's header. * resolv/res_send.c (send_dg): In case of timeout and there are two queries and one has been answered, return value indicating success.
* * include/resolv.h: Adjust __libc_res_nquery and __libc_res_nsendUlrich Drepper2008-05-101-35/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prototypes. * include/arpa/nameser_compat.h: Define T_UNSPEC. * nis/Versions (libnss_nis): Export _nss_nis_gethostbyname4_r. (libnss_nisplus): Export _nss_nisplus_gethostbyname4_r. * nis/nss_nis/nis-hosts.c (LINE_PARSER): Change to also handle af==AF_UNSPEC. (_nss_nis_gethostbyname4_r): New function. * nis/nss_nisplus/nisplus-hosts.c (_nss_nisplus_parse_hostent): Change to also handle af==AF_UNSPEC. (get_tablename): New function. Use it to avoid duplication. (_nss_nisplus_gethostbyname4_r): New function. * nscd/aicache.c (addhstaiX): Use gethostbyname4_r function is available. * nss/Versions (libnss_files): Export _nss_files_gethostbyname4_r. * nss/nss.h: Define struct gaih_addrtuple. * nss/nss_files/files-hosts.c (LINE_PARSER): Change to also handle af==AF_UNSPEC. (_nss_files_gethostbyname4_r): New function. * resolv/Versions (libnss_dns): Export _nss_dns_gethostbyname4_r. * resolv/gethnmaddr.c: Adjust __libc_res_nsearch and __libc_res_nquery calls. * resolv/res_query.c (__libc_res_nquery): Take two additional parameters for second answer buffer. Handle type=T_UNSPEC to mean look up IPv4 and IPv6. Change all callers. * resolv/res_send.c (__libc_res_nsend): Take five aditional parameters for an additional query and answer buffer. Pass to send_vc and send_dg. (send_vc): Send possibly two requests and receive two answers. (send_dg): Likewise. * resolv/nss_dns/dns-host.c: Adjust calls to __libc_res_nsearch and __libc_res_nquery. (_nss_dns_gethostbyname4_r): New function. (gaih_getanswer_slice): Likewise. (gaih_getanswer): Likewise. * resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Adjust __libc_res_nquery call. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. (_nss_dns_getnetbyname_r): Adjust __libc_res_nsearch call. * sysdeps/posix/getaddrinfo.c: Use gethostbyname4_r function is available.
* * resolv/res_init.c (res_setoptions): Recognize edns0 option.Ulrich Drepper2007-02-091-7/+22
| | | | | | | | | | * resolv/res_mkquery.c: Define __res_nopt. * resolv/res_query.c (__libc_res_nquery): If RES_USE_EDNS0 is set try adding EDNS0 record. * resolv/res_send.c (send_dg): If request failed with FORMERR and EDNS0 record was send make sure we don't try it again. * resolv/resolv.h: Define RES_F_EDNS0ERR and RES_USE_EDNS0. * include/resolv.h: Declare __res_nopt.
* [BZ #2499]Ulrich Drepper2006-05-061-0/+6
| | | | | | | | 2006-05-06 Ulrich Drepper <drepper@redhat.com> [BZ #2499] * resolv/res_query.c (__libc_res_nquery): If answerp != NULL, __libc_res_nsend might reallocate the buffer for the answer. In this case we have to reload the HP pointer.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-6/+0
|
* 2.5-18.1Jakub Jelinek2007-07-121-0/+6
|
* Update.Ulrich Drepper2004-10-181-0/+6
| | | | | | | | | | | | | | | | | | 2004-10-17 Ulrich Drepper <drepper@redhat.com> * include/libc-symbols.h: Define libresolv_hidden_proto and friends. * include/resolv.h: Add libresolv_hidden_proto for symbols defined, used, and exported in libresolv. * resolv/base64.c: Add libresolv_hidden_def. * resolv/gethnamaddr.c: Likewise. * resolv/ns_name.c: Likewise. * resolv/ns_netint.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_data.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_send.c: Likewise.
* Update.Ulrich Drepper2004-08-121-2/+5
| | | | | | | | | | | | | | | | | | 2004-08-12 Jakub Jelinek <jakub@redhat.com> * resolv/res_query.c (__libc_res_nsearch): Protect the debugging printf with #ifdef DEBUG and RES_DEBUG check. * sysdeps/unix/sysv/linux/bits/shm.h: Move __END_DECLS after __USE_MISC #endif. * sysdeps/generic/bits/shm.h: Add __BEGIN_DECLS for __getpagesize declaration. * sysdeps/gnu/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/bits/shm.h: Likewise.
* [BZ #116]Ulrich Drepper2004-08-091-6/+1
| | | | | | | | | | | Update. * elf/dl-load.c (_dl_map_object): If __RTLD_CALLMAP flag is set, reset loader before the actual loading. * elf/dl-open.c (dl_open_worker): If file name contains no path element determine map of caller. Pass caller map in this case to _dl_map_object. Set __RTLD_CALLMAP in mode. * include/dlfcn.h (__RTLD_CALLMAP): Define. [BZ #116] Patch by Greg Wolodkin <greg@mathworks.com>.
* [BZ #95]Ulrich Drepper2004-08-091-3/+11
| | | | | | Update. * resolv/res_query.c (__libc_res_nsearch): Correctly test whether name contains any dots. [BZ #95]
* Update.Ulrich Drepper2002-10-171-31/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-10-15 Jakub Jelinek <jakub@redhat.com> * include/resolv.h (__libc_res_nquery, __libc_res_nsearch, __libc_res_nsend): New prototypes. * resolv/res_query.c (QUERYSIZE): Define. (__libc_res_nquery): Renamed from res_nquery. Added answerp argument. Allocate only QUERYSIZE bytes first, if res_nmkquery fails use MAXPACKET buffer. Call __libc_res_nsend instead of res_nsend, pass answerp. (res_nquery): Changed into wrapper around __libc_res_nquery. (__libc_res_nsearch): Renamed from res_nsearch. Added answerp argument. Call __libc_res_nquerydomain and __libc_res_nquery instead of the non-__libc_ variants, pass them answerp. (res_nsearch): Changed into wrapper around __libc_res_nsearch. (__libc_res_nquerydomain): Renamed from res_nquerydomain. Added answerp argument. Call __libc_res_nquery instead of res_nquery, pass answerp. (res_nquerydomain): Changed into wrapper around __libc_res_nquerydomain. * resolv/res_send.c: Include sys/ioctl.h. (MAXPACKET): Define. (send_vc): Change arguments. Reallocate answer buffer if it is too small. (send_dg): Likewise. (__libc_res_nsend): Renamed from res_nsend. Added ansp argument. Reallocate answer buffer if it is too small and hooks are in use. Adjust calls to send_vc and send_dg. (res_nsend): Changed into wrapper around __libc_res_nsend. * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Allocate just 1K answer buffer on the stack, use __libc_res_nsearch instead of res_nsearch. (_nss_dns_gethostbyaddr_r): Similarly with __libc_res_nquery. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. (_nss_dns_getnetbyname_r): Similarly with __libc_res_nsearch. * resolv/gethnamaddr.c (gethostbyname2): Likewise. (gethostbyaddr): Similarly with __libc_res_nquery. * resolv/Versions (libresolv): Export __libc_res_nquery and __libc_res_nsearch at GLIBC_PRIVATE.
* Update.Ulrich Drepper2002-10-091-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-10-09 Ulrich Drepper <drepper@redhat.com> * Versions.def (libc): Add GLIBC_2.3.1. (libpthread): Add GLIBC_2.3.1. * include/signal.h: Add libc_hidden_proto for __sigwait, __sigwaitinfo, and __sigtimedwait. * signal/Versions: Add __sigtimedwait, __sigwait, and __sigwaitinfo. * sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Add libc_hidden_def. * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise. * include/sys/msg.h: Declare __libc_msgrcv and __libc_msgsnd. * sysdeps/unix/sysv/linux/msgrcv.c (__msgrcv): Rename to __libc_msgrcv and make old name an alias. * sysdeps/unix/sysv/linux/msgsnd.c (__msgsnd): Rename to __libc_msgsnd and make old name an alias. * sysvipc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_msgrcv and __libc_msgsnd. * include/sys/uio.h: Declare __libc_readv and __libc_writev. * misc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_readv and __libc_writev. * sysdeps/generic/readv.c (__readv): Rename to __libc_readv and make old name an alias. * sysdeps/posix/readv.c: Likewise * sysdeps/unix/sysv/aix/readv.c: Likewise. * sysdeps/unix/sysv/linux/readv.c: Likewise. * sysdeps/generic/writev.c (__writev): Rename to __libc_writev and make old name an alias. * sysdeps/posix/writev.c: Likewise * sysdeps/unix/sysv/aix/writev.c: Likewise. * sysdeps/unix/sysv/linux/writev.c: Likewise. * include/sys/wait.h: Declare __waitid. * posix/Versions (libc) [GLIBC_PRIVATE]: Add __waitid. * sysdeps/generic/waitid.c (waitid): Rename to __waitid and make old name an alias. * sysdeps/posix/waitid.c: Likewise. * sysdeps/unix/sysv/aix/waitid.c: Likewise. * sysdeps/unix/sysv/linux/syscalls.list: Add creat syscall. 2002-10-07 Jakub Jelinek <jakub@redhat.com> * include/alloca.h (__libc_use_alloca, __libc_alloca_cutoff): New prototypes. (__MAX_ALLOCA_CUTOFF): Define. Include allocalim.h. * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r, _nss_dns_gethostbyaddr_r): Use alloca or malloc to allocate host_buffer depending on __libc_use_alloca. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r, _nss_dns_getnetbyaddr_r): Use alloca or malloc to allocate net_buffer depending on __libc_use_alloca. * resolv/res_query.c (res_nquery): Use alloca or malloc to allocate buf depending on __libc_use_alloca. * resolv/gethnamaddr.c (gethostbyname2, gethostbyaddr): Likewise. * stdio-common/vfprintf.c (vfprintf): Use __libc_use_alloca instead of hardcoded constants. Pass proper size argument to alloca and compute end for wide char version. * stdio-common/printf_fp.c (__printf_fp): Use __libc_use_alloca instead of hardcoded constants. * string/strcoll.c (strcoll): Likewise. * string/strxfrm.c (strxfrm): Likewise. * sysdeps/posix/readv.c (__readv): Likewise. * sysdeps/posix/writev.c (__writev): Likewise. * sysdeps/generic/allocalim.h: New file.
* (MAXPACKET): Increase minimum value from 1024 to 65536, to avoid buffer overrun.Ulrich Drepper2002-08-241-2/+2
|
* Update.Ulrich Drepper2001-01-081-6/+6
| | | | | * resolv/res_query.c: Use simply getenv() for HOSTALIASES. * sysdeps/generic/unsecvars.h (UNSECURE_ENVVARS): Add HOSTALIASES.
* Update.Ulrich Drepper2000-07-191-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-07-18 Mark Kettenis <kettenis@gnu.org> Update resolver code to BIND 8.2.3-T5B. * resolv/Versions [GLIBC_2.2] (libc): Add __res_init and __res_nclose. [GLIBC_2.2] (libresolv): Add __dn_expand, __ns_samename, __res_mkquery, __res_nsend, __res_query, __res_querydomain and __res_search. * resolv/Banner: BIND-8.2.3-T5B. * resolv/base64.c: Update from BIND 8.2.3-T5B. * resolv/herror.c: Likewise. * resolv/inet_addr.c: Likewise. * resolv/inet_net_ntop.c: Likewise. * resolv/inet_net_pton.c: Likewise. * resolv/inet_neta.c: Likewise. * resolv/inet_ntop.c: Likewise. * resolv/nsap_addr.c: Likewise. * resolv/inet_pton.c: Likewise. Reject a few more more invalid IPv6 addresses (ISC bug #520). * resolv/ns_name.c: Avoid emitting RCS ID in object file. * resolv/ns_parse.c: Likewise. * resolv/ns_netint.c: Likewise. * resolv/ns_samedomain.c: Likewise. * resolv/ns_ttl.c: Likewise. * resolv/ns_print.c: Update from BIND 8.2.3-T5B. Avoid emitting RCS ID in object file. * resolv/res_debug.c: Update from BIND 8.2.3-T5B. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_init.c: Likewise. (res_setoptions): Mark internal. * resolv/res_send.c: Likewise. [_LIBC]: Fully reinstate the code that avoids the FD_SETSIZE limit by using poll instead. * resolv/res_comp.c: Likewise. [SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make dn_expand a weak alias for __dn_expand. * resolv/res_data.c: Likewise. (res_close) [_LIBC]: Don't call res_nclose if RES_INIT isn't set in _res.options. Avoids a potential security risk by avoiding a close (0). [SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make res_mkquery, res_query, res_querydomain adn res_search weak aliases for __res_mkquery, __res_query, __res_querydomain and __res_search. * resolv/res_libc.c: (_res): Don't initialize. Fix res_close instead to avoid close(0). (res_init): Always use the static resolver context. [SHLIB_COMPAT (libc, GLIBC_2.0, GLIBC_2_2)]: Make res_init a weak alias for __res_init. * resolv/resolv.h: Update from BIND 8.2.3-T5B. Move definition of RES_SET_H_ERRNO and accompanying comment to... * include/resolv.h: ... here. * resolv/arpa/namser.h: Update from BIND 8.2.3-T5B. * resolv/arpa/nameser_compat.h: Likewise.
* Update.Ulrich Drepper1999-12-041-130/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1999-12-03 Andreas Jaeger <aj@suse.de> * nss/getXXbyYY.c: Include <resolv.h> (FUNCTION_NAME): Use res_ninit instead of res_init. * nss/getXXbyYY_r.c [NEED__RES]: Include <resolv.h> for _res declaration and prototypes. Remove extra _res declaration. (INTERNAL): Use thread aware res_ninit function. * inet/gethstbyad_r.c: Include <resolv.h>. * resolv/res_data.c: Update from Bind 8.2.2-P5. Moved res_init to res_libc.c. Disabled unneeded functions. * resolv/res_libc.c: New file. * Versions.def: Add version GLIBC_2.2 for libpthread. Add versions GLIBC_2.1 and GLIBC_2.2 for libresolv. * include/resolv.h: Add internal interfaces. * resolv/Makefile (routines): Add new files. (libresolv-routines): Likewise. (distribute): Likewise. * resolv/gethnamaddr.c: Use thread safe resolver functions. * resolv/nss_dns/dns-host.c: Likewise. * resolv/nss_dns/dns-network.c: Likewise. * resolv/arpa/nameser.h: Update from Bind 8.2.2-P5. * resolv/nsap_addr.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_init.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_send.c: Likewise. * resolv/resolv.h: Likewise. * resolv/Versions: Add __res_state and __res_ninit with version GLIBC_2.2 to libc. Add new interfaces with version GLIBC_2.2 to libresolv. * resolv/Banner: Update. * include/arpa/nameser_compat.h: New file. * resolv/ns_name.c: New file from Bind 8.2.2-P5. * resolv/ns_netint.c: Likewise. * resolv/ns_parse.c: Likewise. * resolv/ns_print.c: Likewise. * resolv/ns_samedomain.c: Likewise. * resolv/ns_ttl.c: Likewise. * resolv/arpa/nameser_compat.h: Likewise. * resolv/res_debug.h: Likewise. Some patches are based on work done by Adam D. Bradley <artdodge@cs.bu.edu>. * sysdeps/unix/sysv/linux/configure.in: Remove check for ldconfig, set always use_ldconfig instead.
* Update.Ulrich Drepper1999-06-081-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gmon/gmon.c: Remove advertising clause of copyright. * gmon/mcount.c: Likewise. * gmon/sys/gmon.h: Likewise. * inet/arpa/ftp.h: Likewise. * inet/arpa/telnet.h: Likewise. * inet/arpa/tftp.h: Likewise. * inet/inet_lnaof.c: Likewise. * inet/inet_mkadr.c: Likewise. * inet/inet_net.c: Likewise. * inet/inet_netof.c: Likewise. * inet/protocols/routed.h: Likewise. * inet/protocols/rwhod.h: Likewise. * inet/protocols/talkd.h: Likewise. * inet/protocols/timed.h: Likewise. * inet/rcmd.c: Likewise. * inet/rexec.c: Likewise. * inet/ruserpass.c: Likewise. * io/fts.c: Likewise. * io/fts.h: Likewise. * login/login_tty.c: Likewise. * misc/fstab.h: Likewise. * misc/getttyent.c: Likewise. * misc/getusershell.c: Likewise. * misc/sys/queue.h: Likewise. * misc/sys/syslog.h: Likewise. * misc/syslog.c: Likewise. * misc/ttyent.h: Likewise. * misc/ttyslot.c: Likewise. * resolv/arpa/nameser.h: Likewise. * resolv/gethnamaddr.c: Likewise. * resolv/herror.c: Likewise. * resolv/inet_addr.c: Likewise. * resolv/mapv4v6addr.h: Likewise. * resolv/mapv4v6hostent.h: Likewise * resolv/nss_dns/dns-host.c: Likewise. * resolv/nss_dns/dns-network.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_data.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_init.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_send.c: Likewise. * resolv/resolv.h: Likewise. * sysdeps/generic/div.c: Likewise. * sysdeps/generic/netinet/ip.h: Likewise. * sysdeps/generic/netinet/tcp.h: Likewise. * sysdeps/generic/paths.h: Likewise. * sysdeps/generic/prof-freq.c: Likewise. * sysdeps/generic/sys/ttydefaults.h: Likewise. * sysdeps/gnu/netinet/ip_icmp.h: Likewise. * sysdeps/gnu/netinet/tcp.h: Likewise. * sysdeps/ieee754/support.c: Likewise. * sysdeps/mach/hurd/sys/param.h: Likewise. * sysdeps/unix/bsd/bsd4.4/bits/errno.h: Likewise. * sysdeps/unix/bsd/bsd4.4/bits/ioctls.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/sys/ttydefaults.h: Likewise. * sysdeps/unix/bsd/sys/reboot.h: Likewise. * sysdeps/unix/sysv/linux/netinet/if_ether.h: Likewise. * sysdeps/unix/sysv/linux/netinet/igmp.h: Likewise. * sysdeps/unix/sysv/linux/netinet/ip.h: Likewise. * sysdeps/unix/sysv/linux/paths.h: Likewise. * sysdeps/unix/sysv/linux/sys/quota.h: Likewise. * sysdeps/unix/sysv/linux/sys/ttydefaults.h: Likewise. * sysdeps/vax/DEFS.h: Likewise. * termios/sys/ttychars.h: Likewise. * misc/daemon.c: Likewise. Call fork.
* Update.Ulrich Drepper1997-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1997-05-24 03:51 Ulrich Drepper <drepper@cygnus.com> * stdlib/Makefile (routines): Add strtol_l, strtoul_l, strtoll_l, strtoull_l, strtof_l, strtod_l, and strtold_l. * stdlib/stdlib.h: Add prototypes for new functions. * stdlib/strtod.c: Change for compiling as strtoX_l. * stdlib/strtol.c: Likewise. * stdlib/strtof.c: Likewise. * stdlib/strtold.c: Likewise. * stdlib/strtod_l.c: New file. * stdlib/strtof_l.c: New file. * stdlib/strtold_l.c: New file. * stdlib/strtol_l.c: New file. * stdlib/strtoul_l.c: New file. * stdlib/strtoll_l.c: New file. * stdlib/strtoull_l.c: New file. * string/Makefile (routines): Add strcasecmp_l and strncase_l. * string/string.h: Add prototypes for new functions. * sysdeps/generic/strcasecmp.c: Change for compiling as strcasecmp_l. * sysdeps/generic/strncase.c: Change for compiling as strncasecmp_l. * sysdeps/generic/strcasecmp_l.c: New file. * sysdeps/generic/strncase_l.c: New file. * wcsmbs/Makefile (routines): Add wcstol_l, wcstoul_l, wcstoll_l, wcstoull_l, wcstod_l, wcstold_l, wcstof_l, wcscasecmp_l, and wcsncase_l. * wcsmbs/wchar.h: Add prototypes for new functions. * wcsmbs/wcscasecmp.c: Change for compiling as wcscasecmp_l. * wcsmbs/wcsncase.c: Change for compiling as wcsncasecmp_l. * wcsmbs/wcscasecmp_l.c: New file. * wcsmbs/wcsncase_l.c: New file. * wcsmbs/wcstof.c: Change for compiling as wcstof_l.c * wcsmbs/wcstold.c: Change for compiling as wcstold_l.c * wcsmcs/wcstod_l.c: New file. * wcsmcs/wcstof_l.c: New file. * wcsmcs/wcstold_l.c: New file. * wcsmcs/wcstol_l.c: New file. * wcsmcs/wcstoul_l.c: New file. * wcsmcs/wcstoll_l.c: New file. * wcsmcs/wcstoull_l.c: New file. * Makeconfig (binfmt-subdir): New variable. Set to `elf' if $(elf) is defined. More to come later when other binary formats are supported. * Makefile (subdirs): Remove elf. Add $(binfmt-subdir). Suggested by Philip Blundell. * stdlib/Makefile (headers): Add fmtmsg.h. (routines): Add fmtmsg. * stdlib/fmtmsg.c: New file. * stdlib/fmtmsg.h: New file. * manual/stdio.texi: Add description of fmtmsg and addseverity. * manual/examples/fmtmsgexpl.c: Example program for fmtmsg documentation. 1997-05-23 15:26 Philip Blundell <pjb27@cam.ac.uk> * resolv/res_query.c (res_querydomain): Avoid potential buffer overrun. Reported by Dan A. Dickey <ddickey@transition.com>. 1997-05-22 18:36 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * elf/dl-support.c (_dl_sysdep_open_zero_fill, _dl_sysdep_read_whole_file): Moved functions to ... * elf/dl-misc.c: This new file. * sysdeps/generic/dl-sysdepio.c: Delete file and move functions... * elf/dl-misc.c: ... here. * sysdeps/generic/dl-sysdep.c (_dl_sysdep_open_zero_fill, _dl_sysdep_read_whole_file): Delete functions; they now come from elf/dl-misc.c (dl-support.c had contained identical versions). * sysdeps/mach/hurd/dl-sysdepio.c: Delete file; move functions... * sysdeps/mach/hurd/dl-sysdep.c: ... here, but mark them weak so that the regular ones in dl-misc work once we've initialized. * elf/Makefile (dl-routines): Remove dl-sysdepio.c. Add dl-misc.c. 1997-05-22 21:55 Philip Blundell <pjb27@cam.ac.uk> * inet/Makefile (headers): Add netinet/inbits.h. * inet/netinet/in.h: New file. * sysdeps/generic/netinet/inbits.h: Likewise. * sysdeps/unix/sysv/linux/netinet/inbits.h: Likewise. * sysdeps/generic/netinet/ip6.h: Move to... * inet/netinet/ip6.h: ... here. * sysdeps/generic/netinet/icmp6.h: Move to... * inet/netinet/icmp6.h: ... here. * sysdeps/unix/sysv/linux/netinet/in.h: Remove. * sysdeps/generic/netinet/in.h: Remove. 1997-05-22 05:40 Richard Henderson <rth@tamu.edu> * sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): If we are not looking at the new thread-safe .plt, don't be lazy about relocs. (_dl_runtime_resolve): Fix up arithmetic for new .plt layout. (elf_alpha_fix_plt): Insert wmb as appropriate to ensure safety. * elf/dynamic-link.h (ELF_DYNAMIC_RELOCATE): Let elf_machine_runtime_setup() decide if we can actually be lazy. * elf/rtld.c (_dl_start): So don't call it. * elf/dl-reloc.c (_dl_relocate_object): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Return lazy. * sysdeps/m68k/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/mips/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/sparc/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/stub/dl-machine.h (elf_machine_runtime_setup): Update skeleton definition. 1997-05-22 18:45 Ulrich Drepper <drepper@cygnus.com> * sysdeps/i386/fpu/__math.h (logb): Remove second value placed on stack by fxtract. 1997-05-22 13:07 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sunrpc/rpcsvc/rusers.x: Provide and correct prototypes, add cast to (xdrproc_t) where necessary to prevent warnings. 1997-05-22 12:18 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Remove I/O functions. * sunrpc/rpcinfo.c (get_inet_address): Use INADDR_NONE and INADDR_ANY * sysdeps/libm-ieee754/s_cexp.c: Fix typo: string_alias -> * nss/XXX-lookup.c: Add missing explanation.
* update from main archive 960105 cvs/libc-970107 cvs/libc-970106Ulrich Drepper1997-01-061-1/+2
|
* update from main archive 961001Ulrich Drepper1996-10-021-14/+14
|