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 2011/12/06 19:54:27 UTC

DO NOT REPLY [Bug 52293] New: antiResourceLocking and unpackWARs

https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

             Bug #: 52293
           Summary: antiResourceLocking and unpackWARs
           Product: Tomcat 6
           Version: 6.0.35
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: jumiller@utah.gov
    Classification: Unclassified


Created attachment 28034
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28034
changes

It appears that Tomcat is attempting to copy the WAR from the
$CATALINA_HOME/webapps directory to the $CATALINA_HOME/temp directory without
the .war extension (e.g., original docBase is
$CATALINA_HOME/webapps/example.war and a new docBase of
$CATALINA_HOME/temp/1-example ).  I think that line 973 in ContextConfig.java
method antiLocking never evaluates correctly because the docBase gets set to
the value of path on line 969, which removes the .war extension so the file
ends up being $CATALINA_HOME/temp/1-example instead of 1-example.war.  

Additionally, applications with sub-context paths (e.g., foo#bar.war) never get
deployed to temp correctly with antiResourceLocking="true" regardless of the
unpackWARs setting because of the above scenario and because the docBase gets
set to the context path in the antiLocking method which converts the #
separator to /.  There appears to be a fix on line 882 of fixDocBase that
converts the / character to # in the path but that doesn't make it to the
antiLocking method.

Both 6.0.35 and 7.0.23 exhibit the same behaviour.  In 7.0.23, the docBase is
changed back to the context path via the ContextName now instead of the
context.getPath() but the result is the same.  Interestingly enough, there is a
comment in the 7.0.23 source on line 750 that suggests the code to copy the
.war file is never reached and that it's possibly a bug.  This code is never
reached because the docBase is changed to the path without the .war extension.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28034|1                           |0
           is patch|                            |

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

--- Comment #6 from Mark Thomas <ma...@apache.org> 2011-12-21 19:29:10 UTC ---
Fixed in trunk and will be included in 7.0.24 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

Justin Miller <ju...@utah.gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28034|0                           |1
        is obsolete|                            |

--- Comment #2 from Justin Miller <ju...@utah.gov> 2011-12-06 19:08:01 UTC ---
Created attachment 28037
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28037
ContextConfig.java

forgot to include patch for the actual bug.  Line 974 now checks the
originalDocBase for the ".war" extension and behaves appropriately.  The
changing of '/' to '#' is secondary but also required to handle sub-pathed
contexts

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

Justin Miller <ju...@utah.gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #3 from Justin Miller <ju...@utah.gov> 2011-12-06 19:13:35 UTC ---
This bug presents when antiResourceLocking = "true" and unpackWARs = "false". 
Additionally, regardless of the unpackWARs setting, sub-pathed contexts will
not be copied correctly to the temp directory because no check exists in the
antiLocking method for the sub-path

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

--- Comment #8 from Konstantin Kolinko <kn...@gmail.com> 2011-12-22 09:42:04 UTC ---
Created attachment 28097
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28097
2011-12-22_tc6_ContextConfig.java.patch (the same as above, but in unified diff
format)

The same as Justin Miller's patch, but now in Unified diff format.
It is against tc6.0.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

Justin Miller <ju...@utah.gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28034|0                           |1
           is patch|                            |
  Attachment #28034|application/octet-stream    |text/plain
          mime type|                            |
  Attachment #28034|changes                     |ContextConfig.java
        description|                            |

--- Comment #1 from Justin Miller <ju...@utah.gov> 2011-12-06 18:58:27 UTC ---
Comment on attachment 28034
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28034
ContextConfig.java

patch changes antiLocking method to convert '/' to '#' in docBase.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28037|1                           |0
           is patch|                            |

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

--- Comment #5 from Justin Miller <ju...@utah.gov> 2011-12-06 19:36:54 UTC ---
Created attachment 28038
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28038
differences

diff of patched antiLocking method with 6.0.35 version

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

--- Comment #7 from Mark Thomas <ma...@apache.org> 2011-12-21 19:31:43 UTC ---
Proposed for 6.0.x

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

--- Comment #4 from Konstantin Kolinko <kn...@gmail.com> 2011-12-06 19:21:27 UTC ---
(In reply to comment #1)
> patch changes antiLocking method to convert '/' to '#' in docBase.

It is much easier to handle an issue when you submit a diff against previous
version of a file, instead of attaching new file version as a whole.

The diff is several lines, a file is hundreds of lines. See the following
pages:

http://tomcat.apache.org/bugreport.html#Patches_and_enhancement_requests

http://www.apache.org/dev/contributors.html#patches

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52293] antiResourceLocking and unpackWARs

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52293

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from Konstantin Kolinko <kn...@gmail.com> 2012-01-06 16:10:34 UTC ---
Fixed in 6.0 with r1228244 and will be in 6.0.36.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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