[Pkg-owncloud-commits] [owncloud-client] 379/498: Do not open the share dialog if the user tries to share the root folder

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:08 UTC 2015


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 6f498aea3b379d65049645edfa7d4c8133e954a0
Author: Roeland Jago Douma <r.j.douma at uva.nl>
Date:   Fri Jul 24 10:02:18 2015 +0200

    Do not open the share dialog if the user tries to share the root folder
---
 src/gui/socketapi.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index 411458e..9e24fa6 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -420,6 +420,13 @@ void SocketApi::command_SHARE(const QString& localFile, QIODevice* socket)
         const QString folderForPath = shareFolder->path();
         const QString remotePath = shareFolder->remotePath() + localFile.right(localFile.count()-folderForPath.count()+1);
 
+        // Can't share root folder
+        if (QDir::cleanPath(remotePath) == "/") {
+           const QString message = QLatin1String("SHARE:CANNOTSHAREROOT:")+QDir::toNativeSeparators(localFile);
+            sendMessage(socket, message);
+            return;
+        }
+
         SyncJournalFileRecord rec = dbFileRecord_capi(shareFolder, localFile);
 
         bool allowReshare = true; // lets assume the good

-- 
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