Bug 129503, "IsCapabilityEnabled should return PR_TRUE if no script on stack"

sr=brendan, r=mstoltz, a=asa
If the js stack has no principals on it, return PR_TRUE from IsCapabilityEnabled
.  Currently, the only time we'd have a stack devoid of principals is when all f
unctions are native.  If this assumption changes, this may need to be revisited
(depending on what it would mean to be a compiled script without a principal.)


git-svn-id: svn://10.0.0.236/trunk@116124 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rginda%netscape.com
2002-03-08 02:20:55 +00:00
parent c852febb82
commit f15bd8f764

View File

@@ -1668,6 +1668,12 @@ nsScriptSecurityManager::IsCapabilityEnabled(const char *capability,
if (*result)
return NS_OK;
} while ((fp = JS_FrameIterator(cx, &fp)) != nsnull);
if (!previousPrincipal)
{
// No principals on the stack, all native code. Allow execution.
*result = PR_TRUE;
}
return NS_OK;
}