Commit Graph

891 Commits

Author SHA1 Message Date
Rafael Guterres Jeffman
4435fec596 Migrated to SPDX license
Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2023-09-26 08:58:37 +00:00
Petr Menšík
131ddb918a Detect and propagate atomic libraries like bind9
BIND9 headers expect atomic definitions are configured before they are
included. It needs adding atomic libraries detection in configure AND
including config.h before any ISC headers are included.

Move dyndb-config.h before isc headers anywhere where needed.
2023-09-25 12:33:42 +02:00
Petr Menšík
1be57227a9 Remove rpz_attach for BIND 9.16+
rpz_attach is never supplied from BIND9 code both in 9.16 or 9.18.
Remove our custom function and pass NULL as well. It would be never
called anyway.

Effectivery reverts most of previous commit.
2023-03-22 15:14:45 +01:00
Timo Aaltonen
5f37344d07 Fix building against bind 9.18.13
db_registered got dropped from dns_rpc_zone.

Signed-off-by: Timo Aaltonen <tjaalton@debian.org>
2023-03-20 11:23:41 +02:00
Petr Menšík
f435a334fe Minimal change to compile with BIND 9.18.11
DSCP codes are not working and their support were removed from BIND9. Do
not require them to be present.
2023-01-28 11:37:13 +01:00
Alexander Bokovoy
47902df23b Handle dns_db_allrdatasets() backports too
With https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/7189 the
changes were also backported to 9.16.36+ as well. Instead of checking
version, check if an additional define is present.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2023-01-16 12:34:49 +02:00
Alexander Bokovoy
00131b7b72 adopt to bind 9.18.9+ loggers
Fixes: https://pagure.io/bind-dyndb-ldap/issues/216

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2023-01-16 12:34:49 +02:00
Alexander Bokovoy
dc3a202aef Fix broken bind 9.18.10 build
bind 9.18.10 added use of isrwlock in dns/zt.h but did not include
isc/rwlock.h

Fixes: https://pagure.io/bind-dyndb-ldap/issues/216

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2023-01-16 11:08:25 +02:00
Alexander Bokovoy
5dd2fefa0b Support bind 9.18.10 or later
dns_db_allrdatasets() gained a new parameter. Adopt the code to allow
injecting 0 options if building against 9.18.10.

Fixes: https://pagure.io/bind-dyndb-ldap/issue/216

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2023-01-16 11:08:25 +02:00
Petr Menšík
7b4c1e28b3 Modify empty zone conflicts under exclusive mode
Does not accept new request when exclusive mode is active. Zone table
can be modified even after main fwd entries have been added. Ensure
empty zones handling keeps exclusive mode active.

Exclusive mode were mentioned as the only protection it had by bind
maintainer:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/6637#note_308928
2022-09-14 17:23:20 +02:00
Alexander Bokovoy
f71746a059 Release 11.10
Support BIND 9.17+

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2022-06-21 10:02:27 +03:00
Petr Menšík
fa16da22fc Move common dns_name_copynf compatibility macros to header
The same dns_name_copynf is required in multiple places. Because I have
already modified util.h to require dyndb-config.h, it can contain also
these compatibility defines in single place.

Signed-off-by: Petr Menšík <pemensik@redhat.com>
2022-02-24 01:51:39 +01:00
Petr Menšík
d28f8ef1ca Support for 9.18 and 9.17 support
Make dns_name_copynf alias to support both older and more recent
release. Initialize few other variables to pass new compiler warnings.
Remove few changed functions in database interface.
2022-02-22 17:52:07 +01:00
Petr Menšík
7206aba205 Add basic support of dns_ssuruletype_t
dns_ssutable_addrule changed input types. Add very basic support for the
new type, without support for parsing actual rule string including max
count.
2022-02-22 17:09:36 +01:00
Petr Menšík
056d2e2b54 Initial support for BIND 9.18 support
Some changes needed to build with the most recent BIND9 release. It does
not yet provide complete support for new release.

Detects version of libdns just from libdns.so symlink. It requires
--libdir= explicitly set for this part to work.
2022-01-30 21:10:13 +01:00
Petr Menšík
d7d3032de7 Skip isc_bind9 check on BIND 9.16.17+
Reference variable refvar from dns_dyndbctx_t were removed. Removed was
also flag requesting different namespace. Skip that check on last stable
version, it should eval to false on all versions anyway.
2021-06-17 17:57:52 +02:00
Alexander Bokovoy
63df41c8bc Release 11.9: support bind 9.16.16+
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2021-05-25 17:18:53 +03:00
Petr Menšík
956f1f761f Reduce passing tasks in zones activation
They are never used from passed parameters, so do not forward them into
multiple functions. Ignore them on task endpoint where they always have
to be.
2021-05-21 11:40:59 +02:00
Petr Menšík
55ea24d66e Remove ISCAPI_TASK_VALID checks
Recent BIND 9.16.16 has hidden task structure and public checks. It
still checks task validity in each isc_task_* function, which we use for
working with tasks. No lesser checking would be done.

isc_mem_t still has them, but they were removed in 9.17. Remove those
checks as well, work with them just structure undefined pointers. Rely
on bind9 library to check them.
2021-05-21 11:40:57 +02:00
Alexander Bokovoy
afdabc71c5 Fix zone and forwarder registers to include dyndb-config.h
They kept includes for BIND's config.h which is not needed.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2021-05-14 11:38:47 +03:00
Sergio Durigan Junior
859f339999 Fix FTBFS when building with OpenLDAP 2.5
The new version of OpenLDAP (2.5) exports the 'ldap_connect' symbol,
which conflicts with the function with the same name that is being
defined and used in src/ldap_helper.c:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -Werror -std=gnu99 -O2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fvisibility=hidden -fno-delete-null-pointer-checks -c ../../src/ldap_entry.c  -fPIC -DPIC -o .libs/ldap_la-ldap_entry.o
../../src/ldap_helper.c:343:21: error: conflicting types for ‘ldap_connect’
  343 | static isc_result_t ldap_connect(ldap_instance_t *ldap_inst,
      |                     ^~~~~~~~~~~~
In file included from ../../src/ldap_helper.c:52:
/usr/include/ldap.h:1554:1: note: previous declaration of ‘ldap_connect’ was here
 1554 | ldap_connect( LDAP *ld );
      | ^~~~~~~~~~~~

This commit fixes this FTBFS by renaming the 'ldap_connect' function
to 'bdl_ldap_connect'.  While at it, it also renames the
'ldap_reconnect' function to 'bdl_ldap_reconnect'.

Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
2021-05-11 17:33:03 -04:00
Alexander Bokovoy
194b6e9f26 Release 11.8: support bind 9.16.13+
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2021-05-04 20:42:59 +03:00
Alexander Bokovoy
de11d3aed8 Merge #204 Fix license note on README. 2021-04-13 15:02:50 +00:00
Rafael Guterres Jeffman
692621c189 Fix license note on README.
In README it said that bind-dyndb-ldap could only be redistributed
under GPLv2 only, but in the licence file (COPYING) it is stated
that it is "version 2 or later".

This fixes the README to be consistent with the COPYING notice.
2021-04-13 11:50:49 -03:00
Alexander Bokovoy
c4144e0b83 Rename local config.h to dyndb-config.h
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2021-04-06 11:23:15 +03:00
Alexander Bokovoy
402ea220ef Update version to 11.7
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2021-04-06 11:22:35 +03:00
Petr Menšík
1d03c1e5b2 rwlock initialization does not return value
API has changed, it no longer returns a value in isc_rwlock_init.
It returned always ISC_SUCCCESS on 9.16 anyway, so skip the check
on every 9.16 build.
2021-03-26 14:05:56 +01:00
Petr Menšík
f0d75b778e Add support for dns library without libinterface
BIND 9.16.12 and more recent have removed numeric versioning of library.
Instead it just contain complete text version. Extract numbers from it
and export it in similar manner.
2021-03-26 14:05:56 +01:00
Petr Menšík
f4aec4d374 Yet another change to support BIND 9.16.11 API change
Another change with another release, new parameter is added again.
Add another ifdef to keep compatibility with both versions.
2021-01-21 17:30:54 +01:00
Petr Menšík
2ddd4bf55e Add compatibility with BIND 9.16.10 API change
One parameter was added to function used internally by plugin. Nothing
like -nsec3param auto is supported by LDAP plugin. It is safe to set
resalt false always. Salt can be changed via LDAP, but has to be
specified manually.
2021-01-11 21:39:25 +01:00
Petr Mensik
2a732bb038 Support BIND 9.16.9
Two new functions were added to database interface. They are more
related to caching server and not authoritative. Add just null pointers,
returning not supporter error if used.
2020-11-26 17:33:42 +01:00
Alexander Bokovoy
443dce8a51 Update version to 11.6
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2020-11-23 15:58:09 +02:00
Alexander Bokovoy
4d906bdfcc Use correct final reference counter value for 9.11 and 9.16
With the commit 542096278b, reference
counting uses C11 semantics due to

    bind-9.16: Correct reference counting

    With [0] BIND atomic functions for reference counting have the
    identical interface as their C11 counter parts. This means that
    these functions return the _previous_ refcount instead of the
    current one.

    [0]: bef8ac5bae

Since the same code is compiled for both 9.11 and 9.16, we need to make
sure the logic to detect final reference counter value in destructors
follows two different reference counting interface semantics.

Define REFCOUNT_FLOOR to help with that depending on the libdns major
version.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1899744

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2020-11-23 15:49:56 +02:00
Alexander Bokovoy
afb91b7160 Update version to 11.5
Fix bind 9.16 detection code.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2020-09-21 14:40:31 +03:00
Petr Menšík
20127e8276 Include config.h in all files using LIBDNS_VERSION_MAJOR
Did not know compiler replaces unknown symbols with 0. It made the check
silently evaluate to false on every BIND version, regardless detected
libdns version number. Generated code failing runtime with BIND 9.16.

Signed-off-by: Petr Menšík <pemensik@redhat.com>
2020-09-21 10:58:33 +02:00
Alexander Bokovoy
a7af6b56b4 Update version to 11.4
Includes experimental support to build against both bind 9.11 and 9.16.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2020-09-14 18:14:20 +03:00
Alexander Bokovoy
67b2558af9 Fix memory limits in docker-compose to use strings, not numbers
docker-compose with commit 2b4d409ac3
started to require memory limits to be specified as strings.

Related: https://pagure.io/freeipa/issue/8494
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2020-09-14 16:22:13 +03:00
Alexander Bokovoy
13409382ae spec: support building against bind 9.16
Signed-off-by: Petr Menšík <pemensik@redhat.com>
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2020-09-02 14:30:19 +03:00
Alexander Bokovoy
79474061d5 spec: add gcc explicitly to build requirements
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
2020-09-02 11:47:51 +03:00
Petr Menšík
31ad57de37 Sync db interface with BIND 9.16.6
Add new method of db.h into ldap_driver. Just forward it to rbtdb
implementation detail.
2020-09-02 11:30:28 +03:00
Petr Menšík
43f0d27d78 Remove locked variable when it has no alternatives
No conditions allow different value when checked. Remove unnecessary
variables.
2020-09-02 11:30:27 +03:00
Petr Menšík
c2c137425b Change REQUIRE to match ISC code style
REQUIRE should follow variables definitions.
2020-09-02 11:30:26 +03:00
Petr Menšík
6eaf1f7884 Return back resetting of detached pointer 2020-09-02 11:30:25 +03:00
Petr Menšík
2bc70d6a40 Attempt to support both BIND 9.11 and 9.16
Use LIBDNS_VERSION_MAJOR compatibility macro to provide
few workarounds to compile even with 9.11. Try to minimize
changes of public API, but not everywhere it was possible.

ldapdb_associate should be moved back to header, but it would require
header modified on configure time.
2020-09-02 11:30:23 +03:00
Stanislav Levin
911802185d bind-9.16: isc_event_allocate cannot fail gracefully now
isc_event_allocate internally uses isc_mem_get which cannot
return NULL. So NULL-check is redundant.

sync_barrierev_create and sync_finishev_create are always
successful(except fatals which abort).

https://gitlab.isc.org/isc-projects/bind9/-/commit/50e109d659
2020-09-02 11:30:20 +03:00
Stanislav Levin
8e53c80b01 bind-9.16: Clean up outdated static assertions
_Static_assert is a compile time assertion which is the part of
ISO C11 and is implemented in GCC since 4.6.

So, macros taken from [0] is no longer needed.

[0]: https://www.pixelbeat.org/programming/gcc/static_assert.html
2020-09-02 11:29:46 +03:00
Stanislav Levin
5fb71812c9 bind-9.16: isc_mem_strdup cannot fail gracefully now
Since [0] malloc is handled directly in default_memalloc and
it aborts on NULL pointer result. Further check is no longer
needed. Thus, isc_mem_strdup based macro can be safely removed [1].

[0]: https://gitlab.isc.org/isc-projects/bind9/-/commit/8de2451756
[1]: https://gitlab.isc.org/isc-projects/bind9/-/commit/49f244406c
     https://gitlab.isc.org/isc-projects/bind9/-/commit/9bdc24a9fd
2020-09-02 11:29:45 +03:00
Stanislav Levin
64066396cd bind-9.16: isc_mem_allocate cannot fail gracefully now
Since [0] malloc is handled directly in default_memalloc and
it aborts on NULL pointer result. Further check is no longer
needed. Thus, isc_mem_allocate based macro can be safely removed [1].

[0]: https://gitlab.isc.org/isc-projects/bind9/-/commit/8de2451756
[1]: https://gitlab.isc.org/isc-projects/bind9/-/commit/3c1d4298af
     https://gitlab.isc.org/isc-projects/bind9/-/commit/601cb4e4cc
2020-09-02 11:29:43 +03:00
Stanislav Levin
ee1d0f50bc bind-9.16: isc_mem_get cannot fail gracefully now
Since [0] malloc is handled directly in default_memalloc and
it aborts on NULL pointer result. Further check is no longer
needed. Thus, isc_mem_get based macro can be safely removed [1].

[0]: https://gitlab.isc.org/isc-projects/bind9/-/commit/8de2451756
[1]: https://gitlab.isc.org/isc-projects/bind9/-/commit/f63e696967
     https://gitlab.isc.org/isc-projects/bind9/-/commit/ae83801e2b
2020-09-02 11:29:42 +03:00
Stanislav Levin
7aa8eeafae bind-9.16: Don't re-initialize hash in BIND-only mode
That has been done by named server.

This is the backport of
2e7d82443f
2020-09-02 11:29:39 +03:00