diff options
author | Darren Tucker <dtucker@zip.com.au> | 2010-01-15 01:46:03 +0100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2010-01-15 01:46:03 +0100 |
commit | b8b17e984acab330b13c66460e6570e72c55ded9 (patch) | |
tree | a485c1b08482761a264f1f60397d453b4106b1bf /sftp.c | |
parent | - dtucker@cvs.openbsd.org 2010/01/14 23:41:49 (diff) | |
download | openssh-b8b17e984acab330b13c66460e6570e72c55ded9.tar.xz openssh-b8b17e984acab330b13c66460e6570e72c55ded9.zip |
- guenther@cvs.openbsd.org 2010/01/15 00:05:22
[sftp.c]
Reset SIGTERM to SIG_DFL before executing ssh, so that even if sftp
inherited SIGTERM as ignored it will still be able to kill the ssh it
starts.
ok dtucker@
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.121 2010/01/13 12:48:34 jmc Exp $ */ +/* $OpenBSD: sftp.c,v 1.122 2010/01/15 00:05:22 guenther Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * @@ -2027,9 +2027,11 @@ connect_to_server(char *path, char **args, int *in, int *out) * The underlying ssh is in the same process group, so we must * ignore SIGINT if we want to gracefully abort commands, * otherwise the signal will make it to the ssh process and - * kill it too + * kill it too. Contrawise, since sftp sends SIGTERMs to the + * underlying ssh, it must *not* ignore that signal. */ signal(SIGINT, SIG_IGN); + signal(SIGTERM, SIG_DFL); execvp(path, args); fprintf(stderr, "exec: %s: %s\n", path, strerror(errno)); _exit(1); |