You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/07/15 21:26:20 UTC

DO NOT REPLY [Bug 10839] New: - Uncaught SecurityException for System.getProperty() call

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10839

Uncaught SecurityException for System.getProperty() call

           Summary: Uncaught SecurityException for System.getProperty() call
           Product: XalanJ2
           Version: 2.4Dx
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: org.apache.xalan.serialize
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: ruvinsky@yahoo.com


The method org.apache.xalan.serialize.Encodings.loadEncodingInfo() calls 
System.getProperty() assuming that it has read access to it.  This fails if a 
SecurityManager is running and the code does not have read access to the 
property.  This case must be expected and handled.  A simple try block around 
the getProperty() call, and catching a SecurityException can do the trick.

Note that this is a critical bug because a basic transformation cannot be done 
without getting a SecurityException.

Suggested code edit:

      String urlString = null;
      try {
        urlString = System.getProperty("org.apache.xalan.serialize.encodings");
      } catch (SecurityException e) {}