summaryrefslogtreecommitdiff
path: root/dom/filesystem/GetDirectoryListingTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/filesystem/GetDirectoryListingTask.cpp')
-rw-r--r--dom/filesystem/GetDirectoryListingTask.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/dom/filesystem/GetDirectoryListingTask.cpp b/dom/filesystem/GetDirectoryListingTask.cpp
index 1d4f77b3b8..8fdfb4a5bb 100644
--- a/dom/filesystem/GetDirectoryListingTask.cpp
+++ b/dom/filesystem/GetDirectoryListingTask.cpp
@@ -340,9 +340,14 @@ GetDirectoryListingTaskParent::IOWork()
nsCOMPtr<nsIFile> currFile = do_QueryInterface(supp);
MOZ_ASSERT(currFile);
- bool isSpecial, isFile;
- if (NS_WARN_IF(NS_FAILED(currFile->IsSpecial(&isSpecial))) ||
- isSpecial) {
+ bool isLink, isSpecial, isFile;
+ if (NS_WARN_IF(NS_FAILED(currFile->IsSymlink(&isLink)) ||
+ NS_FAILED(currFile->IsSpecial(&isSpecial))) ||
+ // Although we allow explicit individual selection of symlinks via the
+ // file picker, we do not process symlinks in directory traversal. Our
+ // specific policy decision is documented at
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1813299#c20
+ isLink || isSpecial) {
continue;
}
if (NS_WARN_IF(NS_FAILED(currFile->IsFile(&isFile)) ||