From: Jesus Macias Date: Fri, 5 Sep 2014 11:23:09 +0000 (+0200) Subject: Backport issue 10764 X-Git-Tag: v7.0.3alpha1~101^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7bd4f6cac59b73cb7c14c057d6ee66d04c5c1a28;p=nextcloud-server.git Backport issue 10764 --- diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 44e44adfd2e..baf765d4070 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -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;