Bug 60351

Summary: WAR unpacking creates META-INF/war-tracker file too early after each unpacked file
Product: Tomcat 8 Reporter: Harri Pesonen <harry.elfuerte>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.5.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: All   

Description Harri Pesonen 2016-11-08 08:49:45 UTC
WAR unpacking creates META-INF/war-tracker file too early after each unpacked file. Noticed this when Tomcat was killed while it was unpacking files. It happily used the partially extracted files, and of course the application did not work anymore.

https://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/catalina/startup/ExpandWar.java

Here you can see that warTracker file is created inside the unpacking loop, right after each file:

                // Create the warTracker file and align the last modified time
                // with the last modified time of the WAR
                warTracker.createNewFile();
                warTracker.setLastModified(warLastModified);
            }
            success = true;
Comment 1 Mark Thomas 2016-11-08 09:54:56 UTC
Thanks for the report. This has been fixed in:
9.0.x for 9.0.0.M14 onwards
8.5.x for 8.5.9 onwards
8.0.x for 8.0.40 onwards
7.0.x and earlier is not affeted