Bug 1413868.

This commit is contained in:
wolfbeast 2018-06-30 18:34:19 +02:00 committed by Roy Tam
commit c180f85048
8 changed files with 466 additions and 0 deletions

View file

@ -46,6 +46,7 @@
#include "prproces.h"
#include "prlink.h"
#include "mozilla/FilePreferences.h"
#include "mozilla/Mutex.h"
#include "SpecialSystemDirectory.h"
@ -1167,6 +1168,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;
}
@ -1979,6 +1984,10 @@ nsLocalFile::CopySingleFile(nsIFile* aSourceFile, nsIFile* aDestParent,
}
}
if (FilePreferences::IsBlockedUNCPath(destPath)) {
return NS_ERROR_FILE_ACCESS_DENIED;
}
if (!move) {
copyOK = ::CopyFileExW(filePath.get(), destPath.get(), nullptr,
nullptr, nullptr, dwCopyFlags);