Hi, I had reported Bug#28147 previously about JspC
failing to compile JSP files that are symbolic links
in another directory location. This is a rather
common case when I have multiple applications sharing
some common files (i.e. chError.jsp) and I made the
symbolic links to a single location instead of making
copies.
The main change is to replace the call
fjsp.getCanonicalPath() by fjsp.getAbsolutePath().
Please help review and accept the following change in
JspC.java. (see attachment).
Thanks,
--
Rick
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
Index: JspC.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
retrieving revision 1.69
diff -u -r1.69 JspC.java
--- JspC.java 6 Apr 2004 17:58:59 -0000 1.69
+++ JspC.java 8 Apr 2004 20:39:59 -0000
@@ -830,7 +830,7 @@
Enumeration e = pages.elements();
while (e.hasMoreElements()) {
String nextjsp = e.nextElement().toString();
- try {
+ // try {
File fjsp = new File(nextjsp);
if (!fjsp.exists()) {
if (log.isWarnEnabled()) {
@@ -839,14 +839,21 @@
}
continue;
}
- String s = fjsp.getCanonicalPath();
+ // BZ#28147 getCanonicalPath() dereferences symbolic links. If
the file
+ // is a symbolic link to a file in a different
directory,
+ // getCanonicalPath() will cause the following
s.startWith()
+ // to fail to match the uriRoot, resulting in
file-not-found
+ // error. Changing to getAbsolutePath() will allow
files that
+ // are symbolic links to be found correctly.
+ // String s = fjsp.getCanonicalPath();
+ String s = fjsp.getAbsolutePath();
//System.out.println("**" + s);
if (s.startsWith(uriRoot)) {
nextjsp = s.substring(uriRoot.length());
}
- } catch (IOException ioe) {
+ // } catch (IOException ioe) {
// if we got problems dont change the file name
- }
+ // }
if (nextjsp.startsWith("." + File.separatorChar)) {
nextjsp = nextjsp.substring(2);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]