File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
lib/private/Files/Storage Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 16191619 */
16201620'minimum.supported.desktop.version ' => '2.0.0 ' ,
16211621
1622+ /**
1623+ * Option to allow local storage to contain symlinks.
1624+ * WARNING: Not recommended. This would make it possible for Nextcloud to access
1625+ * files outside the data directory and could be considered a security risk.
1626+ *
1627+ * Defaults to ``false``
1628+ */
1629+ 'localstorage.allowsymlinks ' => false ,
1630+
16221631/**
16231632 * EXPERIMENTAL: option whether to include external storage in quota
16241633 * calculation, defaults to false.
Original file line number Diff line number Diff line change @@ -58,8 +58,6 @@ class Local extends \OC\Files\Storage\Common {
5858
5959 protected $ dataDirLength ;
6060
61- protected $ allowSymlinks = false ;
62-
6361 protected $ realDataDir ;
6462
6563 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