[Pkg-owncloud-commits] [owncloud-client] 83/470: Don't make files read-only when server is too old #4450

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:24:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit a9b00a7489ed3e3e11d3363a044c302f41f0fd13
Author: Christian Kamm <mail at ckamm.de>
Date:   Tue Mar 1 10:11:20 2016 +0100

    Don't make files read-only when server is too old #4450
---
 src/libsync/propagatedownload.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp
index dfc2795..00a17bb 100644
--- a/src/libsync/propagatedownload.cpp
+++ b/src/libsync/propagatedownload.cpp
@@ -691,8 +691,13 @@ void PropagateDownloadFileQNAM::downloadFinished()
     }
 
     // Apply the remote permissions
-    FileSystem::setFileReadOnlyWeak(_tmpFile.fileName(),
-                                    !_item->_remotePerm.contains('W'));
+    // Older server versions sometimes provide empty remote permissions
+    // see #4450 - don't adjust the write permissions there.
+    const int serverVersionGoodRemotePerm = 0x070000; // 7.0.0
+    if (_propagator->account()->serverVersionInt() >= serverVersionGoodRemotePerm) {
+        FileSystem::setFileReadOnlyWeak(_tmpFile.fileName(),
+                                        !_item->_remotePerm.contains('W'));
+    }
 
     QString error;
     _propagator->addTouchedFile(fn);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list