Bug 13482 - does not work with curl
Summary: does not work with curl
Alias: None
Product: cwrap
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact:
Depends on:
Reported: 2018-06-21 16:11 UTC by Patrick Schleizer
Modified: 2018-06-25 02:35 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Schleizer 2018-06-21 16:11:51 UTC
Works with `rwrap_example`.

LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF=/tmp/testresolv.conf 
RWRAP_TRACE(19981) - _rwrap_bind_symbol: Loaded __res_ninit from libc
RWRAP_TRACE(19981) - rwrap_res_nquery: Resolve the domain name [kdc.example.com] - class=1, type=1
RWRAP_TRACE(19981) - rwrap_res_nquery:         nameserver:
RWRAP_TRACE(19981) - rwrap_res_nquery:         nameserver:
RWRAP_TRACE(19981) - _rwrap_bind_symbol: Loaded __res_nquery from libresolv
RWRAP_TRACE(19981) - rwrap_res_nquery: The returned response length is: -1

Doesn't work with `curl` though?

LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF=/tmp/testresolv.conf RESOLV_WRAPPER_DEBUGLEVEL=4 curl google.com

Once I delete, `/etc/resolv.conf`, DNS resolution is broken. (`/tmp/testresolv.conf` being a copy of `/etc/resolv.conf`.)

Am I doing something wrong?
Comment 1 Andreas Schneider 2018-06-22 09:41:47 UTC
I guess curl uses https://c-ares.haxx.se/ so it doesn't call the libc res_* functions from libresolv.
Comment 2 Andreas Schneider 2018-06-22 09:45:37 UTC
From the webpage:

Who c-ares?

c-ares is being used by libcurl

Here we go. Check the c-ares documentation if it is possible to change the resolv.conf file :-)
Comment 3 Patrick Schleizer 2018-06-23 07:43:44 UTC
Covering redirection of c-ares based applications is out of scope for the resolv_wrapper library project?
Comment 4 Andreas Schneider 2018-06-24 16:10:03 UTC
Yes, resolv_wrapper is only for libresolv.so nothing else :-)
Comment 5 Patrick Schleizer 2018-06-25 02:35:38 UTC
Thanks for the clarification! :-)