JDK-4774072 : Launcher should cd to /tmp when getcwd() fails
  • Type: Enhancement
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: solaris,1.4.1
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic,sparc
  • Submitted: 2002-11-05
  • Updated: 2010-07-27
  • Resolved: 2010-07-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
On Solaris, 'su' to root and run 1.4.1 or 1.4.2.  The JDK will abort with the
following error message:
Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory.

This only happens when the current directory is not readable by root, which
is typically the case for NFS-mounted filesystems.

Comments
EVALUATION This is no longer reproducible.
27-07-2010

SUGGESTED FIX The right fix is to have the launcher check if $HOME has the right access bits, and simply exit with an Error, rather than allowing the VM to abort much later.
16-11-2006

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
14-06-2004

EVALUATION This problem was probably introduced when bug 4397084 was fixed in hopper. -- iag@sfbay 2002-11-06 Yes, the root problem here is that at startup we getcwd() in order to set the "user.dir" system property. Doing that requires the current directory to be readable by the user running the VM. If you're in an NFS-mounted directory that's not world-readable then this operation will fail when run as root since NFS is almost always configured to map "root" to "nobody". A reasonable fix for this would be to have the startup code cd to /tmp when getcwd() fails. I'm converting this to an RFE and moving it over to tools since this should probably be done in the launcher, well before anything else happens. -- ###@###.### 2002/12/4 Current behavior might be appropriate; changing the directory to /tmp would presumably affect the interpretation of various relative path settings. Will investigate. ###@###.### 2002-12-04 Investigation deferred for a future release. ###@###.### 2003-10-21
04-12-2002