diff options
author | djm@openbsd.org <djm@openbsd.org> | 2022-12-16 06:56:47 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2023-01-03 17:53:05 +1100 |
commit | 93f2ce8c050a7a2a628646c00b40b9b53fef93ef (patch) | |
tree | 622aea552b2dcc3b0750e627224273998e39e589 /sshd.c | |
parent | 4acfaabfae41badb9d334a2ee88c5c6ad041c0d5 (diff) | |
download | openssh-git-93f2ce8c050a7a2a628646c00b40b9b53fef93ef.tar.gz |
upstream: Clear signal mask early in main(); sshd may have been
started with one or more signals masked (sigprocmask(2) is not cleared
on fork/exec) and this could interfere with various things, e.g. the
login grace timer.
Execution environments that fail to clear the signal mask before running
sshd are clearly broken, but apparently they do exist.
Reported by Sreedhar Balasubramanian; ok dtucker@
OpenBSD-Commit-ID: 77078c0b1c53c780269fc0c416f121d05e3010ae
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.593 2022/12/04 23:50:49 cheloha Exp $ */ +/* $OpenBSD: sshd.c,v 1.594 2022/12/16 06:56:47 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1546,12 +1546,16 @@ main(int ac, char **av) int keytype; Authctxt *authctxt; struct connection_info *connection_info = NULL; + sigset_t sigmask; #ifdef HAVE_SECUREWARE (void)set_auth_parameters(ac, av); #endif __progname = ssh_get_progname(av[0]); + sigemptyset(&sigmask); + sigprocmask(SIG_SETMASK, &sigmask, NULL); + /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ saved_argc = ac; rexec_argc = ac; |