[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.89 and 1.90

version 1.89, 2001/06/13 09:10:31 version 1.90, 2001/06/19 12:34:09
Line 93 
Line 93 
 void    session_close(Session *s);  void    session_close(Session *s);
 void    do_exec_pty(Session *s, const char *command);  void    do_exec_pty(Session *s, const char *command);
 void    do_exec_no_pty(Session *s, const char *command);  void    do_exec_no_pty(Session *s, const char *command);
   void    do_exec(Session *s, const char *command);
 void    do_login(Session *s, const char *command);  void    do_login(Session *s, const char *command);
 void    do_child(Session *s, const char *command);  void    do_child(Session *s, const char *command);
 void    do_motd(void);  void    do_motd(void);
Line 270 
Line 271 
                                 command = NULL;                                  command = NULL;
                                 packet_integrity_check(plen, 0, type);                                  packet_integrity_check(plen, 0, type);
                         }                          }
                         if (forced_command != NULL) {                          do_exec(s, command);
                                 original_command = command;  
                                 command = forced_command;  
                                 debug("Forced command '%.500s'", forced_command);  
                         }  
                         if (s->ttyfd != -1)  
                                 do_exec_pty(s, command);  
                         else  
                                 do_exec_no_pty(s, command);  
                         if (command != NULL)  
                                 xfree(command);  
                         session_close(s);                          session_close(s);
                         return;                          return;
   
Line 504 
Line 495 
         }          }
 }  }
   
   /*
    * This is called to fork and execute a command.  If another command is
    * to be forced, execute that instead.
    */
   void
   do_exec(Session *s, const char *command)
   {
           if (forced_command) {
                   original_command = command;
                   command = forced_command;
                   forced_command = NULL;
                   debug("Forced command '%.900s'", command);
           }
   
           if (s->ttyfd != -1)
                   do_exec_pty(s, command);
           else
                   do_exec_no_pty(s, command);
   
           if (command != NULL)
                   xfree(command);
   
           if (original_command != NULL) {
                   xfree(original_command);
                   original_command = NULL;
           }
   }
   
   
 /* administrative, login(1)-like work */  /* administrative, login(1)-like work */
 void  void
 do_login(Session *s, const char *command)  do_login(Session *s, const char *command)
Line 1288 
Line 1308 
 int  int
 session_shell_req(Session *s)  session_shell_req(Session *s)
 {  {
         /* if forced_command == NULL, the shell is execed */  
         char *shell = forced_command;  
         packet_done();          packet_done();
         if (s->ttyfd == -1)          do_exec(s, NULL);
                 do_exec_no_pty(s, shell);  
         else  
                 do_exec_pty(s, shell);  
         return 1;          return 1;
 }  }
   
Line 1304 
Line 1319 
         u_int len;          u_int len;
         char *command = packet_get_string(&len);          char *command = packet_get_string(&len);
         packet_done();          packet_done();
         if (forced_command) {          do_exec(s, command);
                 original_command = command;  
                 command = forced_command;  
                 debug("Forced command '%.500s'", forced_command);  
         }  
         if (s->ttyfd == -1)  
                 do_exec_no_pty(s, command);  
         else  
                 do_exec_pty(s, command);  
         if (forced_command == NULL)  
                 xfree(command);  
         return 1;          return 1;
 }  }
   

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90