[openssh-commits] [openssh] 01/14: upstream: Mask SIGTERM/SIGQUIT when processing a SIGHUP restart

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Sep 16 11:15:55 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 0f90a8417bf6063b661cc3069b9f5a7d19c69242
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Wed Sep 16 00:08:52 2026 +0000

    upstream: Mask SIGTERM/SIGQUIT when processing a SIGHUP restart
    
    request. This ensures that these signals are subsequently delivered after the
    restart has been completed, rather than ignored. bz3981
    
    OpenBSD-Commit-ID: a69ff4121882583edcba319fa40adfc6ba75377c
---
 sshd.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sshd.c b/sshd.c
index 62f6a1313..167cd0184 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.632 2026/09/15 07:08:09 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.633 2026/09/16 00:08:52 djm Exp $ */
 /*
  * Copyright (c) 2000, 2001, 2002 Markus Friedl.  All rights reserved.
  * Copyright (c) 2002 Niels Provos.  All rights reserved.
@@ -983,6 +983,12 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s,
 				lameduck = 1;
 			}
 			if (listening <= 0) {
+				/*
+				 * Leave termination signals blocked, so
+				 * they don't get lost across a restart.
+				 */
+				sigdelset(&osigset, SIGTERM);
+				sigdelset(&osigset, SIGQUIT);
 				sigprocmask(SIG_SETMASK, &osigset, NULL);
 				sighup_restart();
 			}

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list