=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sftp.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -r1.121 -r1.122 --- src/usr.bin/ssh/sftp.c 2010/01/13 12:48:34 1.121 +++ src/usr.bin/ssh/sftp.c 2010/01/15 00:05:22 1.122 @@ -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 * @@ -1979,9 +1979,11 @@ * 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);