#215 Support for BIND 9.18.9+
Closed a year ago by pemensik. Opened a year ago by pemensik.
pemensik/bind-dyndb-ldap bind-9.18.9-support  into  master

file modified
+5 -9
@@ -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");

  		}

  	}

  
@@ -2951,9 +2949,8 @@ 

  						   ldap_inst);

  		break;

  	case AUTH_INVALID:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

- 				"invalid auth_method_enum value %u",

- 				 auth_method_enum);

+ 		DYNDB_UNEXPECTED_ERROR("invalid auth_method_enum value %u",

+ 				       auth_method_enum);

  		break;

  

  	default:
@@ -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:

file modified
+5
@@ -17,8 +17,13 @@ 

  #define GET_LOG_LEVEL(level)	(level)

  #endif

  

+ #if LIBDNS_VERSION_MAJOR < 1809

  #define fatal_error(...) \

  	isc_error_fatal(__FILE__, __LINE__, __VA_ARGS__)

+ #else

+ #define fatal_error(...) \

+ 	isc_error_fatal(__FILE__, __LINE__, __func__, __VA_ARGS__)

+ #endif

  

  #define log_bug(fmt, ...) \

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

file modified
+8 -8
@@ -17,6 +17,7 @@ 

  #include <string.h>

  #include <strings.h>

  

+ #include "dyndb-config.h"

  #include "log.h"

  #include "settings.h"

  #include "str.h"
@@ -24,7 +25,6 @@ 

  #include "types.h"

  #include "ldap_helper.h"

  #include "zone_register.h"

- #include "dyndb-config.h"

  

  #if LIBDNS_VERSION_MAJOR < 1600

  #define cfg_parse_buffer cfg_parse_buffer4
@@ -178,7 +178,7 @@ 

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

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

+ 		DYNDB_UNEXPECTED_ERROR(

  				 "invalid setting_type_t value %u", type);

  		break;

  	}
@@ -278,8 +278,8 @@ 

  			CLEANUP_WITH(ISC_R_IGNORE);

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

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

+ 		DYNDB_UNEXPECTED_ERROR("invalid setting_type_t value %u",

+ 				       setting->type);

  		break;

  	}

  
@@ -304,8 +304,8 @@ 

  		setting->value.value_boolean = numeric_value;

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

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

+ 		DYNDB_UNEXPECTED_ERROR("invalid setting_type_t value %u",

+ 				       setting->type);

  		break;

  	}

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

  	case ST_BOOLEAN:

  		break;

  	default:

- 		UNEXPECTED_ERROR(__FILE__, __LINE__,

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

+ 		DYNDB_UNEXPECTED_ERROR("invalid setting_type_t value %u",

+ 				       setting->type);

  		break;

  	}

  	setting->filled = 0;

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

  

  #include "dyndb-config.h"

  #include "ldap_helper.h"

+ #include "log.h"

  #include "util.h"

  #include "semaphore.h"

  #include "syncrepl.h"
@@ -148,8 +149,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 +518,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
+9 -1
@@ -14,8 +14,8 @@ 

  #include <dns/name.h>

  #include <dns/result.h>

  

- #include "log.h"

  #include "dyndb-config.h"

+ #include "log.h"

  

  extern bool verbose_checks; /* from settings.c */

  
@@ -29,6 +29,14 @@ 

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

  #endif

  

+ #if LIBDNS_VERSION_MAJOR < 1809

+ #  define DYNDB_UNEXPECTED_ERROR(...) \

+ 	isc_error_unexpected(__FILE__, __LINE__, __VA_ARGS__)

+ #else

+ #  define DYNDB_UNEXPECTED_ERROR(...) \

+ 	isc_error_unexpected(__FILE__, __LINE__, __func__, __VA_ARGS__)

+ #endif

+ 

  #define CLEANUP_WITH(result_code)				\

  	do {							\

  		result = (result_code);				\

Bind headers changed isc_error_fatal function. Also UNEXPECTED_ERROR
from util.h has changed function signature. Use a conditional
to provide compatibility for both new and previous versions.

It might make sense to unify reporting fatal_error and DYNDB_UNEXPECTED_ERROR styles. Not sure which is more correct to choose.

@pemensik,
I have added a similar PR#217 which also has few more fixes to 9.18.10+ problems. I'll close this one and take that instead, if you aren't against.

Pull-Request has been closed by pemensik

a year ago