diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-26 10:49:12 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-26 10:49:12 +0100 |
commit | 62d7885c3b13d7d2acf33f80e91016a82cc8a7c0 (patch) | |
tree | ad5a60fea2bc3db8ed813f8b1e149d5a35b27009 /lib/private/share20 | |
parent | e9237dd83ce50091274a52335846eb03f1694bb0 (diff) | |
parent | 8213d5df4f40410f851da31082bbb1fb8d84dd1e (diff) | |
download | nextcloud-server-62d7885c3b13d7d2acf33f80e91016a82cc8a7c0.tar.gz nextcloud-server-62d7885c3b13d7d2acf33f80e91016a82cc8a7c0.zip |
Merge pull request #22660 from owncloud/fix_22656
Do not allow sharing of the users root folder
Diffstat (limited to 'lib/private/share20')
-rw-r--r-- | lib/private/share20/manager.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php index 214126e3414..6932360a7e9 100644 --- a/lib/private/share20/manager.php +++ b/lib/private/share20/manager.php @@ -197,6 +197,11 @@ class Manager implements IManager { throw new \InvalidArgumentException('Path should be either a file or a folder'); } + // And you can't share your rootfolder + if ($this->rootFolder->getUserFolder($share->getSharedBy())->isSubNode($share->getNode()) === false) { + throw new \InvalidArgumentException('You can\'t share your root folder'); + } + // Check if we actually have share permissions if (!$share->getNode()->isShareable()) { $message_t = $this->l->t('You are not allowed to share %s', [$share->getNode()->getPath()]); |