mrglavas 2004/03/11 14:57:28
Modified: java/src/org/apache/xerces/dom ObjectFactory.java
java/src/org/apache/html/dom ObjectFactory.java
java/src/org/apache/xml/serialize ObjectFactory.java
java/src/org/apache/xerces/xinclude ObjectFactory.java
java/src/org/apache/xerces/parsers ObjectFactory.java
java/src/org/apache/xerces/impl/dv ObjectFactory.java
Log:
Fixing a bug.
Pass the package name not the class name to check package.
Revision Changes Path
1.5 +6 -3 xml-xerces/java/src/org/apache/xerces/dom/ObjectFactory.java
Index: ObjectFactory.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ObjectFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectFactory.java 11 Mar 2004 22:37:49 -0000 1.4
+++ ObjectFactory.java 11 Mar 2004 22:57:27 -0000 1.5
@@ -337,8 +337,11 @@
//restrict the access to package as speicified in java.security policy
SecurityManager security = System.getSecurityManager();
try{
- if(security != null){
- security.checkPackageAccess(className);
+ if (security != null) {
+ final int lastDot = className.lastIndexOf(".");
+ String packageName = className;
+ if (lastDot != -1) packageName = className.substring(0, lastDot);
+ security.checkPackageAccess(packageName);
}
}catch(SecurityException e){
throw e ;
1.5 +6 -3 xml-xerces/java/src/org/apache/html/dom/ObjectFactory.java
Index: ObjectFactory.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/html/dom/ObjectFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectFactory.java 11 Mar 2004 22:37:49 -0000 1.4
+++ ObjectFactory.java 11 Mar 2004 22:57:27 -0000 1.5
@@ -337,8 +337,11 @@
//restrict the access to package as speicified in java.security policy
SecurityManager security = System.getSecurityManager();
try{
- if(security != null){
- security.checkPackageAccess(className);
+ if (security != null) {
+ final int lastDot = className.lastIndexOf(".");
+ String packageName = className;
+ if (lastDot != -1) packageName = className.substring(0, lastDot);
+ security.checkPackageAccess(packageName);
}
}catch(SecurityException e){
throw e ;
1.5 +6 -3 xml-xerces/java/src/org/apache/xml/serialize/ObjectFactory.java
Index: ObjectFactory.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/ObjectFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectFactory.java 11 Mar 2004 22:37:49 -0000 1.4
+++ ObjectFactory.java 11 Mar 2004 22:57:27 -0000 1.5
@@ -337,8 +337,11 @@
//restrict the access to package as speicified in java.security policy
SecurityManager security = System.getSecurityManager();
try{
- if(security != null){
- security.checkPackageAccess(className);
+ if (security != null) {
+ final int lastDot = className.lastIndexOf(".");
+ String packageName = className;
+ if (lastDot != -1) packageName = className.substring(0, lastDot);
+ security.checkPackageAccess(packageName);
}
}catch(SecurityException e){
throw e ;
1.4 +6 -3
xml-xerces/java/src/org/apache/xerces/xinclude/ObjectFactory.java
Index: ObjectFactory.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/xinclude/ObjectFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ObjectFactory.java 11 Mar 2004 22:37:49 -0000 1.3
+++ ObjectFactory.java 11 Mar 2004 22:57:27 -0000 1.4
@@ -337,8 +337,11 @@
//restrict the access to package as speicified in java.security policy
SecurityManager security = System.getSecurityManager();
try{
- if(security != null){
- security.checkPackageAccess(className);
+ if (security != null) {
+ final int lastDot = className.lastIndexOf(".");
+ String packageName = className;
+ if (lastDot != -1) packageName = className.substring(0, lastDot);
+ security.checkPackageAccess(packageName);
}
}catch(SecurityException e){
throw e ;
1.5 +6 -3 xml-xerces/java/src/org/apache/xerces/parsers/ObjectFactory.java
Index: ObjectFactory.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/ObjectFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectFactory.java 11 Mar 2004 22:37:49 -0000 1.4
+++ ObjectFactory.java 11 Mar 2004 22:57:28 -0000 1.5
@@ -337,8 +337,11 @@
//restrict the access to package as speicified in java.security policy
SecurityManager security = System.getSecurityManager();
try{
- if(security != null){
- security.checkPackageAccess(className);
+ if (security != null) {
+ final int lastDot = className.lastIndexOf(".");
+ String packageName = className;
+ if (lastDot != -1) packageName = className.substring(0, lastDot);
+ security.checkPackageAccess(packageName);
}
}catch(SecurityException e){
throw e ;
1.5 +6 -3 xml-xerces/java/src/org/apache/xerces/impl/dv/ObjectFactory.java
Index: ObjectFactory.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/ObjectFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectFactory.java 11 Mar 2004 22:37:49 -0000 1.4
+++ ObjectFactory.java 11 Mar 2004 22:57:28 -0000 1.5
@@ -337,8 +337,11 @@
//restrict the access to package as speicified in java.security policy
SecurityManager security = System.getSecurityManager();
try{
- if(security != null){
- security.checkPackageAccess(className);
+ if (security != null) {
+ final int lastDot = className.lastIndexOf(".");
+ String packageName = className;
+ if (lastDot != -1) packageName = className.substring(0, lastDot);
+ security.checkPackageAccess(packageName);
}
}catch(SecurityException e){
throw e ;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]