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

Diff for /src/usr.bin/ssh/session.c between version 1.63 and 1.64

version 1.63, 2001/03/20 19:21:21 version 1.64, 2001/03/20 19:35:29
Line 65 
Line 65 
 struct Session {  struct Session {
         int     used;          int     used;
         int     self;          int     self;
         int     extended;  
         struct  passwd *pw;          struct  passwd *pw;
         pid_t   pid;          pid_t   pid;
         /* tty */          /* tty */
Line 81 
Line 80 
         int     single_connection;          int     single_connection;
         /* proto 2 */          /* proto 2 */
         int     chanid;          int     chanid;
           int     is_subsystem;
 };  };
   
 /* func */  /* func */
Line 505 
Line 505 
         close(perr[1]);          close(perr[1]);
   
         if (compat20) {          if (compat20) {
                 session_set_fds(s, pin[1], pout[0], s->extended ? perr[0] : -1);                  session_set_fds(s, pin[1], pout[0], s->is_subsystem ? -1 : perr[0]);
         } else {          } else {
                 /* Enter the interactive session. */                  /* Enter the interactive session. */
                 server_loop(pid, pin[1], pout[0], perr[0]);                  server_loop(pid, pin[1], pout[0], perr[0]);
                 /* server_loop has closed pin[1], pout[1], and perr[1]. */                  /* server_loop has closed pin[1], pout[0], and perr[0]. */
         }          }
 #else /* USE_PIPES */  #else /* USE_PIPES */
         /* We are the parent.  Close the child sides of the socket pairs. */          /* We are the parent.  Close the child sides of the socket pairs. */
Line 521 
Line 521 
          * handle the case that fdin and fdout are the same.           * handle the case that fdin and fdout are the same.
          */           */
         if (compat20) {          if (compat20) {
                 session_set_fds(s, inout[1], inout[1], s->extended ? err[1] : -1);                  session_set_fds(s, inout[1], inout[1], s->is_subsystem ? -1 : err[1]);
         } else {          } else {
                 server_loop(pid, inout[1], inout[1], err[1]);                  server_loop(pid, inout[1], inout[1], err[1]);
                 /* server_loop has closed inout[1] and err[1]. */                  /* server_loop has closed inout[1] and err[1]. */
Line 1171 
Line 1171 
                 Session *s = &sessions[i];                  Session *s = &sessions[i];
                 if (! s->used) {                  if (! s->used) {
                         s->pid = 0;                          s->pid = 0;
                         s->extended = 0;                          s->is_subsystem = 0;
                         s->chanid = -1;                          s->chanid = -1;
                         s->ptyfd = -1;                          s->ptyfd = -1;
                         s->ttyfd = -1;                          s->ttyfd = -1;
Line 1328 
Line 1328 
         for (i = 0; i < options.num_subsystems; i++) {          for (i = 0; i < options.num_subsystems; i++) {
                 if(strcmp(subsys, options.subsystem_name[i]) == 0) {                  if(strcmp(subsys, options.subsystem_name[i]) == 0) {
                         debug("subsystem: exec() %s", options.subsystem_command[i]);                          debug("subsystem: exec() %s", options.subsystem_command[i]);
                           s->is_subsystem = 1;
                         do_exec_no_pty(s, options.subsystem_command[i]);                          do_exec_no_pty(s, options.subsystem_command[i]);
                         success = 1;                          success = 1;
                 }                  }
Line 1402 
Line 1403 
         /* if forced_command == NULL, the shell is execed */          /* if forced_command == NULL, the shell is execed */
         char *shell = forced_command;          char *shell = forced_command;
         packet_done();          packet_done();
         s->extended = 1;  
         if (s->ttyfd == -1)          if (s->ttyfd == -1)
                 do_exec_no_pty(s, shell);                  do_exec_no_pty(s, shell);
         else          else
Line 1421 
Line 1421 
                 command = forced_command;                  command = forced_command;
                 debug("Forced command '%.500s'", forced_command);                  debug("Forced command '%.500s'", forced_command);
         }          }
         s->extended = 1;  
         if (s->ttyfd == -1)          if (s->ttyfd == -1)
                 do_exec_no_pty(s, command);                  do_exec_no_pty(s, command);
         else          else
Line 1472 
Line 1471 
             s->self, id, rtype, reply);              s->self, id, rtype, reply);
   
         /*          /*
          * a session is in LARVAL state until a shell           * a session is in LARVAL state until a shell, a command
          * or programm is executed           * or a subsystem is executed
          */           */
         if (c->type == SSH_CHANNEL_LARVAL) {          if (c->type == SSH_CHANNEL_LARVAL) {
                 if (strcmp(rtype, "shell") == 0) {                  if (strcmp(rtype, "shell") == 0) {

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64