Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Java permissions

Re: Java permissions

From: Jeremy <newspostings_at_hazelweb.co.uk>
Date: Sun, 13 Jun 2004 12:36:10 +0100
Message-ID: <MPG.1b364c77c0a83234989c5b@news.individual.net>


In article <dAEyc.63309$tI2.44392_at_fed1read07>, anacedent says...
> Jeremy wrote:
>
> > On Oracle 8i, by default, java permissions can only be granted by SYS it
> > seems - what prviliege or role wouldi have to grant to a user to enable
> > that user to be able to grant java permissions?
> >
> > If it makes any difference, the specific grants I wish to be able to
> > make from the non-SYS user is
> >
> > java.io.FilePermission
> >
> > and I want the user to be able to grant this permission to itself.
> >
> > Is this doable?
> >
> > cheers
> >
> >
> HUH?
> >I want the user to be able to grant this permission to itself
> This statement make little to no sense.
>
> "permissions" are granted by the schema (owner) on objects
> they own to either ROLES or other schemas.
>
> GRANT EXECUTE ON java.io.FilePermission TO <SCHEMA_NAME OR ROLE>;
>

This doesn't solve the problem - if I use what you wrote above I get

12:24:53 SQL> GRANT EXECUTE ON java.io.FilePermission TO wd; GRANT EXECUTE ON java.io.FilePermission TO wd

                        *

ERROR at line 1:
ORA-00905: missing keyword

(wd is a database user)

The problem is that we have a process which creates a new directory on the server and we have a java stored procedure that needs to be able to write all files in the new directory. At the moment we issue from SYS by hand:

 begin
   dbms_java.grant_permission

             ('WD',
             'java.io.FilePermission',
             '/usr/documents/newdocdir/*',
             'read,write,execute,delete');
 end;
/

Until we issue this, the jsp cannot write a file into the directory. What I want to achieve is that the above dbms_java.grant_permission call be made by the user 'wd'.

If I grant execute on dbms_java to wd, when I run the procedure which uses dbms_java I get:

ORA-29532: Java call terminated by uncaught Java exception: java.lang.SecurityException: policy table update SYS:java.io.FilePermission, /usr/documents/newdocdir/*

ORA-06512: at "SYS.DBMS_JAVA", line 0
ORA-06512: at "WD.WD_SC_BO", line 7516
ORA-06512: at "WD.WD_SC_BO", line 40
ORA-06512: at line 10

Any help appreciated with this!

-- 

jeremy
Received on Sun Jun 13 2004 - 06:36:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US