From 13b62b964ee644702419cb2ebcb638d78e6d0139 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?A=2E=20T=C3=A4ffner?= <darkalex@firesplash.de>
Date: Mon, 25 Jan 2016 12:52:12 +0100
Subject: [PATCH] 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.

---
 interface/web/dns/form/dns_ds.tform.php      |  4 ++--
 interface/web/dns/form/dns_loc.tform.php     | 11 ++++++-----
 server/plugins-available/bind_plugin.inc.php |  8 ++++----
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/interface/web/dns/form/dns_ds.tform.php b/interface/web/dns/form/dns_ds.tform.php
index 274bcfe82a..fe8528f9c8 100644
--- a/interface/web/dns/form/dns_ds.tform.php
+++ b/interface/web/dns/form/dns_ds.tform.php
@@ -102,13 +102,13 @@ $form["tabs"]['dns'] = array (
 			'width'  => '5',
 			'maxlength' => '5'
 		),
-		'data' => array ( //TODO Regex validation does not take place obviously
+		'data' => array ( //TODO Regex validation does not take place obviously - why ever...
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
 			'validators' => array (  
 				0 => array ( 
 					'type' => 'REGEX', 
-					'regex' => "/^\d{1,5}\s\d{1,2}\s\d{1,2}\s.+$/s", 
+					'regex' => "/^\d{1,5}\s\d{1,2}\s\d{1,2}\s.+$/", 
 					'errmsg'=> 'invalid_type_ds'
 				)
 			),
diff --git a/interface/web/dns/form/dns_loc.tform.php b/interface/web/dns/form/dns_loc.tform.php
index 3803d765f2..5749a866b2 100644
--- a/interface/web/dns/form/dns_loc.tform.php
+++ b/interface/web/dns/form/dns_loc.tform.php
@@ -110,11 +110,12 @@ $form["tabs"]['dns'] = array (
 					'type' => 'NOTEMPTY', 
 					'errmsg'=> 'data_error_empty'
 				),
-				1 => array ( 
-					'type' => 'REGEX', 
-					'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", 
-					'errmsg'=> 'invalid_type_dkim'
-				),
+			//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...
+			//	1 => array ( 
+			//		'type' => 'REGEX', 
+			//		'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", 
+			//		'errmsg'=> 'invalid_type_dkim'
+			//	),
 			),
 			'default' => '',
 			'value'  => '',
diff --git a/server/plugins-available/bind_plugin.inc.php b/server/plugins-available/bind_plugin.inc.php
index 46311dd795..cede1cb82c 100644
--- a/server/plugins-available/bind_plugin.inc.php
+++ b/server/plugins-available/bind_plugin.inc.php
@@ -114,8 +114,8 @@ class bind_plugin {
 		
 		//Do some magic...
 		exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
-		'/usr/sbin/dnssec-keygen -a NSEC3RSASHA1 -b 2048 -n ZONE '.escapeshellcmd($domain).';'.
-		'/usr/sbin/dnssec-keygen -f KSK -a NSEC3RSASHA1 -b 4096 -n ZONE '.escapeshellcmd($domain));
+		'dnssec-keygen -a NSEC3RSASHA1 -b 2048 -n ZONE '.escapeshellcmd($domain).';'.
+		'dnssec-keygen -f KSK -a NSEC3RSASHA1 -b 4096 -n ZONE '.escapeshellcmd($domain));
 
 		$this->soa_dnssec_sign($data); //Now sign the zone for the first time
 		$data['new']['dnssec_initialized']='Y';
@@ -148,7 +148,7 @@ class bind_plugin {
 		
 		//Sign the zone and set it valid for max. 16 days
 		exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
-			 '/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));
+			 '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));
 			 
 		//Write Data back ino DB
 		$dnssecdata = "DS-Records:\n".file_get_contents($dns_config['bind_zonefiles_dir'].'/dsset-'.$domain.'.');
@@ -185,7 +185,7 @@ class bind_plugin {
 		
 		$dbdata = $app->db->queryOneRecord('SELECT id,serial FROM dns_soa WHERE id='.$data['new']['id']);
 		exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
-			 '/usr/sbin/named-checkzone '.escapeshellcmd($domain).' '.escapeshellcmd($dns_config['bind_zonefiles_dir']).'/'.$filespre.escapeshellcmd($domain).' | egrep -ho \'[0-9]{10}\'', $serial, $retState);
+			 'named-checkzone '.escapeshellcmd($domain).' '.escapeshellcmd($dns_config['bind_zonefiles_dir']).'/'.$filespre.escapeshellcmd($domain).' | egrep -ho \'[0-9]{10}\'', $serial, $retState);
 		if ($retState != 0) {
 			$app->log('DNSSEC Error: Error in Zonefile for '.$domain, LOGLEVEL_ERR);
 			return false;
-- 
GitLab