Bug 713747 - Remove UniversalFoo from caps (and thus, the tree). r=bz

This commit is contained in:
Bobby Holley 2011-12-30 09:35:52 -08:00
Родитель 8a5a48f99b
Коммит 2e6974baf6
2 изменённых файлов: 2 добавлений и 20 удалений

Просмотреть файл

@ -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