allow path for resolv.conf file to be configurable #220
Comments
I'm personally not a fan of magic environment variables, especially for libraries that are embedded into other applications and frameworks. It could cause unintended consequences or possible security vulnerabilities. I'd prefer a new ares_init_options() setting that could control the path. |
Comments in the code mention that instead of extending What implications does either approach have for backward and forward compatibility? |
Also, if I understand this correctly, the resolv.conf file is setup within the
There's probably something else I'm missing, so would appreciate comments or suggestions on any other approach as well. |
I think this is a case where it would be acceptable to simply extend ares_init_options() due to it really being part of the initialization process, unlike a lot of other options like timeouts, retries, etc. |
Add resolvconf_path to end of struct ares_options with ARES_OPT_RESOLVCONF option so on Unix-like systems a custom path can be specified. If no path is specified, /etc/resolv.conf is used like normal. Fix By: Sarat Addepalli @SirR4T Fixes Bug: c-ares#220 Review By: Brad House @bradh352
Hi Team,
While working on this issue, I came to understand that the path to the
resolv.conf
file is hardcoded, via./configure
.For testing purposes, we would like to launch a child process with a different path for the
resolv.conf
file (via an environment variable likeCARES_RESOLV_CONF_PATH
, say), where we would then be able to specify differentresolv.conf
files (with differentsearch
,nameserver
, etc. stanzas, say).I'd like to work on adding this support, but wanted to ask if such a PR would be welcome?
The text was updated successfully, but these errors were encountered: