Skip to content

Commit 13b62b9

Browse files
author
A. Täffner
committed
removed absolute paths
This is a considered as stable stable release. (tested the workflow successfully) Note: I am not perfect at RegEx I know the RegEx for LOC- and DS-Records is actually not checking. The DS-Regex is definitely valid (tested on regexpal). Along with my dns-status modification this should not be a problem at all.
1 parent ea69239 commit 13b62b9

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

interface/web/dns/form/dns_ds.tform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@
102102
'width' => '5',
103103
'maxlength' => '5'
104104
),
105-
'data' => array ( //TODO Regex validation does not take place obviously
105+
'data' => array ( //TODO Regex validation does not take place obviously - why ever...
106106
'datatype' => 'VARCHAR',
107107
'formtype' => 'TEXT',
108108
'validators' => array (
109109
0 => array (
110110
'type' => 'REGEX',
111-
'regex' => "/^\d{1,5}\s\d{1,2}\s\d{1,2}\s.+$/s",
111+
'regex' => "/^\d{1,5}\s\d{1,2}\s\d{1,2}\s.+$/",
112112
'errmsg'=> 'invalid_type_ds'
113113
)
114114
),

interface/web/dns/form/dns_loc.tform.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@
110110
'type' => 'NOTEMPTY',
111111
'errmsg'=> 'data_error_empty'
112112
),
113-
1 => array (
114-
'type' => 'REGEX',
115-
'regex' => "/^(\d+\s)(\d+\s)?(\d+\s)?[NS]{1}\s(\d\s)(\d+\s)?(\d+\s)?[EW]{1}(\s\d+m?)(\s\d+m?)?(\s\d+m?)?(\s\d+m?)?$/s",
116-
'errmsg'=> 'invalid_type_dkim'
117-
),
113+
//TODO Regex check... I guess I had an error in this regex as I'm not used to RegEx. Further the check did never actually take place...
114+
// 1 => array (
115+
// 'type' => 'REGEX',
116+
// 'regex' => "/^(\d+\s)(\d+\s)?(\d+\s)?[NS]{1}\s(\d\s)(\d+\s)?(\d+\s)?[EW]{1}(\s\d+m?)(\s\d+m?)?(\s\d+m?)?(\s\d+m?)?$/s",
117+
// 'errmsg'=> 'invalid_type_dkim'
118+
// ),
118119
),
119120
'default' => '',
120121
'value' => '',

server/plugins-available/bind_plugin.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ function soa_dnssec_create(&$data) {
114114

115115
//Do some magic...
116116
exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
117-
'/usr/sbin/dnssec-keygen -a NSEC3RSASHA1 -b 2048 -n ZONE '.escapeshellcmd($domain).';'.
118-
'/usr/sbin/dnssec-keygen -f KSK -a NSEC3RSASHA1 -b 4096 -n ZONE '.escapeshellcmd($domain));
117+
'dnssec-keygen -a NSEC3RSASHA1 -b 2048 -n ZONE '.escapeshellcmd($domain).';'.
118+
'dnssec-keygen -f KSK -a NSEC3RSASHA1 -b 4096 -n ZONE '.escapeshellcmd($domain));
119119

120120
$this->soa_dnssec_sign($data); //Now sign the zone for the first time
121121
$data['new']['dnssec_initialized']='Y';
@@ -148,7 +148,7 @@ function soa_dnssec_sign(&$data) {
148148

149149
//Sign the zone and set it valid for max. 16 days
150150
exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
151-
'/usr/sbin/dnssec-signzone -A -e +1382400 -3 $(head -c 1000 /dev/random | sha1sum | cut -b 1-16) -N increment -o '.escapeshellcmd($domain).' -t '.$filespre.escapeshellcmd($domain));
151+
'dnssec-signzone -A -e +1382400 -3 $(head -c 1000 /dev/random | sha1sum | cut -b 1-16) -N increment -o '.escapeshellcmd($domain).' -t '.$filespre.escapeshellcmd($domain));
152152

153153
//Write Data back ino DB
154154
$dnssecdata = "DS-Records:\n".file_get_contents($dns_config['bind_zonefiles_dir'].'/dsset-'.$domain.'.');
@@ -185,7 +185,7 @@ function soa_dnssec_update(&$data, $new=false) {
185185

186186
$dbdata = $app->db->queryOneRecord('SELECT id,serial FROM dns_soa WHERE id='.$data['new']['id']);
187187
exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
188-
'/usr/sbin/named-checkzone '.escapeshellcmd($domain).' '.escapeshellcmd($dns_config['bind_zonefiles_dir']).'/'.$filespre.escapeshellcmd($domain).' | egrep -ho \'[0-9]{10}\'', $serial, $retState);
188+
'named-checkzone '.escapeshellcmd($domain).' '.escapeshellcmd($dns_config['bind_zonefiles_dir']).'/'.$filespre.escapeshellcmd($domain).' | egrep -ho \'[0-9]{10}\'', $serial, $retState);
189189
if ($retState != 0) {
190190
$app->log('DNSSEC Error: Error in Zonefile for '.$domain, LOGLEVEL_ERR);
191191
return false;

0 commit comments

Comments
 (0)