mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1174113 - QuotaManager: Origin initialization fails on moz-safe-about+++home; r=bent
This commit is contained in:
parent
8eb49e6e81
commit
358e071116
Binary file not shown.
@ -4548,20 +4548,37 @@ StorageDirectoryHelper::CreateOrUpgradeMetadataFiles(bool aCreate)
|
||||
nsCOMPtr<nsIFile> originDir = do_QueryInterface(entry);
|
||||
MOZ_ASSERT(originDir);
|
||||
|
||||
nsString leafName;
|
||||
rv = originDir->GetLeafName(leafName);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool isDirectory;
|
||||
rv = originDir->IsDirectory(&isDirectory);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
if (!isDirectory) {
|
||||
nsString leafName;
|
||||
rv = originDir->GetLeafName(leafName);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (isDirectory) {
|
||||
if (leafName.EqualsLiteral("moz-safe-about+++home")) {
|
||||
// This directory was accidentally created by a buggy nightly and can
|
||||
// be safely removed.
|
||||
|
||||
QM_WARNING("Deleting accidental moz-safe-about+++home directory!");
|
||||
|
||||
rv = originDir->Remove(/* aRecursive */ true);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (!leafName.EqualsLiteral(DSSTORE_FILE_NAME)) {
|
||||
NS_WARNING("Something in the storage directory that doesn't belong!");
|
||||
QM_WARNING("Something (%s) in the storage directory that doesn't belong!",
|
||||
NS_ConvertUTF16toUTF8(leafName).get());
|
||||
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user