From a2103cc238bc568016d4ed931bd5ec52ca103fc8 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 26 Nov 2014 08:18:08 -0200 Subject: Stop trying to be smart patching /etc/sshd, stock version already consider /etc/sshd_extra. It fixes #3959 --- config/sshdcond/sshdcond.inc | 22 +--------------------- pkg_config.10.xml | 2 +- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/config/sshdcond/sshdcond.inc b/config/sshdcond/sshdcond.inc index 84e98fe3..7ff911c1 100644 --- a/config/sshdcond/sshdcond.inc +++ b/config/sshdcond/sshdcond.inc @@ -37,27 +37,7 @@ require_once("config.inc"); require_once("util.inc"); function restart_sshd() { - // backup /etc/sshd before any change - $etc_sshd="/etc/sshd"; - $pfsense_version=preg_replace("/\s/","",file_get_contents("/etc/version")); - if (!file_exists('/root/'.$pfsense_version.'.sshd.backup')) { - copy ($etc_sshd,'/root/'.$pfsense_version.'.sshd.backup'); - } - - #patch /etc/sshd if need - $sshd_file=file($etc_sshd); - $sshd_new_file=""; - foreach ($sshd_file as $line) { - if (preg_match('/sshconf .= "Port/',$line)) { - $sshd_new_file.= $line; - $sshd_new_file.= "\t".'if(file_exists("/etc/ssh/sshd_extra")) {$sshconf.=file_get_contents("/etc/ssh/sshd_extra");}'."\n"; - } - elseif(!preg_match('/sshd_extra/',$line)) { - $sshd_new_file.= $line; - } - } - file_put_contents($etc_sshd,$sshd_new_file,LOCK_EX); - mwexec_bg($etc_sshd); + mwexec_bg("/etc/sshd"); } function sshdcond_custom_php_install_command() { diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 2decacb6..c1215bcf 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1219,7 +1219,7 @@ This package acts as an access list frontend for ssh connections]]> Enhancements - 1.0 + 1.0.1 Beta 2.2 https://packages.pfsense.org/packages/config/sshdcond/sshdcond.xml diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 9ee9ab4b..7ef4fc0a 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1575,7 +1575,7 @@ This package acts as an access list frontend for ssh connections]]> Enhancements - 1.0 + 1.0.1 Beta 2.0 https://packages.pfsense.org/packages/config/sshdcond/sshdcond.xml diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index a1efb462..a3fe70c3 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1562,7 +1562,7 @@ This package acts as an access list frontend for ssh connections]]> Enhancements - 1.0 + 1.0.1 Beta 2.0 https://packages.pfsense.org/packages/config/sshdcond/sshdcond.xml -- cgit v1.2.3