]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/06/23 19:12:43
authormouring <mouring>
Mon, 25 Jun 2001 05:10:20 +0000 (05:10 +0000)
committermouring <mouring>
Mon, 25 Jun 2001 05:10:20 +0000 (05:10 +0000)
     [sshd.c]
     pidfile/sigterm race; bbraun@synack.net

ChangeLog
sshd.c

index 02241dbf93ba543a9abf9c90eaab2fdd7ddf5d61..b1757cbe003b180d5c6a18a4147df646fb14bbe9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -85,6 +85,9 @@
    - itojun@cvs.openbsd.org 2001/06/23 17:48:18
      [sftp.1 ssh.1 sshd.8 ssh-keyscan.1]
      kill whitespace at EOL.
+   - markus@cvs.openbsd.org 2001/06/23 19:12:43
+     [sshd.c]
+     pidfile/sigterm race; bbraun@synack.net
 
 20010622
  - (stevesk) handle systems without pw_expire and pw_change.
diff --git a/sshd.c b/sshd.c
index 431f4e2ac776731ddbcaf11b831272208ca3036a..936e861a9ce1e0c4f3715e9f892951d446dda93b 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.200 2001/06/23 15:12:21 itojun Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.201 2001/06/23 19:12:43 markus Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -876,6 +876,22 @@ main(int ac, char **av)
                if (!num_listen_socks)
                        fatal("Cannot bind any address.");
 
+               if (options.protocol & SSH_PROTO_1)
+                       generate_ephemeral_server_key();
+
+               /*
+                * Arrange to restart on SIGHUP.  The handler needs
+                * listen_sock.
+                */
+               signal(SIGHUP, sighup_handler);
+
+               signal(SIGTERM, sigterm_handler);
+               signal(SIGQUIT, sigterm_handler);
+
+               /* Arrange SIGCHLD to be caught. */
+               signal(SIGCHLD, main_sigchld_handler);
+
+               /* Write out the pid file after the sigterm handler is setup */
                if (!debug_flag) {
                        /*
                         * Record our pid in /var/run/sshd.pid to make it
@@ -890,17 +906,6 @@ main(int ac, char **av)
                                fclose(f);
                        }
                }
-               if (options.protocol & SSH_PROTO_1)
-                       generate_ephemeral_server_key();
-
-               /* Arrange to restart on SIGHUP.  The handler needs listen_sock. */
-               signal(SIGHUP, sighup_handler);
-
-               signal(SIGTERM, sigterm_handler);
-               signal(SIGQUIT, sigterm_handler);
-
-               /* Arrange SIGCHLD to be caught. */
-               signal(SIGCHLD, main_sigchld_handler);
 
                /* setup fd set for listen */
                fdset = NULL;
This page took 0.061879 seconds and 5 git commands to generate.