You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by David Van Couvering <da...@vancouvering.com> on 2007/09/25 20:38:00 UTC

Confusion about system properties

Hi, all.  I was trying to add information about where database
directories are stored for a given Network Server run by adding more
information to sysinfo.

As a first step, in NetworkServerImpl, I added the following:

  retval.put(Property.SYSTEM_HOME_PROPERTY,
  PropertyUtil.getSystemProperty(Property.SYSTEM_HOME_PROPERTY, ""));

The problem is, this *always* prints out the location where I started
the network server, even when I start the server with
-Dderby.system.home=/tmp.

I looked at the code, and if I understand it,
PropertyUtil.getSystemProperty() does the following:

- Try to get the system property from the VM
- If there is a security exception, return null
- Try to get the property from derby.properties

I have *no* derby.properties file, and I am pretty sure that getting
it from the system causes a security exception, so I'm a little
confused about what is happening here.

On another note, if you start up the network server in 10.3, it starts
with a basic security manager, and this causes all sorts of failures
when you run sysinfo (see below).  Is this really what we want to
happen?  What's the right way of fixing this?

Thanks,

David

exceptions from derby -jar derbyrun.jar server sysinfo:

------------------ Java Information ------------------
Java Version:    1.5.0_07
Java Vendor:     Apple Computer, Inc.
Java home:       Security Exception:
java.security.AccessControlException: access denied
(java.util.PropertyPermission java.home read)
Java classpath:  Security Exception:
java.security.AccessControlException: access denied
(java.util.PropertyPermission java.class.path read)
OS name:         Mac OS X
OS architecture: i386
OS version:      10.4.10
Java user name:  Security Exception:
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.name read)
Java user home:  Security Exception:
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.home read)
Java user dir:   Security Exception:
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.dir read)
java.specification.name: Java Platform API Specification
java.specification.version: 1.5
--------- Derby Information --------
JRE - JDBC: J2SE 5.0 - JDBC 3.0
Unable to analyze class path: access denied
(java.util.PropertyPermission java.class.path read)

Re: Confusion about system properties

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi David,

I don't understand what you're seeing with derby.system.home.

The sysinfo problem can be fixed by editting the server.policy file to 
give derbynet.jar the permission to read all of those properties. When 
sysinfo is run standalone, without a security manager, this is not an issue.

Hope this helps,
-Rick

David Van Couvering wrote:
> Hi, all.  I was trying to add information about where database
> directories are stored for a given Network Server run by adding more
> information to sysinfo.
>
> As a first step, in NetworkServerImpl, I added the following:
>
>   retval.put(Property.SYSTEM_HOME_PROPERTY,
>   PropertyUtil.getSystemProperty(Property.SYSTEM_HOME_PROPERTY, ""));
>
> The problem is, this *always* prints out the location where I started
> the network server, even when I start the server with
> -Dderby.system.home=/tmp.
>
> I looked at the code, and if I understand it,
> PropertyUtil.getSystemProperty() does the following:
>
> - Try to get the system property from the VM
> - If there is a security exception, return null
> - Try to get the property from derby.properties
>
> I have *no* derby.properties file, and I am pretty sure that getting
> it from the system causes a security exception, so I'm a little
> confused about what is happening here.
>
> On another note, if you start up the network server in 10.3, it starts
> with a basic security manager, and this causes all sorts of failures
> when you run sysinfo (see below).  Is this really what we want to
> happen?  What's the right way of fixing this?
>
> Thanks,
>
> David
>
> exceptions from derby -jar derbyrun.jar server sysinfo:
>
> ------------------ Java Information ------------------
> Java Version:    1.5.0_07
> Java Vendor:     Apple Computer, Inc.
> Java home:       Security Exception:
> java.security.AccessControlException: access denied
> (java.util.PropertyPermission java.home read)
> Java classpath:  Security Exception:
> java.security.AccessControlException: access denied
> (java.util.PropertyPermission java.class.path read)
> OS name:         Mac OS X
> OS architecture: i386
> OS version:      10.4.10
> Java user name:  Security Exception:
> java.security.AccessControlException: access denied
> (java.util.PropertyPermission user.name read)
> Java user home:  Security Exception:
> java.security.AccessControlException: access denied
> (java.util.PropertyPermission user.home read)
> Java user dir:   Security Exception:
> java.security.AccessControlException: access denied
> (java.util.PropertyPermission user.dir read)
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.5
> --------- Derby Information --------
> JRE - JDBC: J2SE 5.0 - JDBC 3.0
> Unable to analyze class path: access denied
> (java.util.PropertyPermission java.class.path read)
>