obnox/cwrap/resolv_wrapper.git
3 years agotests: Call res_close in res_query and res_search tests
Jakub Hrozek [Thu, 20 Aug 2015 09:49:35 +0000 (11:49 +0200)]
tests: Call res_close in res_query and res_search tests

This fixes two memory leaks in the tests.

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agodoc: Use kinit instead of dig in the manpage example
Jakub Hrozek [Mon, 9 Feb 2015 16:26:10 +0000 (17:26 +0100)]
doc: Use kinit instead of dig in the manpage example

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agotests: Add tests for res_query and res_search
Jakub Hrozek [Tue, 18 Aug 2015 09:22:14 +0000 (11:22 +0200)]
tests: Add tests for res_query and res_search

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agoChange my e-mail address
Jakub Hrozek [Tue, 18 Aug 2015 09:21:59 +0000 (11:21 +0200)]
Change my e-mail address

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agorwrap: Fix strict aliasing warnings for symbol binding
Andreas Schneider [Wed, 12 Aug 2015 13:59:53 +0000 (15:59 +0200)]
rwrap: Fix strict aliasing warnings for symbol binding

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agotests: Migrate to new cmocka API
Andreas Schneider [Wed, 12 Aug 2015 14:07:27 +0000 (16:07 +0200)]
tests: Migrate to new cmocka API

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agoFind the correct symbol when res_* is a define to __res_*
Andrew Bartlett [Wed, 12 Aug 2015 01:50:48 +0000 (13:50 +1200)]
Find the correct symbol when res_* is a define to __res_*

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agocmake: Drop test results via https.
Andreas Schneider [Wed, 25 Feb 2015 10:20:59 +0000 (11:20 +0100)]
cmake: Drop test results via https.

Signed-off-by: Andreas Schneider <asn@samba.org>
4 years agoBump version to 1.1.2.
Andreas Schneider [Tue, 13 Jan 2015 10:39:13 +0000 (11:39 +0100)]
Bump version to 1.1.2.

4 years agocmake: Fix ns_name_compress detection.
Andreas Schneider [Tue, 13 Jan 2015 10:37:31 +0000 (11:37 +0100)]
cmake: Fix ns_name_compress detection.

On some platforms it is a macro and not a function. So we need to check
if the macro exists.

Signed-off-by: Andreas Schneider <asn@samba.org>
4 years agoBump version to 1.1.1.
Andreas Schneider [Mon, 12 Jan 2015 11:48:38 +0000 (12:48 +0100)]
Bump version to 1.1.1.

Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Fix a possible NULL dereference.
Andreas Schneider [Mon, 12 Jan 2015 11:45:38 +0000 (12:45 +0100)]
rwrap: Fix a possible NULL dereference.

CID: #84271

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: If we do not have ns_name_compress() use dn_comp().
Andreas Schneider [Thu, 8 Jan 2015 15:32:19 +0000 (16:32 +0100)]
rwrap: If we do not have ns_name_compress() use dn_comp().

This should fix older Linux versions which do not export
ns_name_compress(). In newer glibc versions dn_comp() calls
ns_name_compress().

Reviewed-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoBump version to 1.1.0.
Andreas Schneider [Tue, 2 Dec 2014 14:43:58 +0000 (15:43 +0100)]
Bump version to 1.1.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Add an invalid record to the fake_hosts file for tests
Jakub Hrozek [Tue, 2 Dec 2014 09:37:01 +0000 (10:37 +0100)]
tests: Add an invalid record to the fake_hosts file for tests

To make sure rwrap is able to skip invalid records as appropriate.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: Don't dereference NULL when skipping broken records
Jakub Hrozek [Tue, 2 Dec 2014 09:35:49 +0000 (10:35 +0100)]
rwrap: Don't dereference NULL when skipping broken records

CID: 83426
CID: 83425

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agotests: Define MIN if not available.
Andreas Schneider [Fri, 28 Nov 2014 07:49:12 +0000 (08:49 +0100)]
tests: Define MIN if not available.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Query A record via CNAME
Jakub Hrozek [Tue, 25 Nov 2014 17:34:45 +0000 (18:34 +0100)]
tests: Query A record via CNAME

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Support asking for A via CNAME
Jakub Hrozek [Tue, 25 Nov 2014 17:34:28 +0000 (18:34 +0100)]
rwrap: Support asking for A via CNAME

Adds support for querying for an A record using a name that only expands
into a CNAME.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agotests: test that CNAME and SRV records can recurse
Jakub Hrozek [Tue, 25 Nov 2014 17:33:29 +0000 (18:33 +0100)]
tests: test that CNAME and SRV records can recurse

Add tests for recursing into a CNAME record.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Recursively add additional data
Jakub Hrozek [Tue, 25 Nov 2014 17:33:21 +0000 (18:33 +0100)]
rwrap: Recursively add additional data

Change how we construct the fake answer such that the header and
question are added first, then the answers and finally additional data.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Make the rwrap_fake_* functions only fake RRs
Jakub Hrozek [Tue, 18 Nov 2014 10:33:42 +0000 (11:33 +0100)]
rwrap: Make the rwrap_fake_* functions only fake RRs

The rwrap_fake_common() function did too much. Remove it and use
separate functions to add fake header and question sections. The
rwrap_fake_$RR functions will receive packet including the header and
question and only add its RR data.

This will allow recursive processing later.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: CNAME record can recurse into A, AAAA or CNAME
Jakub Hrozek [Sun, 23 Nov 2014 16:40:57 +0000 (17:40 +0100)]
rwrap: CNAME record can recurse into A, AAAA or CNAME

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: SRV record can recurse into A or AAAA
Jakub Hrozek [Sun, 23 Nov 2014 16:40:32 +0000 (17:40 +0100)]
rwrap: SRV record can recurse into A or AAAA

When querying for a SRV record, we'll need to include A or AAAA records
in additional section. Therefore, keep querying the host file until we
can either recurse the A/AAAA records or reach the recursion limit

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Use the rwrap_fake_rr structure instead of raw uint8_t pointers
Jakub Hrozek [Sun, 23 Nov 2014 15:57:32 +0000 (16:57 +0100)]
rwrap: Use the rwrap_fake_rr structure instead of raw uint8_t pointers

Currently only one instance of the rwrap_fake_rr structure is used. Recursion
will be implemented in a future patch.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agoAdd data structures and functions to represent and manipulate RRs
Jakub Hrozek [Sun, 23 Nov 2014 15:47:55 +0000 (16:47 +0100)]
Add data structures and functions to represent and manipulate RRs

Adds a structure that, using unions represents all supported RRs. Add a
bunch of utility functions that can be used to create these structures.

Currently the functions are unused.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agotests: Add a test which talks to real nameservers.
Andreas Schneider [Wed, 5 Nov 2014 12:48:49 +0000 (13:48 +0100)]
tests: Add a test which talks to real nameservers.

This is to inspect the answer buffer and be able to compare it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Correctly calculate the response size and return it.
Andreas Schneider [Tue, 4 Nov 2014 16:14:22 +0000 (17:14 +0100)]
rwrap: Correctly calculate the response size and return it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Handle trailing dot in dns names.
Andreas Schneider [Tue, 4 Nov 2014 14:20:11 +0000 (15:20 +0100)]
rwrap: Handle trailing dot in dns names.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agorwrap: Compare dns names case insensitive.
Jakub Hrozek [Tue, 4 Nov 2014 14:00:17 +0000 (15:00 +0100)]
rwrap: Compare dns names case insensitive.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agotorture: Increase time to wait for pid file.
Andreas Schneider [Tue, 4 Nov 2014 15:25:02 +0000 (16:25 +0100)]
torture: Increase time to wait for pid file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agocmake: Do not remove libresolv from required libraries.
Andreas Schneider [Fri, 24 Oct 2014 13:35:19 +0000 (15:35 +0200)]
cmake: Do not remove libresolv from required libraries.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoAdd ChangeLog file.
Andreas Schneider [Fri, 24 Oct 2014 08:13:23 +0000 (10:13 +0200)]
Add ChangeLog file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoAdd Jakub to AUTHORS file.
Andreas Schneider [Fri, 24 Oct 2014 08:13:01 +0000 (10:13 +0200)]
Add Jakub to AUTHORS file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Fix the cleanup of the ns ext resources.
Andreas Schneider [Fri, 24 Oct 2014 09:16:09 +0000 (11:16 +0200)]
rwrap: Fix the cleanup of the ns ext resources.

We should never set nssocks to something different than -1. And we only
should set it in the init function!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agocmake: Fix tests on Solaris.
Andreas Schneider [Thu, 23 Oct 2014 10:41:52 +0000 (12:41 +0200)]
cmake: Fix tests on Solaris.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotorture: Fix socket directory name.
Andreas Schneider [Thu, 23 Oct 2014 10:30:50 +0000 (12:30 +0200)]
torture: Fix socket directory name.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Fix test_res_ninit() with IPv4 only support.
Andreas Schneider [Thu, 23 Oct 2014 05:51:04 +0000 (07:51 +0200)]
tests: Fix test_res_ninit() with IPv4 only support.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Fix symbol binding on Solaris.
Andreas Schneider [Thu, 23 Oct 2014 05:46:53 +0000 (07:46 +0200)]
rwrap: Fix symbol binding on Solaris.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Use the right array size in tests.
Jakub Hrozek [Tue, 21 Oct 2014 16:42:44 +0000 (18:42 +0200)]
tests: Use the right array size in tests.

Several unit tests used the wrong array size, which might cause buffer
overflows. This patch unifies on using sizeof(array) since all the
arrays are allocated on stack.

CID #68270
CID #68269
CID #68267
CID #68265

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Don't use htons for bitfields.
Jakub Hrozek [Tue, 21 Oct 2014 15:23:30 +0000 (17:23 +0200)]
rwrap: Don't use htons for bitfields.

On FreeBSD, using htons to set the bitfield led to warnings such as:
resolv_wrapper.c:162:8: warning: implicit truncation from '__uint16_t'
(aka 'unsigned short') to bitfield changes value from 256 to 0
[-Wbitfield-constant-conversion]
        h->qr = htons(1);               /* response flag */
              ^ ~~~~~~~~

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Explicitly zero out sin_zero to silence gcc warnings.
Jakub Hrozek [Tue, 21 Oct 2014 13:34:28 +0000 (15:34 +0200)]
rwrap: Explicitly zero out sin_zero to silence gcc warnings.

On some platforms, failure to set the sin_zero structure lead to
warnings such as:

resolv_wrapper.c:969:5: warning: missing initializer for field ‘sin_zero’
        of ‘struct sockaddr_in’ [-Wmissing-field-initializers]

     };
     ^
In file included from /usr/include/arpa/inet.h:22:0,
                 from /.../source/src/resolv_wrapper.c:38:

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Call res_nclose() in test_res_query_search.c.
Jakub Hrozek [Tue, 21 Oct 2014 13:27:54 +0000 (15:27 +0200)]
tests: Call res_nclose() in test_res_query_search.c.

The res_query and res_nsearch unit tests didn't call res_nclose as
appropriate, leading to a resource leak.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Close the resolv.conf file handle.
Jakub Hrozek [Tue, 21 Oct 2014 13:11:16 +0000 (15:11 +0200)]
rwrap: Close the resolv.conf file handle.

CID #68264

The file descriptor of resolv.conf wasn't closed properly.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Free IPv6 name servers on close.
Jakub Hrozek [Tue, 21 Oct 2014 13:00:36 +0000 (15:00 +0200)]
rwrap: Free IPv6 name servers on close.

rwrap's res_ninit allocates IPv6 name servers, but res_nclose didn't
free them, leading to a resource leak detectable with valgrind.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Move NEXT_KEY out of the NDEBUG ifdef.
Andreas Schneider [Tue, 21 Oct 2014 12:43:48 +0000 (14:43 +0200)]
rwrap: Move NEXT_KEY out of the NDEBUG ifdef.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agodoc: Add section for dns faking to manpage.
Andreas Schneider [Sun, 12 Oct 2014 18:04:11 +0000 (20:04 +0200)]
doc: Add section for dns faking to manpage.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoresolv: Implement CNAME faking
Jakub Hrozek [Sat, 4 Oct 2014 16:10:42 +0000 (18:10 +0200)]
resolv: Implement CNAME faking

Signed-off-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoresolv: Implement SOA faking
Jakub Hrozek [Sat, 4 Oct 2014 15:55:50 +0000 (17:55 +0200)]
resolv: Implement SOA faking

Signed-off-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoresolv: Implement SRV faking
Jakub Hrozek [Sat, 4 Oct 2014 14:26:58 +0000 (16:26 +0200)]
resolv: Implement SRV faking

Signed-off-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoresolv: Implement faking A and AAAA DNS replies
Jakub Hrozek [Sun, 14 Sep 2014 09:12:56 +0000 (11:12 +0200)]
resolv: Implement faking A and AAAA DNS replies

Adds the possibility of faking a DNS reply based on a hosts-like file.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agocmake: Rely on the cmake config cmocka provides.
Andreas Schneider [Tue, 16 Sep 2014 13:37:38 +0000 (15:37 +0200)]
cmake: Rely on the cmake config cmocka provides.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Add a unit test for res_nquery and res_nsearch
Jakub Hrozek [Fri, 12 Sep 2014 13:49:01 +0000 (15:49 +0200)]
tests: Add a unit test for res_nquery and res_nsearch

Adds a test that connects to a test DNS server and searches it using
res_query and res_search.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Add generating resolv.conf to torture
Jakub Hrozek [Sat, 13 Sep 2014 15:09:30 +0000 (17:09 +0200)]
tests: Add generating resolv.conf to torture

Adds a setup/teardown functions that allow a unit test to easily
generate a resolv.conf pointing to our test DNS server.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Add torture library from socket_wrapper
Jakub Hrozek [Fri, 12 Sep 2014 12:49:16 +0000 (14:49 +0200)]
tests: Add torture library from socket_wrapper

Pretty much a blatant copy of the torture library from socket_wrapper,
just s/echo_srv/dns_srv/

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agotests: Add a simple DNS server
Jakub Hrozek [Mon, 8 Sep 2014 07:48:17 +0000 (09:48 +0200)]
tests: Add a simple DNS server

This DNS server will be usable for testing. Currently only supports A
records.

The server responds to any A query with the value of RWRAP_TEST_A_REC
environment variable. If undefined, the server always replies with
127.0.10.10.

Please note the server does *not* perform many security checks and is
completely unsuitable outside a test suite! Check out servers like
dnsmasq for anything more complex.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agodoc: Update the manpage for resolv.conf.
Andreas Schneider [Thu, 4 Sep 2014 09:19:04 +0000 (11:19 +0200)]
doc: Update the manpage for resolv.conf.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agodoc: Add instructions how to point cmake to socket_wrapper
Michael Adam [Wed, 15 Oct 2014 09:52:08 +0000 (11:52 +0200)]
doc: Add instructions how to point cmake to socket_wrapper

This is needed for unit testing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agotests: Add a test for parsing resolv.conf
Jakub Hrozek [Wed, 3 Sep 2014 15:32:27 +0000 (17:32 +0200)]
tests: Add a test for parsing resolv.conf

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Add support to read a resolv.conf.
Jakub Hrozek [Wed, 3 Sep 2014 12:34:15 +0000 (14:34 +0200)]
rwrap: Add support to read a resolv.conf.

For now, only "nameserver" entries are interpreted.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Add support for res_[n]search().
Andreas Schneider [Tue, 2 Sep 2014 12:19:32 +0000 (14:19 +0200)]
rwrap: Add support for res_[n]search().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Add support for res_[n]query().
Andreas Schneider [Tue, 2 Sep 2014 12:06:00 +0000 (14:06 +0200)]
rwrap: Add support for res_[n]query().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Add support for res_nclose().
Andreas Schneider [Mon, 1 Sep 2014 15:23:13 +0000 (17:23 +0200)]
rwrap: Add support for res_nclose().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Add initial support for res_[n]init().
Andreas Schneider [Mon, 1 Sep 2014 10:41:17 +0000 (12:41 +0200)]
rwrap: Add initial support for res_[n]init().

This first approach does not parse a resolv.conf file
but instead takes a nameserver address from the environment
variable RESOLV_WRAPPER_NAMESERVER.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Add .gitignore.
Andreas Schneider [Thu, 4 Sep 2014 05:57:11 +0000 (07:57 +0200)]
rwrap: Add .gitignore.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agorwrap: Big bang!
Andreas Schneider [Thu, 28 Aug 2014 15:47:06 +0000 (17:47 +0200)]
rwrap: Big bang!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>