# Re: 1.1* to 2.0 migration problem...

Marianne Mueller (Marianne.Mueller@eng.sun.com)
Tue, 4 May 1999 15:15:32 -0700 (PDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Gilles Roussel: "certreq Test problem"
- Previous message: Kevin Schnake: "Re: 1.1* to 2.0 migration problem..."
- Maybe in reply to: Kevin Schnake: "1.1* to 2.0 migration problem..."

    Message-Id: <199905042216.PAA01311@shorter.eng.sun.com>

    Date: Tue, 4 May 1999 15:15:32 -0700 (PDT)

    From: Marianne Mueller <Marianne.Mueller@eng.sun.com>

    Subject: Re: 1.1* to 2.0 migration problem...

    To: java-security@java.sun.com, Kevin.Schnake@wcom.com

Add this permission to your policy file

// let any code read and write properties
grant {
permission java.util.PropertyPermission *, "read", "write";
};

You should further refine that permission by only letting your code
(as specified by its URL) read and write the properties.

See

http://java.sun.com/products/jdk/1.2/docs/guide/security/permissions.html

for more info on permissions.

Also, see

http://java.sun.com/products/jdk/1.2/docs/guide/security/PolicyFiles.html

for more info on policy files.

Setting up a policy file is easy, although the syntax might
seem off putting at first. Once you get used to it you'll
agree it's much easier than having to deal with security managers.

On Solaris, the policy file is in ~/.java.policy. On win32,
the policy file is at c:\winnt\profiles\$username or
c:\windows\profiles\$username

As for the RMI security manager - I don't think it's involved here. I think
you would run into this exception in any case.

> Date: Tue, 04 May 1999 15:14:50 -0600
> From: Kevin Schnake <Kevin.Schnake@wcom.com>
> Subject: Re: 1.1* to 2.0 migration problem...
> To: java-security@java.sun.com
> MIME-version: 1.0
> Content-transfer-encoding: 7bit
>
> Also I'm using the RMI sercurity manager - I suspect if not for this security
> manager the default would ofcourse be no security check and I would be ok. So
> the question here is do I have to implement a user security policy to enable
> permissions for all of my stuff when I use the RMI Security Manager?
>
> Kevin.
>
> Kevin Schnake wrote:
>
> > Hey,
> >
> > I've just migrated from 1.1.6 to 1.2.1 . When running, I get the
> > following exception:
> >
> > Exception in thread "main" java.lang.ExceptionInInitializerError:
> > java.security.AccessCon
> > trolException: access denied (java.util.PropertyPermission * read,write)
> >
> > at java.security.AccessControlContext.checkPermission(Compiled
> > Code)
> > at java.security.AccessController.checkPermission(Compiled Code)
> >
> > at java.lang.SecurityManager.checkPermission(Compiled Code)
> > at
> > java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1194)
> >
> > at java.lang.System.getProperties(System.java:451)
> > at registry.admin.RegistryControl.<clinit>(RegistryControl.java)
> >
> > at registry.admin.ServerConfiguration.<init>(Compiled Code)
> > at registry.admin.ServersImpl.<init>(ServersImpl.java)
> > at registry.admin.AdminServer.main(Compiled Code)
> >
> > Yes I am attempting a System.getProperties() call during init time:
> >
> > protected static Properties props = new
> > Properties(System.getProperties());
> >
> > Any help appreciated...
> >
> > Kevin.
>

- Next message: Gilles Roussel: "certreq Test problem"
- Previous message: Kevin Schnake: "Re: 1.1* to 2.0 migration problem..."
- Maybe in reply to: Kevin Schnake: "1.1* to 2.0 migration problem..."