SSH2: check response in exec()

This commit is contained in:
terrafrost 2013-05-08 11:44:34 -05:00
parent 63ec6e2055
commit b440708a7b

View File

@ -2084,6 +2084,11 @@ class Net_SSH2 {
if ($response === false) {
return false;
}
if (ord($response[0]) != NET_SSH2_MSG_CHANNEL_SUCCESS) {
user_error('exec call refused');
return;
}
$this->channel_status[NET_SSH2_CHANNEL_EXEC] = NET_SSH2_MSG_CHANNEL_DATA;