diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-11-26 08:18:08 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-11-26 08:18:08 -0200 |
commit | a2103cc238bc568016d4ed931bd5ec52ca103fc8 (patch) | |
tree | 68d073a81533339d3851848fec710df51024fdf4 /config/sshdcond | |
parent | d8be770071ed43e219b59b1fb53496515852e0be (diff) | |
download | pfsense-packages-a2103cc238bc568016d4ed931bd5ec52ca103fc8.tar.gz pfsense-packages-a2103cc238bc568016d4ed931bd5ec52ca103fc8.tar.bz2 pfsense-packages-a2103cc238bc568016d4ed931bd5ec52ca103fc8.zip |
Stop trying to be smart patching /etc/sshd, stock version already consider /etc/sshd_extra. It fixes #3959
Diffstat (limited to 'config/sshdcond')
-rw-r--r-- | config/sshdcond/sshdcond.inc | 22 |
1 files changed, 1 insertions, 21 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() { |