Fix 18592 Fix example: XPCom components cannot be used under

r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@57748 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
norris%netscape.com
2000-01-14 00:03:46 +00:00
parent 31e256102c
commit 8b495ca37d
2 changed files with 11 additions and 14 deletions

View File

@@ -101,11 +101,11 @@ nsCodebasePrincipal::CanEnableCapability(const char *capability,
return NS_ERROR_FAILURE;
PRBool enabled;
if (NS_FAILED(prefs->GetBoolPref(pref, &enabled)) || !enabled) {
// Unless subject is executing from file:, return denied
// Deny unless subject is executing from file: or resource:
nsXPIDLCString scheme;
if (NS_FAILED(mURI->GetScheme(getter_Copies(scheme))) ||
PL_strcmp(scheme, "file") != 0 ||
PL_strcmp(scheme, "resource") != 0)
(PL_strcmp(scheme, "file") != 0 &&
PL_strcmp(scheme, "resource") != 0))
{
*result = nsIPrincipal::ENABLE_DENIED;
return NS_OK;