X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c44bf5bd7bf680c21356864ac5ae72ab29e55ce6..c606c42da46efa232c1f29791877f07d98da262e:/plink.c diff --git a/plink.c b/plink.c index 0f764cf3..41a5001e 100644 --- a/plink.c +++ b/plink.c @@ -240,6 +240,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); } @@ -279,6 +280,7 @@ int main(int argc, char **argv) int connopen; int exitcode; int errors; + int use_subsystem = 0; ssh_get_line = console_get_line; @@ -331,6 +333,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 { fprintf(stderr, "plink: unknown option \"%s\"\n", p); errors = 1; @@ -489,6 +494,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'; @@ -558,7 +569,7 @@ int main(int argc, char **argv) */ netevent = CreateEvent(NULL, FALSE, FALSE, NULL); { - char *error; + const char *error; char *realhost; /* nodelay is only useful if stdin is a character device (console) */ int nodelay = cfg.tcp_nodelay &&