mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
Fix a kasp lock issue
The kasp lock would stay locked if 'dns_keymgr_run' failed.
This commit is contained in:
@@ -19971,22 +19971,20 @@ zone_rekey(dns_zone_t *zone) {
|
|||||||
isc_result_totext(result));
|
isc_result_totext(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kasp != NULL &&
|
|
||||||
(result == ISC_R_SUCCESS || result == ISC_R_NOTFOUND)) {
|
|
||||||
result = dns_keymgr_run(&zone->origin, zone->rdclass, dir, mctx,
|
|
||||||
&keys, kasp, now, &nexttime);
|
|
||||||
if (result != ISC_R_SUCCESS) {
|
|
||||||
if (kasp != NULL) {
|
|
||||||
UNLOCK(&kasp->lock);
|
|
||||||
}
|
|
||||||
dnssec_log(zone, ISC_LOG_ERROR,
|
|
||||||
"zone_rekey:dns_dnssec_keymgr failed: %s",
|
|
||||||
isc_result_totext(result));
|
|
||||||
goto failure;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kasp != NULL) {
|
if (kasp != NULL) {
|
||||||
|
if (result == ISC_R_SUCCESS || result == ISC_R_NOTFOUND) {
|
||||||
|
result = dns_keymgr_run(&zone->origin, zone->rdclass,
|
||||||
|
dir, mctx, &keys, kasp, now,
|
||||||
|
&nexttime);
|
||||||
|
if (result != ISC_R_SUCCESS) {
|
||||||
|
dnssec_log(zone, ISC_LOG_ERROR,
|
||||||
|
"zone_rekey:dns_dnssec_keymgr "
|
||||||
|
"failed: %s",
|
||||||
|
isc_result_totext(result));
|
||||||
|
UNLOCK(&kasp->lock);
|
||||||
|
goto failure;
|
||||||
|
}
|
||||||
|
}
|
||||||
UNLOCK(&kasp->lock);
|
UNLOCK(&kasp->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20343,6 +20341,10 @@ failure:
|
|||||||
* Something went wrong; try again in ten minutes or
|
* Something went wrong; try again in ten minutes or
|
||||||
* after a key refresh interval, whichever is shorter.
|
* after a key refresh interval, whichever is shorter.
|
||||||
*/
|
*/
|
||||||
|
dnssec_log(zone, ISC_LOG_DEBUG(3),
|
||||||
|
"zone_rekey failure: %s (retry in %u seconds)",
|
||||||
|
isc_result_totext(result),
|
||||||
|
ISC_MIN(zone->refreshkeyinterval, 600));
|
||||||
isc_interval_set(&ival, ISC_MIN(zone->refreshkeyinterval, 600),
|
isc_interval_set(&ival, ISC_MIN(zone->refreshkeyinterval, 600),
|
||||||
0);
|
0);
|
||||||
isc_time_nowplusinterval(&zone->refreshkeytime, &ival);
|
isc_time_nowplusinterval(&zone->refreshkeytime, &ival);
|
||||||
|
Reference in New Issue
Block a user