Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-11-12 18:51:51 +0400
committerBjoern Schiessle <schiessle@owncloud.com>2013-11-12 18:51:51 +0400
commit894856ce01daa5fd1e6a8b7dd3a62a41bd24df42 (patch)
treeddccbd6967bdc1310a3fb1b29811a4f8e0a933cb /apps
parenta745901d50c67728c0a8b7f0a8820ebd6992bad6 (diff)
make sure that we keep the correct timestamp and etag after encryoption/decryption
Diffstat (limited to 'apps')
-rw-r--r--apps/files_encryption/lib/util.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 5e855abd973..5800d3ed108 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -717,17 +717,17 @@ class Util {
// Encrypt unencrypted files
foreach ($found['encrypted'] as $encryptedFile) {
- //get file info
- $fileInfo = \OC\Files\Filesystem::getFileInfo($encryptedFile['path']);
-
//relative to data/<user>/file
$relPath = Helper::stripUserFilesPath($encryptedFile['path']);
+ //get file info
+ $fileInfo = \OC\Files\Filesystem::getFileInfo($relPath);
+
//relative to /data
$rawPath = $encryptedFile['path'];
//get timestamp
- $timestamp = $this->view->filemtime($rawPath);
+ $timestamp = $fileInfo['mtime'];
//enable proxy to use OC\Files\View to access the original file
\OC_FileProxy::$enabled = true;
@@ -768,10 +768,10 @@ class Util {
$this->view->rename($relPath . '.part', $relPath);
- $this->view->chroot($fakeRoot);
-
//set timestamp
- $this->view->touch($rawPath, $timestamp);
+ $this->view->touch($relPath, $timestamp);
+
+ $this->view->chroot($fakeRoot);
// Add the file to the cache
\OC\Files\Filesystem::putFileInfo($relPath, array(
@@ -839,7 +839,7 @@ class Util {
$rawPath = '/' . $this->userId . '/files/' . $plainFile['path'];
// keep timestamp
- $timestamp = $this->view->filemtime($rawPath);
+ $timestamp = $fileInfo['mtime'];
// Open plain file handle for binary reading
$plainHandle = $this->view->fopen($rawPath, 'rb');
@@ -858,10 +858,10 @@ class Util {
$this->view->rename($relPath . '.part', $relPath);
- $this->view->chroot($fakeRoot);
-
// set timestamp
- $this->view->touch($rawPath, $timestamp);
+ $this->view->touch($relPath, $timestamp);
+
+ $this->view->chroot($fakeRoot);
// Add the file to the cache
\OC\Files\Filesystem::putFileInfo($relPath, array(