Skip to content

Commit

Permalink
fmDNS - #346 - EL chroot mounts now include fmDNS files
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyXJ committed Mar 21, 2017
1 parent 52a2949 commit a0e1032
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions client/facileManager/fmDNS/functions.php
Expand Up @@ -111,6 +111,9 @@ function buildConf($url, $data) {
$files = $new_files;
unset($new_files);
$chroot_environment = true;

/** Add key file to chroot list */
addChrootFiles();
}

if ($debug) {
Expand Down Expand Up @@ -317,6 +320,9 @@ function detectChrootDir() {
$os = detectOSDistro();
if (in_array($os, array('Redhat', 'CentOS', 'ClearOS', 'Oracle'))) {
if ($chroot_dir = getParameterValue('^ROOTDIR', '/etc/sysconfig/named')) return $chroot_dir;
/** systemd unit file */
addChrootFiles();
if ($chroot_dir = getParameterValue('ExecStart=/usr/libexec/setup-named-chroot.sh', '/usr/lib/systemd/system/named-chroot-setup.service', ' ')) return $chroot_dir;
}
if (in_array($os, array('Debian', 'Ubuntu', 'Fubuntu'))) {
if ($flags = getParameterValue('^OPTIONS', '/etc/default/bind9')) {
Expand Down Expand Up @@ -484,4 +490,19 @@ function runRndcActions($rndc_actions = array()) {
}


/**
* Ensures chroot files are added
*
* @since 3.0
* @package fmDNS
*
* @return boolean
*/
function addChrootFiles() {
if (file_exists('/usr/libexec/setup-named-chroot.sh') && !exec('grep -c ' . escapeshellarg('named.conf.keys') . ' /usr/libexec/setup-named-chroot.sh')) {
file_put_contents('/usr/libexec/setup-named-chroot.sh', str_replace('rndc.key', 'rndc.key /etc/named.conf.keys', file_get_contents('/usr/libexec/setup-named-chroot.sh')));
}
}


?>
1 change: 1 addition & 0 deletions server/fm-modules/fmDNS/change.log
@@ -1,6 +1,7 @@
3.0-beta2 (2017-??-??)
======================
* Server - [feature] Added support to automatically generate a DS RR. (Issue #285)
* Client - [bug] EL chroot mounts now include fmDNS files. (Issue #346)

3.0-beta1 (2017-03-08)
======================
Expand Down

0 comments on commit a0e1032

Please sign in to comment.