Add "-s" option to Unix plink too.
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 29 Aug 2003 19:21:49 +0000 (19:21 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 29 Aug 2003 19:21:49 +0000 (19:21 +0000)
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

unix/plink.1
unix/uxplink.c

index 92c4693..2ff7484 100644 (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).
index 8d0e169..d069e04 100644 (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,
@@ -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';