You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/01/23 13:55:13 UTC

DO NOT REPLY [Bug 26375] New: - Determining whether a package is sealed fails with partially-sealed jars

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=26375>.
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=26375

Determining whether a package is sealed fails with partially-sealed jars

           Summary: Determining whether a package is sealed fails with
                    partially-sealed jars
           Product: Tomcat 4
           Version: 4.1.29
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mike-bugzilla@big.faceless.org


For jars where only some of the packages are sealed, the code to extract the 
Attributes from the Manifest for that package is incorrect. 
 
One result of this is that if the JAR as a whole is sealed but a particular 
package in that JAR is not, the unsealed package throws a sealing violation. 
 
The fault is in the 
org.apache.cataline.loader.WebappClassLoader.isPackageSealed method. The 
"name" attribute passed is in the format "org.blah.blah", whereas the 
attributes in the Manifest are stored against the key "org/blah/blah/". 
 
This is easy to fix. Replace the first few lines of the method with: 
 
   protected boolean isPackageSealed(String name, Manifest man) 
   { 
*       StringBuffer buf = new StringBuffer(name); 
*       for (int i=0;i<buf.length();i++) { 
*           if (buf.charAt(i)=='.') buf.setCharAt(i,'/'); 
*       } 
*       buf.append('/'); 
*       Attributes attr = man.getAttributes(buf.toString()); 
        String sealed = null; 
        ... and so on. 
 
This is tested with 4.1.29 and works fine.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org