java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java | 11 ++++++++++
1 file changed, 11 insertions(+)
New commits:
commit ff77e9b12ac95fb2bd0a31cc3ea07f1c03b3279b
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Jul 28 15:42:40 2010 -0400
595524 - changing improper accesses to /ks/dist to return a file not found
diff --git a/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
b/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
index 31b75e7..dbdf278 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
@@ -161,6 +161,11 @@ public class DownloadFile extends DownloadAction {
}
String[] split = url.split("/");
+ if (split.length < 3) {
+ return null;
+ }
+
+
int labelPos = 2;
if (split[2].equals("org")) {
ret.put("orgId", split[3]);
@@ -194,6 +199,12 @@ public class DownloadFile extends DownloadAction {
}
Map<String, String> map = DownloadFile.parseDistUrl(url);
+
+ if (map == null) {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
+ return mapping.findForward("error");
+ }
+
String path = map.get("path");
String label = map.get("label");
Long orgId = null;
Show replies by date