From 1f72f1c7fa681aa8701c6568d481c9989293627a Mon Sep 17 00:00:00 2001 From: Petr Menšík Date: Jul 19 2018 10:40:43 +0000 Subject: [PATCH 1/3] Support for BIND 9.11.3. Include explicitly isc/util.h in each file that uses REQUIRE(). Support stdatomic feature, do not use function call in STATIC_ASSERT(). --- diff --git a/src/bindcfg.c b/src/bindcfg.c index 9b429ba..5539dea 100644 --- a/src/bindcfg.c +++ b/src/bindcfg.c @@ -6,6 +6,7 @@ #include "config.h" +#include #include #include diff --git a/src/fwd_register.c b/src/fwd_register.c index 355d15f..7cc0c5a 100644 --- a/src/fwd_register.c +++ b/src/fwd_register.c @@ -3,6 +3,7 @@ */ #include +#include #include #include "rbt_helper.h" diff --git a/src/ldap_entry.h b/src/ldap_entry.h index 6498c79..88b1c42 100644 --- a/src/ldap_entry.h +++ b/src/ldap_entry.h @@ -6,7 +6,6 @@ #define _LD_LDAP_ENTRY_H_ #include -#include #include #include "fwd_register.h" @@ -19,15 +18,15 @@ /* Represents values associated with LDAP attribute */ typedef struct ldap_value ldap_value_t; -typedef LIST(ldap_value_t) ldap_valuelist_t; +typedef ISC_LIST(ldap_value_t) ldap_valuelist_t; struct ldap_value { char *value; - LINK(ldap_value_t) link; + ISC_LINK(ldap_value_t) link; }; /* Represents LDAP attribute and it's values */ typedef struct ldap_attribute ldap_attribute_t; -typedef LIST(ldap_attribute_t) ldap_attributelist_t; +typedef ISC_LIST(ldap_attribute_t) ldap_attributelist_t; /* Represents LDAP entry and it's attributes */ typedef unsigned char ldap_entryclass_t; @@ -41,7 +40,7 @@ struct ldap_entry { ldap_attribute_t *lastattr; ldap_attributelist_t attrs; - LINK(ldap_entry_t) link; + ISC_LINK(ldap_entry_t) link; /* Parsing. */ isc_lex_t *lex; @@ -59,7 +58,7 @@ struct ldap_attribute { char **ldap_values; ldap_value_t *lastval; ldap_valuelist_t values; - LINK(ldap_attribute_t) link; + ISC_LINK(ldap_attribute_t) link; }; #define LDAP_ENTRYCLASS_NONE 0x0 diff --git a/src/mldap.c b/src/mldap.c index 143abce..304ba36 100644 --- a/src/mldap.c +++ b/src/mldap.c @@ -119,13 +119,13 @@ void mldap_cur_generation_bump(mldapdb_t *mldap) { * reference counter value. */ STATIC_ASSERT((isc_uint32_t) - (typeof(isc_refcount_current((isc_refcount_t *)0))) + (typeof(((isc_refcount_t *)0)->refs)) -1 == 0xFFFFFFFF, \ "negative isc_refcount_t cannot be properly shortened to 32 bits"); STATIC_ASSERT((isc_uint32_t) - (typeof(isc_refcount_current((isc_refcount_t *)0))) + (typeof(((isc_refcount_t *)0)->refs)) 0x90ABCDEF12345678 == 0x12345678, \ "positive isc_refcount_t cannot be properly shortened to 32 bits"); diff --git a/src/rbt_helper.c b/src/rbt_helper.c index 2a7e6cb..f610b07 100644 --- a/src/rbt_helper.c +++ b/src/rbt_helper.c @@ -2,6 +2,7 @@ * Copyright (C) 2013-2014 bind-dyndb-ldap authors; see COPYING for license */ +#include #include #include "util.h" diff --git a/src/types.h b/src/types.h index 25ef3b9..01d627c 100644 --- a/src/types.h +++ b/src/types.h @@ -24,7 +24,7 @@ * rdata1 -> rdata2 -> rdata3 rdata4 -> rdata5 * next_rdatalist -> next_rdatalist ... */ -typedef LIST(dns_rdatalist_t) ldapdb_rdatalist_t; +typedef ISC_LIST(dns_rdatalist_t) ldapdb_rdatalist_t; typedef struct enum_txt_assoc { int value; From f8d045b225b54e23b904f65401d59720a7964aaa Mon Sep 17 00:00:00 2001 From: Petr Menšík Date: Jan 27 2019 23:31:55 +0000 Subject: [PATCH 2/3] Adjust to changes in bind 9.11.5 Custom types like isc_boolean_t and isc_uint32_t were removed from bind headers. Compatibility headers are included, but have to be manually used. Better change would be to start using uint32_t and bool types, but that changes too much of code for now. Signed-off-by: Petr Menšík --- diff --git a/src/fwd.c b/src/fwd.c index 840f0e8..f1ab60c 100644 --- a/src/fwd.c +++ b/src/fwd.c @@ -6,6 +6,8 @@ #include "config.h" +#include + #include #include diff --git a/src/ldap_entry.c b/src/ldap_entry.c index 96a6ef8..00a7e89 100644 --- a/src/ldap_entry.c +++ b/src/ldap_entry.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/src/ldap_helper.c b/src/ldap_helper.c index 9e0174a..ac8ce6e 100644 --- a/src/ldap_helper.c +++ b/src/ldap_helper.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/src/ldap_helper.h b/src/ldap_helper.h index 6cfece5..fc21bb3 100644 --- a/src/ldap_helper.h +++ b/src/ldap_helper.h @@ -7,6 +7,7 @@ #include "types.h" +#include #include #include #include diff --git a/src/mldap.c b/src/mldap.c index 304ba36..8b90921 100644 --- a/src/mldap.c +++ b/src/mldap.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/src/settings.h b/src/settings.h index 16a1e63..6585d8b 100644 --- a/src/settings.h +++ b/src/settings.h @@ -6,6 +6,8 @@ #define _LD_SETTINGS_H_ #include +#include +#include #include diff --git a/src/types.h b/src/types.h index 01d627c..41ef476 100644 --- a/src/types.h +++ b/src/types.h @@ -5,7 +5,9 @@ #ifndef _LD_TYPES_H_ #define _LD_TYPES_H_ +#include #include +#include #include #include diff --git a/src/zone.c b/src/zone.c index 284136e..b9c9936 100644 --- a/src/zone.c +++ b/src/zone.c @@ -2,6 +2,7 @@ * Copyright (C) 2014-2015 bind-dyndb-ldap authors; see COPYING for license */ +#include #include #include From d69150691983f7f1efaa078549cd80a14afb76cb Mon Sep 17 00:00:00 2001 From: Petr Menšík Date: Jan 27 2019 23:32:02 +0000 Subject: [PATCH 3/3] Use correct dn value New GCC correctly reports error, NULL is always passed in case of invalid objectclass. Signed-off-by: Petr Menšík --- diff --git a/src/ldap_helper.c b/src/ldap_helper.c index ac8ce6e..8b486ae 100644 --- a/src/ldap_helper.c +++ b/src/ldap_helper.c @@ -4102,7 +4102,6 @@ syncrepl_update(ldap_instance_t *inst, ldap_entry_t **entryp, int chgtype) ldap_entry_t *entry = NULL; dns_name_t *zone_name = NULL; dns_zone_t *zone_ptr = NULL; - char *dn = NULL; isc_taskaction_t action = NULL; isc_task_t *task = NULL; isc_boolean_t synchronous; @@ -4156,7 +4155,7 @@ syncrepl_update(ldap_instance_t *inst, ldap_entry_t **entryp, int chgtype) else if ((entry->class & LDAP_ENTRYCLASS_RR) != 0) action = update_record; else { - log_error("unsupported objectClass: dn '%s'", dn); + log_error("unsupported objectClass: dn '%s'", entry->dn); result = ISC_R_NOTIMPLEMENTED; goto cleanup; }