summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/sshd6
1 files changed, 2 insertions, 4 deletions
diff --git a/etc/sshd b/etc/sshd
index 16e7a5e..69b3e71 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -34,8 +34,6 @@
function file_size($file) {
$size = filesize($file);
- if ( $size == 0)
- $size = exec("ls -l $file | awk '{print $5}'");
return $size;
}
@@ -44,8 +42,8 @@
*/
$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_exists($f2c))
- if(file_size($f2c)==0) {
+ if(file_exists("/etc/ssh/{$f2c}"))
+ if(file_size("/etc/ssh/{$f2c}")==0) {
mwexec("rm /etc/ssh_host*");
}
}
OpenPOWER on IntegriCloud