changeset 498:3c0dc22bda20

merge of '6fd2597077a4e2421bf45388e058d15606f6dd74' and 'c7b916e6c522f16f06fe1bd52815ba13aa88b90b'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 Sep 2008 15:57:32 +0000
parents 9f583f4d59a6 (current diff) ae600f1eef81 (diff)
children f3ca5ebc319a
files
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cli-chansession.c	Tue Sep 23 13:16:22 2008 +0000
+++ b/cli-chansession.c	Tue Sep 23 15:57:32 2008 +0000
@@ -321,7 +321,11 @@
 	TRACE(("enter send_chansess_shell_req"))
 
 	if (cli_opts.cmd) {
-		reqtype = "exec";
+		if (cli_opts.is_subsystem) {
+			reqtype = "subsystem";
+		} else {
+			reqtype = "exec";
+		}
 	} else {
 		reqtype = "shell";
 	}
--- a/cli-runopts.c	Tue Sep 23 13:16:22 2008 +0000
+++ b/cli-runopts.c	Tue Sep 23 15:57:32 2008 +0000
@@ -58,6 +58,7 @@
 					"-N    Don't run a remote command\n"
 					"-f    Run in background after auth\n"
 					"-y    Always accept remote host key if unknown\n"
+					"-s    Request a subsystem (use for sftp)\n"
 #ifdef ENABLE_CLI_PUBKEY_AUTH
 					"-i <identityfile>   (multiple allowed)\n"
 #endif
@@ -116,6 +117,7 @@
 	cli_opts.backgrounded = 0;
 	cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */
 	cli_opts.always_accept_key = 0;
+	cli_opts.is_subsystem = 0;
 #ifdef ENABLE_CLI_PUBKEY_AUTH
 	cli_opts.privkeys = NULL;
 #endif
@@ -213,6 +215,9 @@
 				case 'f':
 					cli_opts.backgrounded = 1;
 					break;
+				case 's':
+					cli_opts.is_subsystem = 1;
+					break;
 #ifdef ENABLE_CLI_LOCALTCPFWD
 				case 'L':
 					nextislocal = 1;
--- a/runopts.h	Tue Sep 23 13:16:22 2008 +0000
+++ b/runopts.h	Tue Sep 23 15:57:32 2008 +0000
@@ -109,6 +109,7 @@
 	int always_accept_key;
 	int no_cmd;
 	int backgrounded;
+	int is_subsystem;
 #ifdef ENABLE_CLI_PUBKEY_AUTH
 	struct SignKeyList *privkeys; /* Keys to use for public-key auth */
 #endif