]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/02/06 22:07:42
authormouring <mouring>
Fri, 9 Feb 2001 02:36:43 +0000 (02:36 +0000)
committermouring <mouring>
Fri, 9 Feb 2001 02:36:43 +0000 (02:36 +0000)
     [ssh.c]
     fatal() if subsystem fails
   - markus@cvs.openbsd.org 2001/02/06 22:43:02
     [ssh.c]
     remove confusing callback code
   - jakob@cvs.openbsd.org 2001/02/06 23:03:24
     [ssh.c]
     add -1 option (force protocol version 1). ok markus@
   - jakob@cvs.openbsd.org 2001/02/06 23:06:21
     [ssh.c]
     reorder -{1,2,4,6} options. ok markus@

ChangeLog
ssh.c

index 9b4f1303f7a6551f5273d41a0e65142a16c731f9..92920984183e540061a8c2ec147c5f758668a81e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      - more strict prototypes, include necessary headers
      - use paths.h/pathnames.h decls
      - size_t typecase to int -> u_long
+   - markus@cvs.openbsd.org 2001/02/06 22:07:42
+     [ssh.c]
+     fatal() if subsystem fails
+   - markus@cvs.openbsd.org 2001/02/06 22:43:02
+     [ssh.c]
+     remove confusing callback code
+   - jakob@cvs.openbsd.org 2001/02/06 23:03:24
+     [ssh.c]
+     add -1 option (force protocol version 1). ok markus@
+   - jakob@cvs.openbsd.org 2001/02/06 23:06:21
+     [ssh.c]
+     reorder -{1,2,4,6} options. ok markus@
  - (bal) Missing 'const' in readpass.h
 
 20010208
diff --git a/ssh.c b/ssh.c
index 1d7582333208731711fdadfd39b6062f0b05da0b..ddf28c538a16f803bec1d63e15cf44c0df14070c 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -63,6 +63,7 @@ RCSID("$OpenBSD: ssh.c,v 1.93 2001/02/08 19:30:52 itojun Exp $");
 #include "readconf.h"
 #include "sshconnect.h"
 #include "tildexpand.h"
+#include "dispatch.h"
 #include "misc.h"
 
 #ifdef HAVE___PROGNAME
@@ -180,9 +181,10 @@ usage(void)
        fprintf(stderr, "  -C          Enable compression.\n");
        fprintf(stderr, "  -N          Do not execute a shell or command.\n");
        fprintf(stderr, "  -g          Allow remote hosts to connect to forwarded ports.\n");
+       fprintf(stderr, "  -1          Force protocol version 1.\n");
+       fprintf(stderr, "  -2          Force protocol version 2.\n");
        fprintf(stderr, "  -4          Use IPv4 only.\n");
        fprintf(stderr, "  -6          Use IPv6 only.\n");
-       fprintf(stderr, "  -2          Force protocol version 2.\n");
        fprintf(stderr, "  -o 'option' Process the option as if it was read from a configuration file.\n");
        fprintf(stderr, "  -s          Invoke command (mandatory) as SSH2 subsystem.\n");
        exit(1);
@@ -331,6 +333,9 @@ main(int ac, char **av)
                        optarg = NULL;
                }
                switch (opt) {
+               case '1':
+                       options.protocol = SSH_PROTO_1;
+                       break;
                case '2':
                        options.protocol = SSH_PROTO_2;
                        break;
@@ -938,6 +943,20 @@ ssh_session(void)
        return client_loop(have_tty, tty_flag ? options.escape_char : -1, 0);
 }
 
+void
+client_subsystem_reply(int type, int plen, void *ctxt)
+{
+       int id, len;
+
+       id = packet_get_int();
+       len = buffer_len(&command);
+       len = MAX(len, 900);
+       packet_done();
+       if (type == SSH2_MSG_CHANNEL_FAILURE)
+               fatal("Request for subsystem '%.*s' failed on channel %d",
+                   len, buffer_ptr(&command), id);
+}
+
 void
 ssh_session2_callback(int id, void *arg)
 {
@@ -995,7 +1014,11 @@ ssh_session2_callback(int id, void *arg)
                        len = 900;
                if (subsystem_flag) {
                        debug("Sending subsystem: %.*s", len, buffer_ptr(&command));
-                       channel_request_start(id, "subsystem", 0);
+                       channel_request_start(id, "subsystem", /*want reply*/ 1);
+                       /* register callback for reply */
+                       /* XXX we asume that client_loop has already been called */
+                       dispatch_set(SSH2_MSG_CHANNEL_FAILURE, &client_subsystem_reply);
+                       dispatch_set(SSH2_MSG_CHANNEL_SUCCESS, &client_subsystem_reply);
                } else {
                        debug("Sending command: %.*s", len, buffer_ptr(&command));
                        channel_request_start(id, "exec", 0);
@@ -1006,10 +1029,10 @@ ssh_session2_callback(int id, void *arg)
                channel_request(id, "shell", 0);
        }
        /* channel_callback(id, SSH2_MSG_OPEN_CONFIGMATION, client_init, 0); */
+
 done:
        /* register different callback, etc. XXX */
        packet_set_interactive(interactive);
-       clientloop_set_session_ident(id);
 }
 
 int
This page took 0.046566 seconds and 5 git commands to generate.