mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 21:46:03 +03:00
Do not open the share dialog if the user tries to share the root folder
This commit is contained in:
parent
fea997c84a
commit
6f498aea3b
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue