mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 713747 - Remove UniversalFoo from caps (and thus, the tree). r=bz
This commit is contained in:
parent
9adc1c9d8a
commit
f56195c7a3
@ -1088,19 +1088,6 @@ nsScriptSecurityManager::CheckSameOriginDOMProp(nsIPrincipal* aSubject,
|
||||
if (aObject == mSystemPrincipal)
|
||||
return NS_ERROR_DOM_PROP_ACCESS_DENIED;
|
||||
|
||||
/*
|
||||
* If we failed the origin tests it still might be the case that we
|
||||
* are a signed script and have permissions to do this operation.
|
||||
* Check for that here.
|
||||
*/
|
||||
bool capabilityEnabled = false;
|
||||
const char* cap = aAction == nsIXPCSecurityManager::ACCESS_SET_PROPERTY ?
|
||||
"UniversalBrowserWrite" : "UniversalBrowserRead";
|
||||
rv = IsCapabilityEnabled(cap, &capabilityEnabled);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (capabilityEnabled)
|
||||
return NS_OK;
|
||||
|
||||
/*
|
||||
** Access tests failed, so now report error.
|
||||
*/
|
||||
@ -1321,7 +1308,7 @@ nsScriptSecurityManager::CheckLoadURIFromScript(JSContext *cx, nsIURI *aURI)
|
||||
}
|
||||
|
||||
// See if we're attempting to load a file: URI. If so, let a
|
||||
// UniversalFileRead capability trump the above check.
|
||||
// UniversalXPConnect capability trump the above check.
|
||||
bool isFile = false;
|
||||
bool isRes = false;
|
||||
if (NS_FAILED(aURI->SchemeIs("file", &isFile)) ||
|
||||
@ -1330,7 +1317,7 @@ nsScriptSecurityManager::CheckLoadURIFromScript(JSContext *cx, nsIURI *aURI)
|
||||
if (isFile || isRes)
|
||||
{
|
||||
bool enabled;
|
||||
if (NS_FAILED(IsCapabilityEnabled("UniversalFileRead", &enabled)))
|
||||
if (NS_FAILED(IsCapabilityEnabled("UniversalXPConnect", &enabled)))
|
||||
return NS_ERROR_FAILURE;
|
||||
if (enabled)
|
||||
return NS_OK;
|
||||
|
@ -153,9 +153,4 @@ ProtocolFlagError = Warning: Protocol handler for '%S' doesn't advertise a secur
|
||||
#
|
||||
# The following descriptions are shown in the EnableCapabilityQuery dialog
|
||||
#
|
||||
capdesc.UniversalBrowserRead = Read private data from any site or window
|
||||
capdesc.UniversalBrowserWrite = Modify any open window
|
||||
capdesc.UniversalXPConnect = Run or install software on your machine
|
||||
capdesc.UniversalFileRead = Read and upload local files
|
||||
capdesc.UniversalPreferencesRead = Read program settings
|
||||
capdesc.UniversalPreferencesWrite = Modify program settings
|
||||
|
Loading…
Reference in New Issue
Block a user