From 5858cbdb08cb4a70ba3590d8418d3bcd048dc86a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 17 Jul 2005 20:00:01 +0000 Subject: Do not stat a file if it doesn't exist --- etc/sshd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'etc/sshd') 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") { -- cgit v1.1