Implement doPrivileged() method in a trivial way, such that privileges are
not actually checked or set. git-svn-id: svn://10.0.0.236/trunk@18095 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "java_security_AccessController.h"
|
||||
#include "prprf.h"
|
||||
#include "JavaVM.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -69,7 +70,22 @@ Netscape_Java_java_security_AccessController_getStackAccessControlContext()
|
||||
{
|
||||
PR_fprintf(PR_STDERR, "Netscape_Java_java_security_AccessController_getStackAccessControlContext not implemented\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class : java/security/AccessController
|
||||
* Method : doPrivileged
|
||||
* Signature : (Ljava/security/PrivilegedAction;)Ljava/lang/Object;
|
||||
*/
|
||||
NS_EXPORT NS_NATIVECALL(Java_java_lang_Object *)
|
||||
Netscape_Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2(Java_java_security_PrivilegedAction *inAction)
|
||||
{
|
||||
JavaObject *action = (JavaObject *) inAction;
|
||||
Class &clazz = *const_cast<Class*>(&action->getClass());
|
||||
Method &run_method = clazz.getMethod("run", NULL, 0);
|
||||
|
||||
// Invoke run() method on interface, but don't bother with security
|
||||
return (Java_java_lang_Object *)run_method.invoke(action, NULL, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user