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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to