mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 817007 - Part 1: Remove <file> hack from the permission manager, r=ehsan
This commit is contained in:
parent
ac17bea4d9
commit
b851ab728f
@ -1439,19 +1439,6 @@ nsPermissionManager::GetPermissionHashKey(const nsACString& aHost,
|
||||
return entry;
|
||||
}
|
||||
|
||||
// If we haven't found an entry, depending on the host, we could try a bit
|
||||
// harder.
|
||||
// If this is a file:// URI, we can check for the presence of the magic entry
|
||||
// <file> which gives permission to all file://. This hack might disappear,
|
||||
// see bug 817007. Note that we don't require aExactHostMatch to be true for
|
||||
// that to keep retro-compatibility.
|
||||
// If this is not a file:// URI, and that aExactHostMatch wasn't true, we can
|
||||
// check if the base domain has a permission entry.
|
||||
|
||||
if (StringBeginsWith(aHost, NS_LITERAL_CSTRING("file://"))) {
|
||||
return GetPermissionHashKey(NS_LITERAL_CSTRING("<file>"), aAppId, aIsInBrowserElement, aType, true);
|
||||
}
|
||||
|
||||
// If aExactHostMatch wasn't true, we can check if the base domain has a permission entry.
|
||||
if (!aExactHostMatch) {
|
||||
nsCString domain = GetNextSubDomainForHost(aHost);
|
||||
|
@ -39,10 +39,4 @@ function run_test() {
|
||||
do_check_eq(pm.testPermissionFromPrincipal(principal, "test/local-files"), pm.UNKNOWN_ACTION);
|
||||
do_check_eq(pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
|
||||
do_check_eq(pm.testPermissionFromPrincipal(fileInDirPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
|
||||
|
||||
// Add the magic "<file>" permission and make sure all "file://" now have the permission.
|
||||
pm.addFromPrincipal(getPrincipalFromURIString("http://<file>"), "test/local-files", pm.ALLOW_ACTION, 0, 0);
|
||||
do_check_eq(pm.testPermissionFromPrincipal(principal, "test/local-files"), pm.ALLOW_ACTION);
|
||||
do_check_eq(pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"), pm.ALLOW_ACTION);
|
||||
do_check_eq(pm.testPermissionFromPrincipal(fileInDirPrincipal, "test/local-files"), pm.ALLOW_ACTION);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user