#217 Support bind 9.18.10 or later
Merged 8 months ago by abbra. Opened 8 months ago by abbra.
abbra/bind-dyndb-ldap bind-9-18-10-support  into  master

file modified
+4 -3
@@ -465,13 +465,14 @@ 

  

  static isc_result_t

  allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,

- 	     isc_stdtime_t now, dns_rdatasetiter_t **iteratorp)

+ 	     DNS_DB_ALLRDATASETS_OPTIONS(unsigned int options, isc_stdtime_t now),

+ 	     dns_rdatasetiter_t **iteratorp)

  {

  	ldapdb_t *ldapdb = (ldapdb_t *) db;

  

  	REQUIRE(VALID_LDAPDB(ldapdb));

  

- 	return dns_db_allrdatasets(ldapdb->rbtdb, node, version, now, iteratorp);

+ 	return dns_db_allrdatasets(ldapdb->rbtdb, node, version, DNS_DB_ALLRDATASETS_OPTIONS(options, now), iteratorp);

  }

  

  /* TODO: Add 'tainted' flag to the LDAP instance if something went wrong. */
@@ -514,7 +515,7 @@ 

  

  	CHECK(ldapdb_name_fromnode(node, dns_fixedname_initname(&fname)));

  

- 	result = dns_db_allrdatasets(db, node, version, now, &rds_iter);

+ 	result = dns_db_allrdatasets(db, node, version, DNS_DB_ALLRDATASETS_OPTIONS(0, now), &rds_iter);

  	if (result == ISC_R_NOTFOUND) {

  		*isempty = true;

  	} else if (result == ISC_R_SUCCESS) {

file modified
+6 -10
@@ -1317,8 +1317,7 @@ 

  			dns_zone_logc(zone, DNS_LOGCATEGORY_SECURITY, ISC_LOG_CRITICAL,

  				      "cannot configure restrictive %s policy: %s",

  				      type_txt, isc_result_totext(result2));

- 			FATAL_ERROR(__FILE__, __LINE__,

- 				    "insecure state detected");

+ 			fatal_error("insecure state detected");

  		}

  	}

  	acl_setter(zone, acl);
@@ -1365,8 +1364,7 @@ 

  			dns_zone_logc(zone, DNS_LOGCATEGORY_SECURITY, ISC_LOG_CRITICAL,

  				      "cannot disable all updates: %s",

  				      isc_result_totext(result2));

- 			FATAL_ERROR(__FILE__, __LINE__,

- 				    "insecure state detected");

+ 			fatal_error("insecure state detected");

  		}

  	}

  
@@ -2005,7 +2003,7 @@ 

  				 zone_settings, &rdatalist));

  

  	CHECK(dns_db_getoriginnode(rbtdb, &node));

- 	result = dns_db_allrdatasets(rbtdb, node, version, 0,

+ 	result = dns_db_allrdatasets(rbtdb, node, version, DNS_DB_ALLRDATASETS_OPTIONS(0, 0),

  				     &rbt_rds_iterator);

  	if (result == ISC_R_SUCCESS) {

  		CHECK(diff_ldap_rbtdb(inst->mctx, &name, &rdatalist,
@@ -2951,8 +2949,7 @@ 

  						   ldap_inst);

  		break;

  	case AUTH_INVALID:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

- 				"invalid auth_method_enum value %u",

+ 		unexpected_error("invalid auth_method_enum value %u",

  				 auth_method_enum);

  		break;

  
@@ -3782,8 +3779,7 @@ 

  		else if (entry->class & LDAP_ENTRYCLASS_FORWARD)

  			CHECK(ldap_parse_fwd_zoneentry(entry, inst));

  		else

- 			FATAL_ERROR(__FILE__, __LINE__,

- 				    "update_zone: unexpected entry class");

+ 			fatal_error("update_zone: unexpected entry class");

  	}

  

  cleanup:
@@ -3929,7 +3925,7 @@ 

  	CHECK(dns_db_newversion(ldapdb, &version));

  

  	CHECK(dns_db_findnode(rbtdb, &entry->fqdn, true, &node));

- 	result = dns_db_allrdatasets(rbtdb, node, version, 0, &rbt_rds_iterator);

+ 	result = dns_db_allrdatasets(rbtdb, node, version, DNS_DB_ALLRDATASETS_OPTIONS(0, 0), &rbt_rds_iterator);

  	if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND)

  		goto cleanup;

  

file modified
+9
@@ -17,8 +17,17 @@ 

  #define GET_LOG_LEVEL(level)	(level)

  #endif

  

+ #if LIBDNS_VERSION_MAJOR >= 1809

+ #define fatal_error(...) \

+ 	isc_error_fatal(__FILE__, __LINE__, __func__, __VA_ARGS__)

+ #define unexpected_error(...) \

+ 	isc_error_unexpected(__FILE__, __LINE__, __func__, __VA_ARGS__)

+ #else

  #define fatal_error(...) \

  	isc_error_fatal(__FILE__, __LINE__, __VA_ARGS__)

+ #define unexpected_error(...) \

+ 	isc_error_unexpected(__FILE__, __LINE__, __VA_ARGS__)

+ #endif

  

  #define log_bug(fmt, ...) \

  	log_error("bug in %s(): " fmt, __func__,##__VA_ARGS__)

file modified
+2 -1
@@ -217,7 +217,8 @@ 

  	node = *nodep;

  

  	dns_rdataset_init(&rdataset);

- 	CHECK(dns_db_allrdatasets(node->rbtdb, node->dbnode, node->version, 0,

+ 	CHECK(dns_db_allrdatasets(node->rbtdb, node->dbnode, node->version,

+ 				  DNS_DB_ALLRDATASETS_OPTIONS(0, 0),

  				  &iter));

  

  	for (result = dns_rdatasetiter_first(iter);

file modified
+4 -8
@@ -178,8 +178,7 @@ 

  		*(bool *)target = setting->value.value_boolean;

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

- 				 "invalid setting_type_t value %u", type);

+ 		unexpected_error("invalid setting_type_t value %u", type);

  		break;

  	}

  
@@ -278,8 +277,7 @@ 

  			CLEANUP_WITH(ISC_R_IGNORE);

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

- 				 "invalid setting_type_t value %u", setting->type);

+ 		unexpected_error("invalid setting_type_t value %u", setting->type);

  		break;

  	}

  
@@ -304,8 +302,7 @@ 

  		setting->value.value_boolean = numeric_value;

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

- 				 "invalid setting_type_t value %u", setting->type);

+ 		unexpected_error("invalid setting_type_t value %u", setting->type);

  		break;

  	}

  	setting->filled = 1;
@@ -389,8 +386,7 @@ 

  	case ST_BOOLEAN:

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

- 				 "invalid setting_type_t value %u", setting->type);

+ 		unexpected_error("invalid setting_type_t value %u", setting->type);

  		break;

  	}

  	setting->filled = 0;

file modified
+2 -4
@@ -148,8 +148,7 @@ 

  		case sync_datainit:

  		case sync_finished:

  		default:

- 			FATAL_ERROR(__FILE__, __LINE__,

- 				    "sync_barrier_wait(): invalid state "

+ 			fatal_error("sync_barrier_wait(): invalid state "

  				    "%u", bev->sctx->state);

  	}

  	sync_state_change(bev->sctx, new_state, false);
@@ -518,8 +517,7 @@ 

  		case sync_databarrier:

  		case sync_finished:

  		default:

- 			FATAL_ERROR(__FILE__, __LINE__,

- 				    "sync_barrier_wait(): invalid state "

+ 			fatal_error("sync_barrier_wait(): invalid state "

  				    "%u", sctx->state);

  	}

  

file modified
+7
@@ -13,6 +13,7 @@ 

  #include <dns/types.h>

  #include <dns/name.h>

  #include <dns/result.h>

+ #include <dns/db.h>

  

  #include "log.h"

  #include "dyndb-config.h"
@@ -29,6 +30,12 @@ 

  #define dns_name_copynf(src, dst) dns_name_copy((src), (dst))

  #endif

  

+ #ifdef DNS_DB_STALEOK

+ #define DNS_DB_ALLRDATASETS_OPTIONS(options, tstamp) options, tstamp

+ #else

+ #define DNS_DB_ALLRDATASETS_OPTIONS(options, tstamp) tstamp

+ #endif

+ 

  #define CLEANUP_WITH(result_code)				\

  	do {							\

  		result = (result_code);				\

file modified
+1
@@ -5,6 +5,7 @@ 

  #ifndef _LD_ZONE_REGISTER_H_

  #define _LD_ZONE_REGISTER_H_

  

+ #include <isc/rwlock.h>

  #include <dns/zt.h>

  

  #include "settings.h"

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

1 new commit added

  • Fix broken bind 9.18.10 build
8 months ago

rebased onto 86d9b94f72b13f12e3bbfa855c3c557d0fba6ab7

8 months ago

1 new commit added

  • adopt to bind 9.18.10+ loggers
8 months ago

3 new commits added

  • adopt to bind 9.18.10+ loggers
  • Fix broken bind 9.18.10 build
  • Support bind 9.18.10 or later
8 months ago
  • dns_db_allrdatasets change affects bind 9.16.36

1 new commit added

  • Handle dns_db_allrdatasets() backports too
8 months ago

dns_db_allrdatasets was not fixed in src/ldap_helper.c.

@slev could you please try the additional patch and tell me if that is enough?

rebased onto 5dd2fef

8 months ago

@slev I updated "Support bind 9.18.10 or later" patch to add src/ldap_helper.c fixes.

@abbra, thank you! Build passed against bind 9.16.35 and bind 9.16.36.

Loggers' changes requires bind 9.18.9+ (not 9.18.10):
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/6914

4 new commits added

  • Handle dns_db_allrdatasets() backports too
  • adopt to bind 9.18.9+ loggers
  • Fix broken bind 9.18.10 build
  • Support bind 9.18.10 or later
8 months ago

Great, thank you. I put 1809 instead.

Created PR https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/7376 on BIND9 side, because I think the rwlock.h issue should be handled there.

Pull-Request has been merged by abbra

8 months ago

Thank you, merged.

@pemensik I'll merge the patch for rwlock.h anyway as it would allow us to build against currently released bind9 versions.

Sure, those changes do not conflict, why not.