From 9d1ae891bbe152a1ef1c69a30b509e02223ecaae Mon Sep 17 00:00:00 2001
From: zzz
Date: Mon, 8 Feb 2010 22:50:30 +0000
Subject: [PATCH] check for mismatched versions
---
.../java/src/net/i2p/router/web/PluginUpdateHandler.java | 9 ++++++++-
apps/routerconsole/jsp/configclients.jsp | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/PluginUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/PluginUpdateHandler.java
index c68346b99a..4aa6b2ab1a 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/PluginUpdateHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/PluginUpdateHandler.java
@@ -209,6 +209,8 @@ public class PluginUpdateHandler extends UpdateHandler {
return;
}
}
+
+ String sudVersion = TrustedUpdate.getVersionString(f);
f.delete();
String appName = props.getProperty("name");
@@ -219,6 +221,11 @@ public class PluginUpdateHandler extends UpdateHandler {
updateStatus("" + _("Plugin from {0} has invalid name or version", url) + "");
return;
}
+ if (!version.equals(sudVersion)) {
+ to.delete();
+ updateStatus("" + _("Plugin {0} has mismatched versions", appName) + "");
+ return;
+ }
// todo compare sud version with property version
@@ -242,7 +249,7 @@ public class PluginUpdateHandler extends UpdateHandler {
if (destDir.exists()) {
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
to.delete();
- updateStatus("" + _("Downloaded plugin is not for upgrading but the plugin is already installed", url) + "");
+ updateStatus("" + _("Downloaded plugin is for new installs only, but the plugin is already installed", url) + "");
return;
}
diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp
index 0fcb2e2e97..6d52901b8b 100644
--- a/apps/routerconsole/jsp/configclients.jsp
+++ b/apps/routerconsole/jsp/configclients.jsp
@@ -55,7 +55,7 @@ button span.hide{
" />
<%=intl._("Plugin Configuration")%>
- <%=intl._("The plugins listed below are started by the webConsole client and run in the same JVM as the router. They are usually web applications accessible through the router console.")%>
+ <%=intl._("The plugins listed below are started by the webConsole client.")%>