resolv_wrapper.git
14 months agocmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode master
Andreas Schneider [Fri, 17 Feb 2023 16:51:27 +0000 (17:51 +0100)]
cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
14 months agotests: Fix pointer type for assert_string_equal()
Andreas Schneider [Fri, 17 Feb 2023 17:01:57 +0000 (18:01 +0100)]
tests: Fix pointer type for assert_string_equal()

error: pointer targets in passing argument 1 of ‘_assert_string_equal’
differ in signedness [-Werror=pointer-sign]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
16 months agoBump version to 1.1.8 resolv_wrapper-1.1.8
Andreas Schneider [Tue, 20 Dec 2022 15:08:33 +0000 (16:08 +0100)]
Bump version to 1.1.8

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2 years agocmake: Fix detection of a fully seperate libresolv
Andreas Schneider [Wed, 3 Nov 2021 14:12:22 +0000 (15:12 +0100)]
cmake: Fix detection of a fully seperate libresolv

With glibc 2.24 all res_* symbols moved from libresolv to libc. This means
that socket_wrapper is not able to do the traffic to the DNS server. This
leaves us only with DNS faking.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agodoc: Update documentation for glibc 2.34 changes
Andreas Schneider [Wed, 3 Nov 2021 14:22:44 +0000 (15:22 +0100)]
doc: Update documentation for glibc 2.34 changes

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agodoc: Rename resolv_wrapper.1.txt to resolv_wrapper.1.adoc
Andreas Schneider [Wed, 3 Nov 2021 14:24:42 +0000 (15:24 +0100)]
doc: Rename resolv_wrapper.1.txt to resolv_wrapper.1.adoc

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agorwrap: Use our own rwrap_randomid()
Andreas Schneider [Wed, 3 Nov 2021 14:09:56 +0000 (15:09 +0100)]
rwrap: Use our own rwrap_randomid()

This is what glibc does, but the function is marked as deprecated now.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agotests: Add test_res_fake_uri_nsearch()
Andreas Schneider [Thu, 19 Aug 2021 10:47:30 +0000 (12:47 +0200)]
tests: Add test_res_fake_uri_nsearch()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoBump version to 1.1.7 resolv_wrapper-1.1.7
Andreas Schneider [Mon, 24 Aug 2020 14:48:03 +0000 (16:48 +0200)]
Bump version to 1.1.7

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agorwrap: Turn some errors into warnings
Andreas Schneider [Mon, 24 Aug 2020 14:44:58 +0000 (16:44 +0200)]
rwrap: Turn some errors into warnings

This fixes some Samba tests which redirect stderr to stdout and then get
more messages than expected.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agogitlab-ci: Add Ubuntu runner
Andreas Schneider [Tue, 24 Mar 2020 09:45:45 +0000 (10:45 +0100)]
gitlab-ci: Add Ubuntu runner

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agogitlab-ci: Remove debian cross mips build
Andreas Schneider [Tue, 24 Mar 2020 09:44:38 +0000 (10:44 +0100)]
gitlab-ci: Remove debian cross mips build

This isn't supported by Debian anymore.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agoBump version to 1.1.6 resolv_wrapper-1.1.6
Andreas Schneider [Mon, 23 Mar 2020 07:49:14 +0000 (08:49 +0100)]
Bump version to 1.1.6

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agocpack: Set the full version not only major
Andreas Schneider [Mon, 23 Mar 2020 09:21:26 +0000 (10:21 +0100)]
cpack: Set the full version not only major

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agoRename CHANGELOG
Andreas Schneider [Mon, 23 Mar 2020 07:43:26 +0000 (08:43 +0100)]
Rename CHANGELOG

Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agotests: Check for valid fd in torture_setup_resolv_conf()
Andreas Schneider [Mon, 23 Mar 2020 07:41:53 +0000 (08:41 +0100)]
tests: Check for valid fd in torture_setup_resolv_conf()

CID #68262

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agotests: Check for valid fd in test_res_init
Andreas Schneider [Mon, 23 Mar 2020 07:40:45 +0000 (08:40 +0100)]
tests: Check for valid fd in test_res_init

CID #68268

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agogitlab-ci: Whitelist metze to use the FreeBSD runner
Andreas Schneider [Fri, 20 Mar 2020 13:23:24 +0000 (14:23 +0100)]
gitlab-ci: Whitelist metze to use the FreeBSD runner

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agotests: Fix memory overrun
Andreas Schneider [Fri, 20 Mar 2020 12:49:20 +0000 (13:49 +0100)]
tests: Fix memory overrun

16-byte array and size 256 doesn't work very well.

CID 274185

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agorwrap: make use of res_{get,set}servers() for FreeBSD
Stefan Metzmacher [Tue, 10 Mar 2020 12:11:40 +0000 (13:11 +0100)]
rwrap: make use of res_{get,set}servers() for FreeBSD

This way don't depend on the opaque structure on FreeBSD
and have support for ipv6 nameservers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: split out a rwrap_set_nameservers() function
Stefan Metzmacher [Tue, 10 Mar 2020 12:07:25 +0000 (13:07 +0100)]
rwrap: split out a rwrap_set_nameservers() function

This will make it easier to add support for ipv6 nameservers
on FreeBSD in the next step.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: split out rwrap_{get,log}_nameservers() functions
Stefan Metzmacher [Tue, 10 Mar 2020 12:07:25 +0000 (13:07 +0100)]
rwrap: split out rwrap_{get,log}_nameservers() functions

This will make it easier to add support for ipv6 nameservers
on FreeBSD in the next step.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: split out a rwrap_reset_nameservers() function
Stefan Metzmacher [Tue, 10 Mar 2020 12:07:25 +0000 (13:07 +0100)]
rwrap: split out a rwrap_reset_nameservers() function

This will make it easier to add support for ipv6 nameservers
on FreeBSD in the following commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: let configure use define HAVE_RES_STATE_U_EXT_NSADDRS
Stefan Metzmacher [Wed, 18 Mar 2020 16:01:48 +0000 (17:01 +0100)]
rwrap: let configure use define HAVE_RES_STATE_U_EXT_NSADDRS

The configure check should describe what it checked for.
Let the code logic decide if that means we expect
HAVE_RESOLV_IPV6_NSADDRS to be defined.

We'll get another condition that sets HAVE_RESOLV_IPV6_NSADDRS
in the following commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: fix resolv wrapper with ipv6 addresses and old glibc versions
Stefan Metzmacher [Thu, 14 Feb 2019 14:46:22 +0000 (15:46 +0100)]
rwrap: fix resolv wrapper with ipv6 addresses and old glibc versions

The handling of __res_state._u._ext was different before
this glibc commit (e.g. glibc-2.19):

  commit 2212c1420c92a33b0e0bd9a34938c9814a56c0f7
  Author:     Andreas Schwab <schwab@suse.de>
  AuthorDate: Thu Feb 19 15:52:08 2015 +0100
  Commit:     Andreas Schwab <schwab@suse.de>
  CommitDate: Thu May 21 15:16:37 2015 +0200

      Simplify handling of nameserver configuration in resolver

      Remove use of ext.nsmap member of struct __res_state and always use
      an identity mapping betwen the nsaddr_list array and the ext.nsaddrs
      array.  The fact that a nameserver has an IPv6 address is signalled by
      setting nsaddr_list[].sin_family to zero.

As a result of fixing this, it's now possible to run 'test_res_init'
even without using resolv_wrapper.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agotests/test_res_init.c: avoid using public ipv6 addresses from google in tests
Stefan Metzmacher [Fri, 15 Feb 2019 16:24:57 +0000 (17:24 +0100)]
tests/test_res_init.c: avoid using public ipv6 addresses from google in tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: improve logging messages by including getprogname()
Stefan Metzmacher [Wed, 11 Mar 2020 16:12:22 +0000 (17:12 +0100)]
rwrap: improve logging messages by including getprogname()

This it basically the same as used in socket_wrapper.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agorwrap: fix warning where %s is always passed a NULL pointer in rwrap_create_fake_uri_rr()
Stefan Metzmacher [Thu, 19 Mar 2020 08:54:48 +0000 (09:54 +0100)]
rwrap: fix warning where %s is always passed a NULL pointer in rwrap_create_fake_uri_rr()

This happens in Samba's gitlab pipeline on Fedora 30/31:

 [3203/4410] Compiling third_party/resolv_wrapper/resolv_wrapper.c
==> /builds/samba-team/devel/samba/samba-o3.stderr <==
../../third_party/resolv_wrapper/resolv_wrapper.c: In function ‘rwrap_create_fake_uri_rr’:
../../third_party/resolv_wrapper/resolv_wrapper.c:104:33: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  104 | # define RWRAP_LOG(dbglvl, ...) rwrap_log((dbglvl), __func__, __VA_ARGS__)
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/resolv_wrapper/resolv_wrapper.c:340:3: note: in expansion of macro ‘RWRAP_LOG’
  340 |   RWRAP_LOG(RWRAP_LOG_ERROR,
      |   ^~~~~~~~~
../../third_party/resolv_wrapper/resolv_wrapper.c:341:28: note: format string is defined here
  341 |      "Malformed URI entry [%s]\n", value);
      |                            ^~
cc1: all warnings being treated as errors

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoConfigureChecks.cmake: remove unused [__]res_send checks
Stefan Metzmacher [Wed, 18 Mar 2020 14:06:36 +0000 (15:06 +0100)]
ConfigureChecks.cmake: remove unused [__]res_send checks

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agocmake: Update cmake defaults for out of source build
Andreas Schneider [Fri, 31 Jan 2020 12:10:51 +0000 (13:10 +0100)]
cmake: Update cmake defaults for out of source build

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agodoc: Set author for manpage
Andreas Schneider [Fri, 31 Jan 2020 11:51:51 +0000 (12:51 +0100)]
doc: Set author for manpage

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Fix path of cmake config files and pkgconfig
Andreas Schneider [Fri, 15 Nov 2019 12:20:02 +0000 (13:20 +0100)]
cmake: Fix path of cmake config files and pkgconfig

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agotests: Fix coverity warning that sock could be negative
Andreas Schneider [Mon, 21 Oct 2019 06:59:57 +0000 (08:59 +0200)]
tests: Fix coverity warning that sock could be negative

CID 263708

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agogitlab-ci: Setup CI for resolv_wrapper
Andreas Schneider [Thu, 17 Oct 2019 14:59:28 +0000 (16:59 +0200)]
gitlab-ci: Setup CI for resolv_wrapper

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Use GNUInstallDirs
Andreas Schneider [Thu, 17 Oct 2019 14:06:36 +0000 (16:06 +0200)]
cmake: Use GNUInstallDirs

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Use target_include_directories()
Andreas Schneider [Thu, 17 Oct 2019 13:57:17 +0000 (15:57 +0200)]
cmake: Use target_include_directories()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Update AddCMockaTest.cmake
Andreas Schneider [Thu, 17 Oct 2019 13:53:01 +0000 (15:53 +0200)]
cmake: Update AddCMockaTest.cmake

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Require at least cmocka 1.1.0
Andreas Schneider [Thu, 17 Oct 2019 13:49:48 +0000 (15:49 +0200)]
cmake: Require at least cmocka 1.1.0

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Support running the tests with AddressSanitizer
Andreas Schneider [Thu, 17 Oct 2019 13:48:16 +0000 (15:48 +0200)]
cmake: Support running the tests with AddressSanitizer

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Add AddressSanitizer and UndefinedSanitizer
Andreas Schneider [Thu, 17 Oct 2019 13:37:28 +0000 (15:37 +0200)]
cmake: Add AddressSanitizer and UndefinedSanitizer

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Move Compiler flags to new file
Andreas Schneider [Thu, 17 Oct 2019 13:37:05 +0000 (15:37 +0200)]
cmake: Move Compiler flags to new file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Improve checks for compiler flags
Andreas Schneider [Thu, 17 Oct 2019 13:34:21 +0000 (15:34 +0200)]
cmake: Improve checks for compiler flags

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Update defaults for cmake
Andreas Schneider [Thu, 17 Oct 2019 13:26:05 +0000 (15:26 +0200)]
cmake: Update defaults for cmake

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Use unset() instead of setting an empty string
Andreas Schneider [Thu, 17 Oct 2019 13:25:05 +0000 (15:25 +0200)]
cmake: Use unset() instead of setting an empty string

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Use _REQUIRED_LIBRARIES for system libs
Andreas Schneider [Thu, 17 Oct 2019 13:24:16 +0000 (15:24 +0200)]
cmake: Use _REQUIRED_LIBRARIES for system libs

This drops support for Solaris as we can't test it in CI anyway.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Require at least cmake 3.5.0
Andreas Schneider [Thu, 17 Oct 2019 13:18:38 +0000 (15:18 +0200)]
cmake: Require at least cmake 3.5.0

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoREADME: Rename to a markdown file
Andreas Schneider [Thu, 17 Oct 2019 13:12:29 +0000 (15:12 +0200)]
README: Rename to a markdown file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agotests: Wait longer for dns_srv to start
Andreas Schneider [Thu, 17 Oct 2019 15:44:51 +0000 (17:44 +0200)]
tests: Wait longer for dns_srv to start

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agotests: Set socket_wrapper to be required for testing
Andreas Schneider [Fri, 15 Feb 2019 13:41:11 +0000 (14:41 +0100)]
tests: Set socket_wrapper to be required for testing

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoAdded fake resolving of TXT records
Carson Reinke [Sun, 30 Dec 2018 00:03:43 +0000 (19:03 -0500)]
Added fake resolving of TXT records

Signed-off-by: Carson Reinke <carson@reinke.co>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agorwrap: Fix alignment issues on FreeBSD
Andreas Schneider [Thu, 17 Oct 2019 15:49:47 +0000 (17:49 +0200)]
rwrap: Fix alignment issues on FreeBSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agodoc: Document RESOLV_WRAPPER_DISABLE_DEEPBIND
Andreas Schneider [Fri, 4 Jan 2019 07:40:44 +0000 (08:40 +0100)]
doc: Document RESOLV_WRAPPER_DISABLE_DEEPBIND

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agorwrap: Don't do a deep bind if we run with libasan
Andreas Schneider [Sat, 1 Sep 2018 17:47:35 +0000 (19:47 +0200)]
rwrap: Don't do a deep bind if we run with libasan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorwrap: Always build with rwrap_str_lib()
Andreas Schneider [Wed, 29 Aug 2018 14:42:16 +0000 (16:42 +0200)]
rwrap: Always build with rwrap_str_lib()

This fixes the Release build!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Fix function detection
Andreas Schneider [Wed, 29 Aug 2018 06:28:10 +0000 (08:28 +0200)]
cmake: Fix function detection

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Do not misuse CMAKE_REQUIRED_LIBRARIES
Andreas Schneider [Tue, 28 Aug 2018 09:44:38 +0000 (11:44 +0200)]
cmake: Do not misuse CMAKE_REQUIRED_LIBRARIES

This will lead to issues detecting features.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoctest: Move to new dashboard
Andreas Schneider [Thu, 5 Jul 2018 08:17:02 +0000 (10:17 +0200)]
ctest: Move to new dashboard

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorwrap: Update header
Andreas Schneider [Fri, 22 Jun 2018 07:12:01 +0000 (09:12 +0200)]
rwrap: Update header

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoUpdate LICENSE
Andreas Schneider [Fri, 22 Jun 2018 07:11:33 +0000 (09:11 +0200)]
Update LICENSE

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoRename COPYING to LICENSE
Andreas Schneider [Fri, 22 Jun 2018 07:09:38 +0000 (09:09 +0200)]
Rename COPYING to LICENSE

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocpack: Do not package build dirs in source tarball
Andreas Schneider [Fri, 22 Jun 2018 07:06:59 +0000 (09:06 +0200)]
cpack: Do not package build dirs in source tarball

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Replace deprecated get_target_property()
Andreas Schneider [Fri, 22 Jun 2018 07:08:28 +0000 (09:08 +0200)]
cmake: Replace deprecated get_target_property()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorwrap: Only report a notice when a search doesn't have a result
Andreas Schneider [Tue, 18 Jul 2017 08:23:20 +0000 (10:23 +0200)]
rwrap: Only report a notice when a search doesn't have a result

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorwrap: Only warn if we can't open the dns hosts file
Andreas Schneider [Tue, 18 Jul 2017 08:22:38 +0000 (10:22 +0200)]
rwrap: Only warn if we can't open the dns hosts file

It is possible that it hasn't been created yet. At least in Samba when
we start the test environment.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorwrap: Add NOTICE as log level
Andreas Schneider [Tue, 18 Jul 2017 08:16:21 +0000 (10:16 +0200)]
rwrap: Add NOTICE as log level

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorwrap: Do an early return if log level doesn't match
Andreas Schneider [Tue, 18 Jul 2017 08:12:39 +0000 (10:12 +0200)]
rwrap: Do an early return if log level doesn't match

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorwrap: Always enable logging
Andreas Schneider [Tue, 18 Jul 2017 08:11:22 +0000 (10:11 +0200)]
rwrap: Always enable logging

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoBump version to 1.1.5 resolv_wrapper-1.1.5
Andreas Schneider [Thu, 8 Sep 2016 06:51:03 +0000 (08:51 +0200)]
Bump version to 1.1.5

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agoTest a URI query with multiple answers
Matt Rogers [Thu, 25 Aug 2016 16:59:31 +0000 (12:59 -0400)]
Test a URI query with multiple answers

Signed-off-by: Matt Rogers <mrogers@redhat.com
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agoSupport multiple URI answers
Matt Rogers [Thu, 25 Aug 2016 16:57:09 +0000 (12:57 -0400)]
Support multiple URI answers

Add URI record use of recursion to rwrap_get_record(), for collecting
multiple URI answers under a single query.  Increase the
RWRAP_MAX_RECURSION limit to handle more URI records.

Signed-off-by: Matt Rogers <mrogers@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agorwrap: Remove name compression from URI RR
Matt Rogers [Tue, 23 Aug 2016 04:56:14 +0000 (00:56 -0400)]
rwrap: Remove name compression from URI RR

Compression is wrong for URI records.

Signed-off-by: Matt Rogers <mrogers@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agoAdd support for the PTR DNS Resource Record type
Jakub Hrozek [Thu, 18 Aug 2016 15:49:00 +0000 (17:49 +0200)]
Add support for the PTR DNS Resource Record type

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agorwrap: improve debug error messages
Michael Adam [Mon, 29 Aug 2016 06:16:25 +0000 (08:16 +0200)]
rwrap: improve debug error messages

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agoAdd support for the URI DNS Resource Record type
Nathaniel McCallum [Tue, 16 Aug 2016 21:38:32 +0000 (17:38 -0400)]
Add support for the URI DNS Resource Record type

For more information, see RFC 7553.

Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoBump version to 1.1.4 resolv_wrapper-1.1.4
Andreas Schneider [Tue, 31 May 2016 06:22:04 +0000 (08:22 +0200)]
Bump version to 1.1.4

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agotests: Add a test for the NS record handling.
Richard Sharpe [Fri, 20 May 2016 13:36:05 +0000 (06:36 -0700)]
tests: Add a test for the NS record handling.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
7 years agorwrap: Add support to handle NS records
Richard Sharpe [Fri, 20 May 2016 13:31:32 +0000 (06:31 -0700)]
rwrap: Add support to handle NS records

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
8 years agocmake: Add missing HAVE_RESOLV_H define
Andreas Schneider [Wed, 2 Mar 2016 12:08:48 +0000 (13:08 +0100)]
cmake: Add missing HAVE_RESOLV_H define

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agorwrap: AIX compatibility fix, missing headers, bad directive
Guillaume Xavier Taillon [Tue, 1 Mar 2016 16:13:34 +0000 (11:13 -0500)]
rwrap: AIX compatibility fix, missing headers, bad directive

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11765

Signed-off-by: Guillaume Xavier Taillon <gtaillon@ca.ibm.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agoFix typos
Jakub Wilk [Mon, 12 Oct 2015 12:59:01 +0000 (14:59 +0200)]
Fix typos

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agoBump version to 1.1.3 resolv_wrapper-1.1.3
Andreas Schneider [Fri, 21 Aug 2015 10:17:45 +0000 (12:17 +0200)]
Bump version to 1.1.3

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
9 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>
9 years agoBump version to 1.1.2. resolv_wrapper-1.1.2
Andreas Schneider [Tue, 13 Jan 2015 10:39:13 +0000 (11:39 +0100)]
Bump version to 1.1.2.

9 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>
9 years agoBump version to 1.1.1. resolv_wrapper-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>
9 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>
9 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>
9 years agoBump version to 1.1.0. resolv_wrapper-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>
9 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>
9 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>
9 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>
9 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>
9 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>