diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-30 18:34:19 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-30 18:34:19 +0200 |
commit | fdc6f820ca5e4b2832a0208e2a183fb1d6f8b45f (patch) | |
tree | 755b63ee019ebc289e3dcfcb0e7bbeec2931b48c /xpcom/io/nsLocalFileWin.cpp | |
parent | 92a7dcc5b77e4f78ad97cc9e8b870f9635422c6c (diff) | |
download | UXP-fdc6f820ca5e4b2832a0208e2a183fb1d6f8b45f.tar UXP-fdc6f820ca5e4b2832a0208e2a183fb1d6f8b45f.tar.gz UXP-fdc6f820ca5e4b2832a0208e2a183fb1d6f8b45f.tar.lz UXP-fdc6f820ca5e4b2832a0208e2a183fb1d6f8b45f.tar.xz UXP-fdc6f820ca5e4b2832a0208e2a183fb1d6f8b45f.zip |
Bug 1413868.
Diffstat (limited to 'xpcom/io/nsLocalFileWin.cpp')
-rw-r--r-- | xpcom/io/nsLocalFileWin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 66e267807..5a72c750c 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -45,6 +45,7 @@ #include "prproces.h" #include "prlink.h" +#include "mozilla/FilePreferences.h" #include "mozilla/Mutex.h" #include "SpecialSystemDirectory.h" @@ -1166,6 +1167,10 @@ nsLocalFile::InitWithPath(const nsAString& aFilePath) return NS_ERROR_FILE_UNRECOGNIZED_PATH; } + if (FilePreferences::IsBlockedUNCPath(aFilePath)) { + return NS_ERROR_FILE_ACCESS_DENIED; + } + if (secondChar != L':' && (secondChar != L'\\' || firstChar != L'\\')) { return NS_ERROR_FILE_UNRECOGNIZED_PATH; } @@ -1976,6 +1981,10 @@ nsLocalFile::CopySingleFile(nsIFile* aSourceFile, nsIFile* aDestParent, dwCopyFlags |= COPY_FILE_NO_BUFFERING; } + if (FilePreferences::IsBlockedUNCPath(destPath)) { + return NS_ERROR_FILE_ACCESS_DENIED; + } + if (!move) { copyOK = ::CopyFileExW(filePath.get(), destPath.get(), nullptr, nullptr, nullptr, dwCopyFlags); |