]> source.dussan.org Git - nextcloud-server.git/commitdiff
Backport issue 10764
authorJesus Macias <jmacias@full-on-net.com>
Fri, 5 Sep 2014 11:23:09 +0000 (13:23 +0200)
committerJesus Macias <jmacias@full-on-net.com>
Fri, 5 Sep 2014 11:23:09 +0000 (13:23 +0200)
lib/private/files/view.php

index 44e44adfd2e2f382f405c7b14ce6d223c9e8c23b..baf765d407062fc30518b0812d043df628c48049 100644 (file)
@@ -304,7 +304,13 @@ class View {
                        $hooks[] = 'write';
                }
                $result = $this->basicOperation('touch', $path, $hooks, $mtime);
-               if (!$result) { //if native touch fails, we emulate it by changing the mtime in the cache
+               if (!$result) {
+                       // If create file fails because of permissions on external storage like SMB folders,
+                       // check file exists and return false if not.
+                       if(!$this->file_exists($path)){
+                               return false;
+                       }
+                       //if native touch fails, we emulate it by changing the mtime in the cache
                        $this->putFileInfo($path, array('mtime' => $mtime));
                }
                return true;