From 4766a8927a02882767143b072e7f43b51b01f791 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 24 Sep 2017 23:51:47 +0200 Subject: [PATCH] added an additional hard limit to directory depth, just in case --- libretroshare/src/file_sharing/directory_updater.cc | 2 +- retroshare-gui/src/gui/settings/TransferPage.ui | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/file_sharing/directory_updater.cc b/libretroshare/src/file_sharing/directory_updater.cc index 5e1a9ca72..912cd6552 100644 --- a/libretroshare/src/file_sharing/directory_updater.cc +++ b/libretroshare/src/file_sharing/directory_updater.cc @@ -211,7 +211,7 @@ void LocalDirectoryUpdater::recursUpdateSharedDir(const std::string& cumulated_p case librs::util::FolderIterator::TYPE_DIR: - if(mMaxShareDepth > 0u && current_depth <= mMaxShareDepth) + if( (mMaxShareDepth > 0u && current_depth <= mMaxShareDepth) || (mMaxShareDepth==0 && current_depth < 64)) // 64 is here as a safe limit, to make loops impossible. subdirs.insert(dirIt.file_name()); #ifdef DEBUG_LOCAL_DIR_UPDATER diff --git a/retroshare-gui/src/gui/settings/TransferPage.ui b/retroshare-gui/src/gui/settings/TransferPage.ui index 31c07bfac..c68b1d4a5 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.ui +++ b/retroshare-gui/src/gui/settings/TransferPage.ui @@ -94,6 +94,9 @@ + + <html><head/><body><p>When following sybolic links, Retroshare can encounter the same directory/file more than once. If checked, this option will make tell Retroshare to silently ignore the file. This option saves Retroshare indexing against directory loops.</p></body></html> + Ignore duplicate files/directories @@ -102,7 +105,7 @@ - Maximum depth: + Maximum depth (0=unlimited): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -110,7 +113,11 @@ - + + + <html><head/><body><p>This value allows you to limit the depth of the directory hierarchy you are indexing, starting from the base directory. If you allow Retroshare to follow symbolic links and unchecked &quot;Ignore duplicate files/directories&quot;, this option will avoid that Retroshare loops indefinitly while parsing directories.</p></body></html> + +