java.policy permission question

Discussion in 'Java' started by Marcin Kasprzak, Mar 8, 2008.

  1. Hello,

    I wonder if anybody can explain me how to restrict access
    to filesystem for particular java aplication, this application
    still should have an access to JRE properties.

    I created following policy file "my.policy':
    grant {
    permission java.security.AllPermission;
    };

    and I tried to start my application like this:

    java -Djava.security.manager -Djava.security.policy==my.policy myApp

    but it did work myApp still could perform any filesystem I/O operation.

    Is it possible somehow to revoke rights to filesystem? Something like:
    grant {
    permission java.io.FilePermission "<<ALL FILES>>", "NONE";
    };

    if "NONE" was defined....

    Your input is highly welcomed.

    Regards,


    --
    Marcin Kasprzak
     
    Marcin Kasprzak, Mar 8, 2008
    #1
    1. Advertising

  2. Marcin Kasprzak wrote:
    > I wonder if anybody can explain me how to restrict access
    > to filesystem for particular java aplication, this application
    > still should have an access to JRE properties.
    >
    > I created following policy file "my.policy':
    > grant {
    > permission java.security.AllPermission;
    > };
    >
    > and I tried to start my application like this:
    >
    > java -Djava.security.manager -Djava.security.policy==my.policy myApp
    >
    > but it did work myApp still could perform any filesystem I/O operation.


    Why should granting all permissions prevent file IO ?

    Arne
     
    Arne Vajhøj, Mar 9, 2008
    #2
    1. Advertising

  3. > Why should granting all permissions prevent file IO ?

    Hello,
    You right, thanks man!

    Regards,


    --
    Marcin Kasprzak
     
    Marcin Kasprzak, Mar 9, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Terri I.
    Replies:
    0
    Views:
    1,149
    Terri I.
    Oct 20, 2003
  2. Ajay
    Replies:
    0
    Views:
    359
  3. Darol
    Replies:
    14
    Views:
    19,356
    Darol
    Aug 30, 2005
  4. Darren

    java.policy

    Darren, Sep 6, 2005, in forum: Java
    Replies:
    40
    Views:
    3,916
    Darren
    Sep 12, 2005
  5. Marcin Kasprzak

    java.security.manger policy question

    Marcin Kasprzak, Mar 9, 2008, in forum: Java
    Replies:
    4
    Views:
    335
    Marcin Kasprzak
    Mar 11, 2008
Loading...

Share This Page