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 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'config/sshdcond') 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() { -- cgit v1.2.3