SCP: if exec() failed return false immediately

This commit is contained in:
terrafrost 2013-10-21 15:15:31 -05:00
parent 1e3ff81e7d
commit 5888c6cef6

View File

@ -170,7 +170,9 @@ class Net_SCP {
return false;
}
$this->ssh->exec('scp -t ' . $remote_file, false); // -t = to
if (!$this->ssh->exec('scp -t ' . $remote_file, false)) { // -t = to
return false;
}
$temp = $this->_receive();
if ($temp !== chr(0)) {
@ -239,7 +241,9 @@ class Net_SCP {
return false;
}
$this->ssh->exec('scp -f ' . $remote_file, false); // -f = from
if (!$this->ssh->exec('scp -f ' . $remote_file, false)) { // -f = from
return false;
}
$this->_send("\0");