Skip to content

Commit ab1bb38

Browse files
author
A. Täffner
committed
DNSSEC-Switch: Don't want to leave junk back if dnssec was enabled and got disabled now
1 parent e3fa3d4 commit ab1bb38

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

server/plugins-available/bind_plugin.inc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,17 @@ function soa_update($event_name, $data) {
153153
}
154154
if ($data['new']['dnssec_wanted'] == 'Y' AND $data['new']['dnssec_initialized'] == 'N') if ($data['new']['dnssec_wanted'] == 'Y') exec('/usr/local/ispconfig/server/scripts/dnssec-create.sh '.escapeshellcmd($data['new']['origin'])); //Create new keys for new origin
155155
else if ($data['old']['dnssec_wanted'] == 'Y') exec('/usr/local/ispconfig/server/scripts/dnssec-update.sh '.escapeshellcmd($data['new']['origin']));
156+
if($data['old']['dnssec_initialized'] == 'Y' && $data['new']['dnssec_wanted'] == 'N') { //delete old signed file if dnssec is no longer wanted
157+
//TODO : change this when distribution information has been integrated into server record
158+
if (file_exists('/etc/gentoo-release')) {
159+
$filename = $dns_config['bind_zonefiles_dir'].'/pri/'.str_replace("/", "_", substr($data['old']['origin'], 0, -1));
160+
}
161+
else {
162+
$filename = $dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($data['old']['origin'], 0, -1));
163+
}
164+
if(is_file($filename.'.signed')) unlink($filename.'.signed');
165+
}
166+
// END DNSSEC
156167

157168
//* rebuild the named.conf file if the origin has changed or when the origin is inserted.
158169
//if($this->action == 'insert' || $data['old']['origin'] != $data['new']['origin']) {

0 commit comments

Comments
 (0)