Community
Participate
Working Groups
Build Identifier: eclipse-SDK-I20100426-0852-win32 With the addition of the Remote Help priority preference, which allows for remote help to have priority if the same doc exists local and remote. If the same help document exists both remote and local, the remote topic will be shown. If remote priority is selected, the infocenter is first checked for a given topic. If the InputStream returned is null, then we check locally. The problem is that the topic request being made returns a topic not found page instead of null if the topic does not exist. Therefore, although the topic is not on the IC, an InputStream is returned (not null), and the Topic Not Found page is shown. Eclipse needs a way to determine if the input stream returned is a Topic Not Found stream, and if it is, return a null InputStream Reproducible: Always Steps to Reproduce: 1. Launch Eclipse 3.6 2. Select Include Remote Help and give it priority 3. Add the infocenter http://publib.boulder.ibm.com/infocenter/rsahelp/v8/index.jsp 4. Browse Eclipse Documentation doc pages
Created attachment 166858 [details] Patch for this issue Implemented the method: public boolean isTopicNotFoundStream(URL url) Which takes a URL and returns true or false based on whether or not that URL will return a stream to the topic not found page. To detect the topic not found page, I use this line: if(streamContent.indexOf("The topic that you have requested is not available. The link may be wrong, or you may not have the corresponding product feature installed. This online help only includes documentation for features that are installed.")!=-1)//$NON-NLS-1$ { isTopicNotFoundStream=true; } This text is directly from the Topic Not found page. Is there a better way to detect the Topic not found stream? I was thinking maybe we could open a stream to the local topic not found page and compare against that, but those may not be exactly the same depending on the Eclipse release of the platform VS the Eclipse release on the Infocenter. Also, the method I implemented takes a URL instead of the current InputStream since we do not want to read the current InputStream or else we risk reading the data that the Help System needs from that stream.
Jim - the problem with searching for that String is users can customize the page that displays when a topic is not found - see http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ua_help_setup_preferences.htm That being said, I still don't have a better solution.
I don't think that patch will work so well because the not found page could be in a different locale or could be overridden by the user. I'm thinking a better approach would be for calls to /rtopic to return a 404 status rather than returning an error page and check for that status when reading remote help. I haven't thought through all the details, such as backward compatibility issues but it seems that this would be less fragile than searching for specific words in the body of the text.
Created attachment 167026 [details] Patch for Checking if rtopic path when page is not found This Patch implements the method: public static boolean isRTopicPath(String servletPath) which will return true if the request is an rtopic request. If true, then resp.setStatus(HttpServletResponse.SC_NOT_FOUND); is returned. If false, the page not found is shown. Tested and verified that this code will return a null input stream as expected by the remote help code.
Chris A, can you review this for RC1 and commit the patch if you approve it?
Patch works for me, committed to HEAD.
I have tagged the projects for the next I-build.
Jim, do you want to go ahead and create a second bug for the backward compatibility case where the remote infocenter is running on Eclipse 3.5 or earlier?
Why is this bug in the Security_Advisories group? This bug is missing a review+.
Dani, you are correct - this is not a security bug. I'm guessing that box got checked by accident.