about summary refs log tree commit diff
path: root/resolv
Commit message (Collapse)AuthorAgeFilesLines
* Mark internal functions with attribute_hidden [BZ #18822]H.J. Lu2017-10-011-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark internal functions with attribute_hidden to allow direct access to internal functions within libc.so and libc.a without using GOT nor PLT. Size comparison of libc.so: On x86-64: text data bss dec hex Before: 1728577 20584 17088 1766249 1af369 After : 1728593 20584 17088 1766265 1af379 The only change is __gconv_release_shlib in iconv/gconv_dl.c is inlined since it is hidden, which increases the code size of gconv_dl.os by 18 bytes. On i686: text data bss dec hex Before: 1869039 11444 11112 1891595 1cdd0b After : 1868635 11444 11112 1891191 1cdb77 The code size is decreased by avoiding GOT/PLT for hidden functions. [BZ #18822] * iconv/gconv_int.h (__gconv_open): Add attribute_hidden. (__gconv_close): Likewise. (__gconv): Likewise. (__gconv_find_transform): Likewise. (__gconv_lookup_cache): Likewise. (__gconv_compare_alias_cache): Likewise. (__gconv_load_cache): Likewise. (__gconv_get_path): Likewise. (__gconv_close_transform): Likewise. (__gconv_release_cache): Likewise. (__gconv_find_shlib): Likewise. (__gconv_release_shlib): Likewise. (__gconv_get_builtin_trans): Likewise. (__gconv_compare_alias): Likewise. * include/dlfcn.h (_dlerror_run): Likewise. * include/stdio.h (__fortify_fail_abort): Likewise. * include/time.h (__tz_compute): Likewise. (__strptime_internal): Likewise. * intl/gettextP.h (_nl_find_domain): Likewise. (_nl_load_domain): Likewise. (_nl_find_msg): Likewise. * intl/plural-exp.h (FREE_EXPRESSION): Likewise. (EXTRACT_PLURAL_EXPRESSION): Likewise. * locale/coll-lookup.h (__collidx_table_lookup): Likewise. * resolv/gai_misc.h (__gai_enqueue_request): Likewise. (__gai_find_request): Likewise. (__gai_remove_request): Likewise. (__gai_notify): Likewise. (__gai_notify_only): Likewise. * sysdeps/generic/aio_misc.h (__aio_sigqueue): Likewise. * sysdeps/generic/ldsodefs.h (_dl_fini): Likewise. (_dl_non_dynamic_init): Likewise. (_dl_aux_init): Likewise. * sysdeps/i386/machine-gmon.h (mcount_internal): Likewise. * sysdeps/unix/sysv/linux/i386/olddirent.h (__old_getdents64): Likewise. * wcsmbs/wcsmbsload.h (__wcsmbs_load_conv): Likewise. (__wcsmbs_clone_conv): Likewise. (__wcsmbs_named_conv): Likewise.
* resolv/Makefile: Fix typo in commentFlorian Weimer2017-09-261-1/+1
|
* resolv/nss_dns/dns-host.c: Fix typo in commentFlorian Weimer2017-09-261-1/+2
| | | | And only the resolv/map*.h actually contain implementations.
* Remove non-add-on Banner files.Joseph Myers2017-09-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various subdirectories of glibc include Banner files to put some text in the output of executing libc.so.6, under "Available extensions". Some of those subdirectories (e.g. crypt) may originally have been add-ons (and so optional, so a particular glibc build might or might not have included them), but except for libidn they aren't now (or if only included in some builds, in the case of soft-fp, the inclusion depends on the architecture for which glibc is configured rather than having any glibc configuration for which it's an optional feature), and it doesn't seem useful for the libc.so.6 output to call out a few features like that. This patch removes the non-add-on Banner files, updating contrib.texi where they noted contributions not otherwise mentioned there. Tested for x86_64. * crypt/Banner: Remove file. * nptl/Banner: Likewise. * resolv/Banner: Likewise. * soft-fp/Banner: Likewise. * nptl/Makefile ($(objpfx)banner.h): Remove rule. ($(objpfx)version.d): Remove dependency on banner.h. ($(objpfx)version.os): Likewise. * nptl/version.c (banner): Do not include banner.h. * manual/contrib.texi: Update entries for Richard Henderson, Jakub Jelinek and BIND code.
* Use "static const char domain[] ="H.J. Lu2017-09-071-1/+1
| | | | | * resolv/tst-resolv-qtypes.c (domain): Changed to "const char domain[] =".
* resolv: __resolv_conf_attach must not free passed conf object [BZ #22096]Florian Weimer2017-09-061-4/+1
|
* resolv: Fix memory leak with OOM during resolv.conf parsing [BZ #22095]Florian Weimer2017-09-061-0/+5
|
* nss_dns: Remove dead PTR IPv4-to-IPv6 mapping codeFlorian Weimer2017-09-062-20/+174
|
* tst-res_use_inet6: Enhance test to cover IPv4-to-IPv6 address mappingFlorian Weimer2017-09-061-45/+186
| | | | | This requires more control over the response data, so it is now determined by flags embedded in the query name.
* hurd: fix resolv/tst-resolv-res_init-skeleton.c buildSamuel Thibault2017-09-031-0/+4
| | | | | * resolv/tst-resolv-res_init-skeleton.c (run_res_init) [!CLONE_NEWUTS]: Fail as unsupported if hostname is not NULL.
* getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922]Florian Weimer2017-09-011-23/+55
| | | | | | The old code uses errno as the primary indicator for success or failure. This is wrong because errno is only set for specific combinations of the status return value and the h_errno variable.
* resolv: Remove internal_function attributeFlorian Weimer2017-08-315-24/+8
|
* Consolidate non cancellable writev callAdhemerval Zanella2017-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable writev calls to use the __writev_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * gmon/gmon.c (write_hist): Replace writev_not_cancel_no_status with __writev_nocancel_nostatus. (write_call_graph): Likewise. (write_bb_counts): Likewise. * resolv/herror.c (herror): Likewise. * sysdeps/generic/not-cancel.h (writev_not_cancel_no_status): Remove macro. (__writev_nocancel_nostatus): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (writev_not_cancel_no_status): Remove macro. (__writev_nocancel_nostatus): New function.
* Consolidate non cancellable close callAdhemerval Zanella2017-08-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable close calls to use the __close_nocancel{_nostatus} identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Also, since it is used on libcrypto it is also exported in GLIBC_PRIVATE namespace. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (close_not_cancel): Remove macro. (close_not_cancel_no_status): Likewise. (__close_nocancel): New macro. (__close_nocancel_no_status): Likewise. * sysdeps/unix/sysv/linux/not-cancel.h (__close_nocancel): Remove macro. (close_not_cancel): Likewise. (close_not_cancel_no_status): Likewise. (__close_nocancel): New prototype. (__close_nocancel_no_status): New function. * sysdeps/unix/sysv/linux/close.c (__close_nocancel): New function. * catgets/open_catalog.c (__open_catalog): Replace close_not_cancel{_no_status) with __close_nocancel{_nostatus}. * gmon/gmon.c (write_gmon): Likewise. * iconv/gconv_cache.c (__gconv_load_cache): Likewise. * intl/loadmsgcat.c (close): Likewise. * io/ftw.c (open_dir_stream): Likewise. (ftw_startup): Likewise. * libio/fileops.c (_IO_file_open): Likewise. (_IO_file_close_mmap): Likewise. (_IO_file_close): Likewise. * libio/iopopen.c (_IO_dup2): Likewise. * locale/loadarchive.c (_nl_load_locale_from_archive): Likewise. * locale/loadlocale.c (_nl_load_locale): Likewise. * login/utmp_file.c (pututline_file): Likewise. (endutent_file): Likewise. * misc/daemon.c (daemon): Likewise. * nscd/nscd_getai.c (__nscd_getai): Likewise. * nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise. * nscd/nscd_gethst_r.c (nscd_gethst_r): Likewise. * nscd/nscd_getpw_r.c (nscd_getpw_r): Likewise. * nscd/nscd_getserv_r.c (nscd_getserv_r): Likewise. * nscd/nscd_helper.c (open_socket): Likewise. (__nscd_open_socket): Likewise. * nscd/nscd_initgroups.c (__nscd_getgrouplist): Likewise. * nscd/nscd_netgroup.c (__nscd_setnetgrent): Likewise. (__nscd_innetgr): Likewise. * nss/nss_db/db-open.c (internal_setent): Likewise. * resolv/res-close.c (__res_iclose): Likewise. * sunrpc/pm_getmaps.c (pmap_getmaps): Likewise. * sysdeps/posix/closedir.c (__closedir): Likewise. * sysdeps/posix/getaddrinfo.c (getaddrinfo): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/posix/opendir.c (tryopen_o_directory): Likewise. (opendir_tail): Likewise. * sysdeps/posix/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/check_native.c (__check_native): Likewise. * sysdeps/unix/sysv/linux/check_pf.c (__check_pf): Likewise. * sysdeps/unix/sysv/linux/fips-private.h (fips_enabled_p): Likewise. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise. (gethostid): Likewise. * sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Likewise. * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Likewise. * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Likewise. * sysdeps/unix/sysv/linux/grantpt.c (close_all_fds): Likewise. * sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Likewise. * sysdeps/unix/sysv/linux/ia64/has_cpuclock.c (has_cpuclock): Likewise. * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex): Likewise. * sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise. * sysdeps/unix/sysv/linux/malloc-sysdep.h (check_may_shrink_heap): Likewise. * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Likewise. * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Likewise.
* Consistently use uintN_t not u_intN_t everywhere.Joseph Myers2017-08-076-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* resolv: Deal with non-deterministic address order in tst-resolv-basicFlorian Weimer2017-07-061-15/+64
|
* support: Add resolver testing mode which does not patch _resFlorian Weimer2017-07-052-1/+489
|
* support: Add support_chroot_create and support_chroot_freeFlorian Weimer2017-07-051-47/+22
|
* resolv: Fix resolv_conf _res matchingFlorian Weimer2017-07-042-5/+50
| | | | | | | | A dot-less host name without an /etc/resolv.conf file caused an assertion failure in update_from_conf because the function would not deal correctly with the empty search list case. Thanks to Andreas Schwab for debugging assistence.
* resolv: Fix improper assert in __resolv_conf_attachFlorian Weimer2017-07-043-8/+99
|
* resolv: Introduce free list for resolv_conf index slostsFlorian Weimer2017-07-033-32/+126
|
* resolv: Automatically reload a changed /etc/resolv.conf file [BZ #984]Florian Weimer2017-07-039-94/+235
| | | | | | | | | | This commit enhances the stub resolver to reload the configuration in the per-thread _res object if the /etc/resolv.conf file has changed. The resolver checks whether the application has modified _res and will not overwrite the _res object in that case. The struct resolv_context mechanism is used to check the configuration file only once per name lookup.
* resolv: Mirror the entire resolver configuration in struct resolv_confFlorian Weimer2017-07-036-116/+536
| | | | | | | | | | | | | | 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.)
* resolv: Lift domain search list limits [BZ #19569] [BZ #21475]Florian Weimer2017-07-036-81/+348
| | | | | | | 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_conf with extended resolver stateFlorian Weimer2017-07-038-10/+452
| | | | | | | | | | | | This change provides additional resolver configuration state which is not exposed through the _res ABI. It reuses the existing initstamp field in the supposedly-private part of _res. Some effort is undertaken to avoid memory safety issues introduced by applications which directly patch the _res object. With this commit, only the initstamp field is moved into struct resolv_conf. Additional members will be added later, eventually migrating the entire resolver configuration.
* resolv: Introduce struct resolv_context [BZ #21668]Florian Weimer2017-07-0315-291/+810
| | | | | | | | | | | | 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: Add preinit tests to resolv/tst-resolv-res_init-skeleton.cFlorian Weimer2017-07-031-1/+192
|
* resolv: Improve debugging output from tst-resolv-res_initFlorian Weimer2017-06-301-2/+13
|
* resolv: Remove source argument fron res_optionsFlorian Weimer2017-06-301-4/+4
|
* resolv: Remove DEBUG from resolv/res_query.cFlorian Weimer2017-06-301-36/+0
|
* resolv: Reformat resolv/res_data.c to GNU styleFlorian Weimer2017-06-301-13/+33
|
* resolv: Move res_query, res_search res_querydomain, hostaliasFlorian Weimer2017-06-302-81/+56
| | | | From res_data.c to query.c
* resolv: Move res_isourserver, res_send from res_data.c to res_send.cFlorian Weimer2017-06-302-16/+15
|
* resolv: Turn _res_opcodes into a compatibility symbolFlorian Weimer2017-06-301-3/+11
|
* resolv: Move fp_nquery, fp_query, p_query, _res_opcodesFlorian Weimer2017-06-302-57/+58
| | | | | | From res_data.c to res_debug.c. Also drop the unnecessary _res initialization from fp_nquery.
* resolv: Remove unused resolv/res_debug.h header fileFlorian Weimer2017-06-302-35/+0
|
* resolv: Remove DEBUG from resolv/res_send.cFlorian Weimer2017-06-301-144/+1
|
* resolv: Move the res_mkquery function to the resolv/mk_query.c fileFlorian Weimer2017-06-302-21/+21
|
* resolv: Reformat resolv/res_mkquery.c to GNU styleFlorian Weimer2017-06-301-144/+140
|
* resolv: Remove DEBUG macro from resolv/res_mkquery.cFlorian Weimer2017-06-301-18/+18
|
* resolv: Make RES_ROTATE start with a random name server [BZ #19570]Florian Weimer2017-06-303-28/+339
| | | | | Do not copy the actual name server addresses to rotate them. Use a global rotation offset instead.
* resolv: Avoid timeouts in test-resolv-res-init, test-resolv-res_init-threadFlorian Weimer2017-06-271-0/+78
| | | | | | | Some Linux kernels have very aggressive ICMP rate limiting on the loopback interface. This commit introduces a minimal echoing DNS server inside the network namespace, so that there is no need for ICMP error messages anymore.
* resolv: Call _res_hconf_init from __res_vinitFlorian Weimer2017-06-272-1/+5
| | | | | | | | Many callers of __res_maybe_init also call _res_hconf_init. Additional calls to the latter do not hurt because the function does its work only once. (/etc/hosts.conf is not reloaded or even checked for changes.) This means that we can simplify the code by calling _res_hconf_init directly from __res_vinit.
* resolv/tst-resolv-basic: Add test cases for bug 21295Florian Weimer2017-06-241-0/+16
|
* inet_pton: Reject IPv6 addresses with many leading zeros [BZ #16637]Florian Weimer2017-06-232-21/+12
| | | | 2001:db8:00001::f is not a valid IPv6 address according to RFC 2373.
* resolv/res_libc.c: Reformat to GNU styleFlorian Weimer2017-06-231-67/+86
|
* resolv: Clean up declarations of the __res_initstamp variableFlorian Weimer2017-06-233-2/+5
|
* __inet_pton_length: Implement new internal helper functionFlorian Weimer2017-06-215-72/+649
|
* resolv: Use getline for configuration file reading in res_vinit_1Florian Weimer2017-06-191-24/+43
|
* resolv: Report allocation errors in __res_vinitFlorian Weimer2017-06-193-34/+89
|