Bug 31264 - Manager webapp uploads WAR, then overwrites it
Summary: Manager webapp uploads WAR, then overwrites it
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Webapps:Manager (show other bugs)
Version: 5.5.1
Hardware: PC Windows XP
: P3 critical with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-16 16:09 UTC by David Gadbois
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Gadbois 2004-09-16 16:09:35 UTC
The manager webapp doPut() processing (which is what the Ant manager tasks use),
extracts a war file from the HTTP request, saves it to appBase, and then tries
to copy the war on to itself, resulting in a zero-length war file.  The code
that does this is in org.apache.catalina.manager.ManagerServlet line 642 in
method deploy(PrintWriter, String, String, boolean, HttpServletRequest):

            if (!isServiced(path)) {
                addServiced(path);
--->            copy(localWar, new File(getAppBase(), basename + ".war"));
                check(path);
                removeServiced(path);
            }

In the call to copy(), the source and destination files are the same.
Comment 1 Remy Maucherat 2004-09-16 17:14:59 UTC
That's possible, I didn't test uploading with the Ant task. If it works like
that, it should be modified to do the upload somewhere else (and when it's done,
copy to the final location).
Comment 2 Remy Maucherat 2004-09-23 07:11:06 UTC
This issue is now fixed. Sorry for the trouble.