This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new befc49ecfa Better location for validation
befc49ecfa is described below
commit befc49ecfab70c41f09a7b0b82be33e288d36274
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jun 24 22:40:34 2026 +0100
Better location for validation
---
java/org/apache/catalina/ha/deploy/FarmWarDeployer.java | 8 +++++---
java/org/apache/catalina/ha/deploy/LocalStrings.properties | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
index 20728e40e1..ccf8fbde80 100644
--- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
+++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
@@ -168,9 +168,6 @@ public class FarmWarDeployer extends ClusterListener
implements ClusterDeployer,
return;
}
if (watchEnabled) {
- if
(getDeployDirFile().getCanonicalPath().equals(getWatchDirFile().getCanonicalPath()))
{
- throw new
IllegalStateException(sm.getString("farmWarDeployer.samePathDeployWatch"));
- }
watcher = new WarWatcher(this, getWatchDirFile());
if (log.isInfoEnabled()) {
log.info(sm.getString("farmWarDeployer.watchDir",
getWatchDir()));
@@ -654,6 +651,7 @@ public class FarmWarDeployer extends ClusterListener
implements ClusterDeployer,
*/
public void setTempDir(String tempDir) {
this.tempDir = tempDir;
+ tempDirFile = null;
}
/**
@@ -767,6 +765,10 @@ public class FarmWarDeployer extends ClusterListener
implements ClusterDeployer,
*/
protected boolean copy(File from, File to) {
try {
+ if (from.getCanonicalPath().equals(to.getCanonicalPath())) {
+ throw new
IOException(sm.getString("farmWarDeployer.samePathCopy"));
+ }
+
if (!to.exists()) {
if (!to.createNewFile()) {
log.error(sm.getString("fileNewFail", to));
diff --git a/java/org/apache/catalina/ha/deploy/LocalStrings.properties
b/java/org/apache/catalina/ha/deploy/LocalStrings.properties
index 8de664721b..af70f8081f 100644
--- a/java/org/apache/catalina/ha/deploy/LocalStrings.properties
+++ b/java/org/apache/catalina/ha/deploy/LocalStrings.properties
@@ -34,7 +34,7 @@ farmWarDeployer.removeLocalFail=Unable to remove WAR file
farmWarDeployer.removeStart=Cluster wide remove of web app [{0}]
farmWarDeployer.removeTxMsg=Send cluster wide undeployment from [{0}]
farmWarDeployer.renameFail=Failed to rename [{0}] to [{1}]
-farmWarDeployer.samePathDeployWatch=deployDir and watchDir must be different
directories
+farmWarDeployer.samePathCopy=Source and destination must be different
directories
farmWarDeployer.sendEnd=Send cluster war deployment path [{0}], war [{1}]
finished.
farmWarDeployer.sendFragment=Send cluster war fragment path [{0}], war [{1}]
to [{2}]
farmWarDeployer.sendStart=Send cluster war deployment path [{0}], war [{1}]
started.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]