summaryrefslogtreecommitdiffstats
path: root/etc/sshd
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-17 20:00:01 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-17 20:00:01 +0000
commit5858cbdb08cb4a70ba3590d8418d3bcd048dc86a (patch)
tree169be5c16fc35395102eed4f813c1499f9d422d8 /etc/sshd
parentce1c091186c700a97f4e27b102ce2fc8db813934 (diff)
downloadpfsense-5858cbdb08cb4a70ba3590d8418d3bcd048dc86a.zip
pfsense-5858cbdb08cb4a70ba3590d8418d3bcd048dc86a.tar.gz
Do not stat a file if it doesn't exist
Diffstat (limited to 'etc/sshd')
-rwxr-xr-xetc/sshd7
1 files changed, 4 insertions, 3 deletions
diff --git a/etc/sshd b/etc/sshd
index 1ffb843..aa874a5 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -44,9 +44,10 @@
*/
$files_to_check = array('ssh_host_dsa_key','ssh_host_dsa_key.pub','ssh_host_key','ssh_host_key.pub','ssh_host_rsa_key','ssh_host_rsa_key.pub','/root/.authorized_keys');
foreach($files_to_check as $f2c) {
- if(file_size($f2c)==0) {
- mwexec("rm /etc/ssh_host*");
- }
+ if(file_exists($f2c))
+ if(file_size($f2c)==0) {
+ mwexec("rm /etc/ssh_host*");
+ }
}
if($argv[1] == "stop" || $argv[0] == "stop") {
OpenPOWER on IntegriCloud