1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-29 07:44:48 -05:00

Add "-s" option to Unix plink too.

Compiled, but not tested as Unix plink seems to be segfaulting today.

[originally from svn r3427]
This commit is contained in:
Jacob Nevins 2003-08-29 19:21:49 +00:00
parent 5690a72640
commit 2504a53d72
2 changed files with 13 additions and 0 deletions

View File

@ -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).

View File

@ -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,
@ -466,6 +471,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.
*/