Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
f5ae89d4
Commit
f5ae89d4
authored
Sep 07, 2017
by
Richard Midwinter
Committed by
Guus der Kinderen
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1020: Admin Console Remote File Inclusion
parent
0c4f5865
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
26 deletions
+49
-26
UpdateManager.java
src/java/org/jivesoftware/openfire/update/UpdateManager.java
+49
-26
No files found.
src/java/org/jivesoftware/openfire/update/UpdateManager.java
View file @
f5ae89d4
...
...
@@ -81,7 +81,7 @@ public class UpdateManager extends BasicModule {
/**
* URL of the servlet (JSP) that provides the "check for update" service.
*/
private
static
String
updateServiceURL
=
"http://www.igniterealtime.org/projects/openfire/versions.jsp"
;
private
static
String
updateServiceURL
=
"http
s
://www.igniterealtime.org/projects/openfire/versions.jsp"
;
/**
* Information about the available server update.
...
...
@@ -275,6 +275,8 @@ public class UpdateManager extends BasicModule {
hc
.
setProxy
(
getProxyHost
(),
getProxyPort
());
httpClient
.
setHostConfiguration
(
hc
);
}
if
(
isKnownPlugin
(
url
))
{
GetMethod
getMethod
=
new
GetMethod
(
url
);
//execute the method
try
{
...
...
@@ -301,9 +303,30 @@ public class UpdateManager extends BasicModule {
catch
(
IOException
e
)
{
Log
.
warn
(
"Error downloading new plugin version"
,
e
);
}
}
else
{
Log
.
error
(
"Invalid plugin download URL: "
+
url
);
}
return
installed
;
}
/**
* Check if the plugin URL is in the known list of available plugins.
*
* i.e. that it's an approved download source.
*
* @param url The URL of the plugin to download.
* @return true if the URL is in the list. Otherwise false.
*/
private
boolean
isKnownPlugin
(
String
url
)
{
for
(
String
pluginName
:
availablePlugins
.
keySet
())
{
if
(
availablePlugins
.
get
(
pluginName
).
getDownloadURL
().
toString
().
equals
(
url
))
{
return
true
;
}
}
return
false
;
}
/**
* Returns true if the plugin downloaded from the specified URL has been downloaded. Plugins
* may be downloaded but not installed. The install process may take like 30 seconds to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment