[Bug 238] New: sshd.pid file written AFTER key generation causes race condition

James A Morrison ja2morri at student.math.uwaterloo.ca
Fri May 10 01:42:04 EST 2002


   The SSH Daemon writes its sshd.pid file only after it generates its ephemeral 
   server key. This makes the amount of time between starting the daemon and the 
   creation / update of the sshd.pid file variable, and can cause a race condition 
   with e.g. /sbin/init.d scripts which start the daemon and then want to check to 
   see that the start was successful.
   Please move the sshd.pid create/update to happen before the generation of the 
   ephemeral server key, so that the new SSH Daemon pid is written to the sshd.pid 
   file very shortly after the process starts executing.
   Thanks.

Isn't this the proper behavior.  If the server key isn't generated the daemon
isn't actually started.

James A. Morrison





More information about the openssh-unix-dev mailing list