mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-13 09:37:37 +01:00
SSH2: close channel and break after exit-signal
Prior to efdec7b118
exit-signal's would re-use exit-status's channel closing code. after that commit, however, exit-status specific code was added, which meant that falling through, without the break, broke things
This commit is contained in:
parent
3c39e89bf8
commit
d79ce65fe3
@ -2694,6 +2694,13 @@ class Net_SSH2 {
|
|||||||
if ($length) {
|
if ($length) {
|
||||||
$this->errors[count($this->errors)].= "\r\n" . $this->_string_shift($response, $length);
|
$this->errors[count($this->errors)].= "\r\n" . $this->_string_shift($response, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_EOF, $this->server_channels[$client_channel]));
|
||||||
|
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
|
||||||
|
|
||||||
|
$this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_EOF;
|
||||||
|
|
||||||
|
break;
|
||||||
case 'exit-status':
|
case 'exit-status':
|
||||||
extract(unpack('Cfalse/Nexit_status', $this->_string_shift($response, 5)));
|
extract(unpack('Cfalse/Nexit_status', $this->_string_shift($response, 5)));
|
||||||
$this->exit_status = $exit_status;
|
$this->exit_status = $exit_status;
|
||||||
@ -2703,6 +2710,8 @@ class Net_SSH2 {
|
|||||||
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
|
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
|
||||||
|
|
||||||
$this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_EOF;
|
$this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_EOF;
|
||||||
|
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// "Some systems may not implement signals, in which case they SHOULD ignore this message."
|
// "Some systems may not implement signals, in which case they SHOULD ignore this message."
|
||||||
// -- http://tools.ietf.org/html/rfc4254#section-6.9
|
// -- http://tools.ietf.org/html/rfc4254#section-6.9
|
||||||
|
Loading…
Reference in New Issue
Block a user