From: jacob Date: Fri, 29 Aug 2003 19:21:49 +0000 (+0000) Subject: Add "-s" option to Unix plink too. X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/commitdiff_plain/09bdfcbbd49c10c9e5ecf8998968ad1fc724065b Add "-s" option to Unix plink too. Compiled, but not tested as Unix plink seems to be segfaulting today. git-svn-id: svn://svn.tartarus.org/sgt/putty@3427 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/unix/plink.1 b/unix/plink.1 index 92c46937..2ff74847 100644 --- a/unix/plink.1 +++ b/unix/plink.1 @@ -53,3 +53,5 @@ Force use of SSH protocol version 2. Enable compression. .IP "\fB-i\fR \fIpath\fR" Private key file for authentication. +.IP "\fB-s\fR" +Remote command is SSH subsystem (SSH-2 only). diff --git a/unix/uxplink.c b/unix/uxplink.c index 8d0e169a..d069e045 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -231,6 +231,7 @@ static void usage(void) printf(" -1 -2 force use of particular protocol version\n"); printf(" -C enable compression\n"); printf(" -i key private key file for authentication\n"); + printf(" -s remote command is an SSH subsystem (SSH-2 only)\n"); exit(1); } @@ -244,6 +245,7 @@ int main(int argc, char **argv) int connopen; int exitcode; int errors; + int use_subsystem = 0; void *ldisc, *logctx; ssh_get_line = console_get_line; @@ -297,6 +299,9 @@ int main(int argc, char **argv) continue; } else if (!strcmp(p, "-batch")) { console_batch_mode = 1; + } else if (!strcmp(p, "-s")) { + /* Save status to write to cfg later. */ + use_subsystem = 1; } else if (!strcmp(p, "-o")) { if (argc <= 1) { fprintf(stderr, @@ -467,6 +472,12 @@ int main(int argc, char **argv) cmdline_run_saved(&cfg); /* + * Apply subsystem status. + */ + if (use_subsystem) + cfg.ssh_subsys = TRUE; + + /* * Trim a colon suffix off the hostname if it's there. */ cfg.host[strcspn(cfg.host, ":")] = '\0';