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

Diff for /src/usr.bin/ssh/channels.c between version 1.422 and 1.423

version 1.422, 2023/01/06 02:38:23 version 1.423, 2023/01/06 02:39:59
Line 1210 
Line 1210 
         return 1;          return 1;
 }  }
   
   void
   channel_force_close(struct ssh *ssh, Channel *c, int abandon)
   {
           debug3_f("channel %d: forcibly closing", c->self);
           if (c->istate == CHAN_INPUT_OPEN)
                   chan_read_failed(ssh, c);
           if (c->istate == CHAN_INPUT_WAIT_DRAIN) {
                   sshbuf_reset(c->input);
                   chan_ibuf_empty(ssh, c);
           }
           if (c->ostate == CHAN_OUTPUT_OPEN ||
               c->ostate == CHAN_OUTPUT_WAIT_DRAIN) {
                   sshbuf_reset(c->output);
                   chan_write_failed(ssh, c);
           }
           if (c->detach_user)
                   c->detach_user(ssh, c->self, 1, NULL);
           if (c->efd != -1)
                   channel_close_fd(ssh, c, &c->efd);
           if (abandon)
                   c->type = SSH_CHANNEL_ABANDONED;
   }
   
 static void  static void
 channel_pre_x11_open(struct ssh *ssh, Channel *c)  channel_pre_x11_open(struct ssh *ssh, Channel *c)
 {  {
Line 1221 
Line 1244 
                 c->type = SSH_CHANNEL_OPEN;                  c->type = SSH_CHANNEL_OPEN;
                 channel_pre_open(ssh, c);                  channel_pre_open(ssh, c);
         } else if (ret == -1) {          } else if (ret == -1) {
                 logit("X11 connection rejected because of wrong authentication.");                  logit("X11 connection rejected because of wrong "
                       "authentication.");
                 debug2("X11 rejected %d i%d/o%d",                  debug2("X11 rejected %d i%d/o%d",
                     c->self, c->istate, c->ostate);                      c->self, c->istate, c->ostate);
                 chan_read_failed(ssh, c);                  channel_force_close(ssh, c, 0);
                 sshbuf_reset(c->input);  
                 chan_ibuf_empty(ssh, c);  
                 sshbuf_reset(c->output);  
                 chan_write_failed(ssh, c);  
                 debug2("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate);  
         }          }
 }  }
   
Line 1579 
Line 1598 
 rdynamic_close(struct ssh *ssh, Channel *c)  rdynamic_close(struct ssh *ssh, Channel *c)
 {  {
         c->type = SSH_CHANNEL_OPEN;          c->type = SSH_CHANNEL_OPEN;
         chan_read_failed(ssh, c);          channel_force_close(ssh, c, 0);
         sshbuf_reset(c->input);  
         chan_ibuf_empty(ssh, c);  
         sshbuf_reset(c->output);  
         chan_write_failed(ssh, c);  
 }  }
   
 /* reverse dynamic port forwarding */  /* reverse dynamic port forwarding */
Line 2353 
Line 2368 
                         return;                          return;
   
                 debug2("channel %d: gc: notify user", c->self);                  debug2("channel %d: gc: notify user", c->self);
                 c->detach_user(ssh, c->self, NULL);                  c->detach_user(ssh, c->self, 0, NULL);
                 /* if we still have a callback */                  /* if we still have a callback */
                 if (c->detach_user != NULL)                  if (c->detach_user != NULL)
                         return;                          return;

Legend:
Removed from v.1.422  
changed lines
  Added in v.1.423