File tree Expand file tree Collapse file tree
lib/private/Files/Storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 16031603 */
16041604'minimum.supported.desktop.version ' => '2.0.0 ' ,
16051605
1606+ /**
1607+ * Option to allow local storage to contain symlinks.
1608+ * WARNING: Not recommended. This would make it possible for Nextcloud to access
1609+ * files outside the data directory and could be considered a security risk.
1610+ *
1611+ * Defaults to ``false``
1612+ */
1613+ 'localstorage.allowsymlinks ' => false ,
1614+
16061615/**
16071616 * EXPERIMENTAL: option whether to include external storage in quota
16081617 * calculation, defaults to false.
Original file line number Diff line number Diff line change @@ -57,8 +57,6 @@ class Local extends \OC\Files\Storage\Common {
5757
5858 protected $ dataDirLength ;
5959
60- protected $ allowSymlinks = false ;
61-
6260 protected $ realDataDir ;
6361
6462 public function __construct ($ arguments ) {
@@ -441,7 +439,8 @@ public function getSourcePath($path) {
441439
442440 $ fullPath = $ this ->datadir . $ path ;
443441 $ currentPath = $ path ;
444- if ($ this ->allowSymlinks || $ currentPath === '' ) {
442+ $ allowSymlinks = \OC ::$ server ->getConfig ()->getSystemValue ('localstorage.allowsymlinks ' , false );
443+ if ($ allowSymlinks || $ currentPath === '' ) {
445444 return $ fullPath ;
446445 }
447446 $ pathToResolve = $ fullPath ;
You can’t perform that action at this time.
0 commit comments