RE: dbms_java: grant_permission and revoke_permission only take effect after database restart

From: <dimensional.dba_at_comcast.net>
Date: Mon, 15 Mar 2021 12:30:34 -0700
Message-ID: <139201d719d1$abbe1760$033a4620$_at_comcast.net>



Normally you just need to log out of your session and log back in.    

From: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> On Behalf Of ahmed.fikri_at_t-online.de Sent: Monday, March 15, 2021 12:10 PM
To: list, oracle <oracle-l_at_freelists.org> Subject: dbms_java: grant_permission and revoke_permission only take effect after database restart  

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:30:34 CET

Original text of this message