]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix smb streamwrapper on non existing files
authorRobin Appelman <icewind@owncloud.com>
Tue, 1 Oct 2013 20:18:03 +0000 (22:18 +0200)
committerRobin Appelman <icewind@owncloud.com>
Tue, 1 Oct 2013 20:18:03 +0000 (22:18 +0200)
apps/files_external/3rdparty/smb4php/smb.php

index e7d1dfa09fec9ba8f42c3ba1f0290191231fd472..aec181a35097b1936f4077a56c6c833f963cc62f 100644 (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+':