diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-09-22 20:14:46 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-09-22 20:14:46 +0000 |
commit | dcb6476880371a5b1ae3b9e74f53c35786902082 (patch) | |
tree | f1f0e575f8e54e404dc2db6ca7d5c47f8fb0577d /etc/sshd | |
parent | 2d195c3ff620f91ce05ce0e7a3a3f1c4db04b24e (diff) | |
download | pfsense-dcb6476880371a5b1ae3b9e74f53c35786902082.zip pfsense-dcb6476880371a5b1ae3b9e74f53c35786902082.tar.gz |
Do not allow sshd script to run multiple times concurrently.
Diffstat (limited to 'etc/sshd')
-rwxr-xr-x | etc/sshd | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -87,16 +87,22 @@ write_config("Clearing SSH keys from config.xml"); } + /* are we already running? if so exit */ + if(file_exists("/tmp/keys_generating")) + exit; + if (!file_exists("$sshConfigDir/ssh_host_key") or file_exists("/etc/keys_generating")) { /* remove previous keys and regen later */ conf_mount_rw(); mwexec("rm /etc/ssh/ssh_host_*"); touch("/etc/keys_generating"); + touch("/tmp/keys_generating"); echo " Generating Keys:\n"; system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa1 -N '' -f $sshConfigDir/ssh_host_key"); system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa -N '' -f $sshConfigDir/ssh_host_rsa_key"); system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t dsa -N '' -f $sshConfigDir/ssh_host_dsa_key"); unlink("/etc/keys_generating"); + unlink("/tmp/keys_generating"); echo "Starting SSH... "; } |