]> andersk Git - openssh.git/blobdiff - sftp.c
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / sftp.c
diff --git a/sftp.c b/sftp.c
index ac6ac9fed3a2c766f20ff1412165f1d96c1cbe7f..d65d4ec62ea74ce39a3804d5a78dfa2bdf4e9e74 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.121 2010/01/13 12:48:34 jmc Exp $ */
+/* $OpenBSD: sftp.c,v 1.123 2010/01/27 19:21:39 djm 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);
@@ -2093,7 +2095,7 @@ main(int argc, char **argv)
        infile = stdin;
 
        while ((ch = getopt(argc, argv,
-           "1246hqrvCc:D:i:o:s:S:b:B:F:P:R:")) != -1) {
+           "1246hpqrvCc:D:i:o:s:S:b:B:F:P:R:")) != -1) {
                switch (ch) {
                /* Passed through to ssh(1) */
                case '4':
This page took 0.039106 seconds and 4 git commands to generate.