dbms_java: grant_permission and revoke_permission only take effect after database restart

From: <ahmed.fikri_at_t-online.de>
Date: Mon, 15 Mar 2021 20:10:25 +0100 (CET)
Message-ID: <1615835425646.1662291.5cca4661160f9be55b21d5509f9ed76e1699a5f1_at_spica.telekom.de>



Hi all,  

does dbms_java.grant_permission requires a database restart?  

as sys I did following:  

BEGIN
dbms_java.revoke_permission( 'MYUSER', 'SYS:java.io.FilePermission', '/tmp/dummy/*', 'read' );
END;   SELECT * FROM dba_java_policy WHERE NAME LIKE '/%' AND grantee = 'MYUSER' shows that the permission is granted.  

as MYUSER  

I run this:  

DECLARE
v_name VARCHAR2(333):= '/tmp/dummy/myjar.jar';

BEGIN
dbms_java.loadjava( v_name);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLERRM);

END;   I get following error:
ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.io.FilePermission /tmp/dummy/s.jar read) has not been granted to MYUSER. The PL/SQL to grant this is dbms_java.grant_permission( 'MYUSER', 'SYS:java.io.FilePermission', '/tmp/dummy/myjar.jar', 'read' )  

after restarting the database it works.  

I wonder that but does really dbms_java.grant_permission requires a database restart?  

Best regards
Ahmed


--
http://www.freelists.org/webpage/oracle-l
Received on Mon Mar 15 2021 - 20:10:25 CET

Original text of this message