]> source.dussan.org Git - nextcloud-server.git/commitdiff
clear statcache after fopen for smb
authorRobin Appelman <icewind@owncloud.com>
Tue, 15 Dec 2015 13:20:16 +0000 (14:20 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 15 Dec 2015 13:24:02 +0000 (14:24 +0100)
apps/files_external/lib/smb.php

index a94840ead59a4b1156429873defa32b471de9d14..80b44a4cbdf93a0296f97d430248ad6f1cbc38e6 100644 (file)
@@ -33,6 +33,7 @@ use Icewind\SMB\Exception\Exception;
 use Icewind\SMB\Exception\NotFoundException;
 use Icewind\SMB\NativeServer;
 use Icewind\SMB\Server;
+use Icewind\Streams\CallbackWrapper;
 use Icewind\Streams\IteratorDirectory;
 use OC\Files\Filesystem;
 
@@ -189,7 +190,10 @@ class SMB extends Common {
                                        return $this->share->read($fullPath);
                                case 'w':
                                case 'wb':
-                                       return $this->share->write($fullPath);
+                                       $source = $this->share->write($fullPath);
+                                       return CallBackWrapper::wrap($source, null, null, function () use ($fullPath) {
+                                               unset($this->statCache[$fullPath]);
+                                       });
                                case 'a':
                                case 'ab':
                                case 'r+':
@@ -219,7 +223,8 @@ class SMB extends Common {
                                        }
                                        $source = fopen($tmpFile, $mode);
                                        $share = $this->share;
-                                       return CallBackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) {
+                                       return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) {
+                                               unset($this->statCache[$fullPath]);
                                                $share->put($tmpFile, $fullPath);
                                                unlink($tmpFile);
                                        });