[BACK]Return to ssh.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/ssh.c between version 1.84 and 1.85

version 1.84, 2001/01/21 19:05:58 version 1.85, 2001/01/29 12:36:10
Line 131 
Line 131 
 /* command to be executed */  /* command to be executed */
 Buffer command;  Buffer command;
   
   /* Should we execute a command or invoke a subsystem? */
   int subsystem_flag = 0;
   
 /* Prints a help message to the user.  This function never returns. */  /* Prints a help message to the user.  This function never returns. */
   
 void  void
Line 173 
Line 176 
         fprintf(stderr, "  -6          Use IPv6 only.\n");          fprintf(stderr, "  -6          Use IPv6 only.\n");
         fprintf(stderr, "  -2          Force protocol version 2.\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, "  -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);          exit(1);
 }  }
   
Line 462 
Line 466 
                                          "command-line", 0, &dummy) != 0)                                           "command-line", 0, &dummy) != 0)
                                 exit(1);                                  exit(1);
                         break;                          break;
                   case 's':
                           subsystem_flag = 1;
                           break;
                 default:                  default:
                         usage();                          usage();
                 }                  }
Line 485 
Line 492 
         if (optind == ac) {          if (optind == ac) {
                 /* No command specified - execute shell on a tty. */                  /* No command specified - execute shell on a tty. */
                 tty_flag = 1;                  tty_flag = 1;
                   if (subsystem_flag) {
                           fprintf(stderr, "You must specify a subsystem to invoke.");
                           usage();
                   }
         } else {          } else {
                 /* A command has been specified.  Store it into the                  /* A command has been specified.  Store it into the
                    buffer. */                     buffer. */
Line 949 
Line 960 
         if (len > 0) {          if (len > 0) {
                 if (len > 900)                  if (len > 900)
                         len = 900;                          len = 900;
                 debug("Sending command: %.*s", len, buffer_ptr(&command));                  if (subsystem_flag) {
                 channel_request_start(id, "exec", 0);                          debug("Sending subsystem: %.*s", len, buffer_ptr(&command));
                           channel_request_start(id, "subsystem", 0);
                   } else {
                           debug("Sending command: %.*s", len, buffer_ptr(&command));
                           channel_request_start(id, "exec", 0);
                   }
                 packet_put_string(buffer_ptr(&command), len);                  packet_put_string(buffer_ptr(&command), len);
                 packet_send();                  packet_send();
         } else {          } else {

Legend:
Removed from v.1.84  
changed lines
  Added in v.1.85