fix smb streamwrapper on non existing files

This commit is contained in:
Robin Appelman 2013-10-01 22:18:03 +02:00
parent 5ade595911
commit ea6115bfaa

View file

@ -181,6 +181,8 @@ class smb {
return false;
}elseif(substr($regs[0],0,31)=='NT_STATUS_OBJECT_PATH_NOT_FOUND'){
return false;
}elseif(substr($regs[0],0,31)=='NT_STATUS_OBJECT_NAME_NOT_FOUND'){
return false;
}elseif(substr($regs[0],0,29)=='NT_STATUS_FILE_IS_A_DIRECTORY'){
return false;
}
@ -430,7 +432,10 @@ class smb_stream_wrapper extends smb {
case 'rb':
case 'a':
case 'a+': $this->tmpfile = tempnam('/tmp', 'smb.down.');
smb::execute ('get "'.$pu['path'].'" "'.$this->tmpfile.'"', $pu);
$result = smb::execute ('get "'.$pu['path'].'" "'.$this->tmpfile.'"', $pu);
if($result === false){
return $result;
}
break;
case 'w':
case 'w+':