aboutsummaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-07-03 21:06:23 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-07-03 21:06:23 +0200
commitaef16cc8a4c670036d45590877d411a97f01e0cd (patch)
tree4403f1962170ce92087a6e1af62dbb92e15d27f6 /ChangeLog
parenta1c4eb8794e789b5055d7ceb13b2b3231abf5e26 (diff)
downloadglibc-aef16cc8a4c670036d45590877d411a97f01e0cd.zip
glibc-aef16cc8a4c670036d45590877d411a97f01e0cd.tar.gz
glibc-aef16cc8a4c670036d45590877d411a97f01e0cd.tar.bz2
resolv: Automatically reload a changed /etc/resolv.conf file [BZ #984]
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.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog33
1 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6478aed..bf91026 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,38 @@
2017-06-30 Florian Weimer <fweimer@redhat.com>
+ [BZ #984]
+ Reload /etc/resolv.conf if has been changed on disk.
+ * resolv/resolv_conf.h (resolv_conf): Remove initstamp member.
+ (__resolv_conf_load, __resolv_conf_get_current): Declare.
+ * resolv/resolv_conf.c (struct resolv_conf_global): Add
+ conf_current, conf_mtime, conf_ctime, conf_size, conf_ino members.
+ (__resolv_conf_get_current): New function.
+ (__resolv_conf_allocate): Do not initialize initstamp.
+ (freeres): Deallocate global->conf_current.
+ * resolv/resolv.h (RES_NORELOAD): Define.
+ * resolv/res_debug.c (p_option): Add RES_NORELOAD.
+ * resolv/resolv-internal.h (__res_initstamp): Remove declaration.
+ * resolv/resolv_context.c (replicated_configuration_matches): New.
+ (maybe_init): Call it. Use __resolv_conf_get_current to obtain
+ the current configration.
+ * resolv/res_init.c (__res_initstamp): Remove variable definition.
+ (has_preinit_values): New function.
+ (__resolv_conf_load): Renamed from __res_vinit. Drop res_state
+ parameter and do not call __resolv_conf_attach.
+ (__res_vinit): Reimplement based __resolv_conf_load.
+ (res_options): Handle no-reload.
+ * resolv/res_libc.c (atomicinclock, atomicincunlock, atomicinc)
+ (lock): Remove.
+ (res_int): Do not update __res_initstamp.
+ * resolv/tst-resolv-res_init-skeleton.c (print_resp): Handle
+ RES_NORELOAD.
+ (test_cases): Test no-reload.
+ (special_test_call_res_init): Remove.
+ (special_test_callback): Rely on automated reloading. Add tests
+ for no-reload.
+
+2017-06-30 Florian Weimer <fweimer@redhat.com>
+
Mirror the entire resolver configuration in struct resolv_conf.
* resolv/resolv_context.h (__resolv_context_nameserver_count)
(__resolv_context_nameserver): New functions.