Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,15 @@
*/
'minimum.supported.desktop.version' => '2.0.0',

/**
* Option to allow local storage to contain symlinks.
* WARNING: Not recommended. This would make it possible for Nextcloud to access
* files outside the data directory and could be considered a security risk.
*
* Defaults to ``false``
*/
'localstorage.allowsymlinks' => false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should think about some convention for those configuration options.
We have camelCase, snake_case sometimes . 🙈


/**
* EXPERIMENTAL: option whether to include external storage in quota
* calculation, defaults to false.
Expand Down
5 changes: 2 additions & 3 deletions lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class Local extends \OC\Files\Storage\Common {

protected $dataDirLength;

protected $allowSymlinks = false;

protected $realDataDir;

public function __construct($arguments) {
Expand Down Expand Up @@ -441,7 +439,8 @@ public function getSourcePath($path) {

$fullPath = $this->datadir . $path;
$currentPath = $path;
if ($this->allowSymlinks || $currentPath === '') {
$allowSymlinks = \OC::$server->getConfig()->getSystemValue('localstorage.allowsymlinks', false);
if ($allowSymlinks || $currentPath === '') {
return $fullPath;
}
$pathToResolve = $fullPath;
Expand Down