Bug 206432 - [Browser] Linux: SSL navigation is disabled when Mozilla profile directory does not exist
Summary: [Browser] Linux: SSL navigation is disabled when Mozilla profile directory do...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 217038 226545 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-16 04:40 EDT by Jeff Wu CLA
Modified: 2008-07-10 15:46 EDT (History)
5 users (show)

See Also:


Attachments
patch for 3.3.1 (3.53 KB, patch)
2008-07-10 15:46 EDT, Grant Gayed CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Wu CLA 2007-10-16 04:40:56 EDT
Build ID: Eclipse 3.3

Steps To Reproduce:
Env: Suse Linux ED10
Eclipse: 3.3

SSL website (https://bugs.eclipse.org/bugs) can't visit if Mozilla profile directory doesn't exist(~/.mozilla/eclipse)

Steps to reproduce
1. Goto Mozilla profile root directory, rm "eclipse"(or rename) directory if it has. This is to make a clean environment
2. Open Eclipse, show "Internal web browser" from menu Windows ->Show View->Others, "General" catalog.
3. Visit "https://bugs.eclipse.org/bugs".
4. Get two error dialogs, and then SSL is disabled. 

In another way, if you visit a normal HTTP WebSite(http://www.eclipse.org) at first, then navigate to SSL website, it is ok. 

The reason is when Mozilla visits SSL site, it persists credentail information at two files(cert8.db & key3.db), but if the Eclipse specified profile directory doesn't exist, it will fail.
If we visit HTTP first, Mozilla will try to create "Eclipse" directory, and put "/cache" "history.dat" files on that.

So when user visits SSL website firstly on a clean environment, this problem happens.

More information:
A proposed fix would be update AppFileLocProvider.java file on org.eclipse.swt.browser package, when Mozilla.java calls setProfilePath() method, it should check if it exists, and create it if it doesn't. This can fix the problem, and doesn't impact other functions.
void setProfilePath (String path) {
	profilePath = path;
	if(profilePath!=null){
		File profileF=new File(profilePath);
		if(profileF.exists()==false){
			try{
				profileF.mkdir();
			}catch(Exception e){		
				 //log some error here.
			}
		}
	}
}
Comment 1 Jeff Wu CLA 2007-10-16 04:44:26 EDT
Please consider to fix in 3.4, thanks!
Comment 2 Grant Gayed CLA 2007-11-16 15:26:15 EST
Thanks for investigating this!  fixed > 1116
Comment 3 Grant Gayed CLA 2008-02-07 09:47:41 EST
*** Bug 217038 has been marked as a duplicate of this bug. ***
Comment 4 Grant Gayed CLA 2008-04-10 12:02:29 EDT
*** Bug 226545 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Overholt CLA 2008-05-12 11:32:48 EDT
Grant:  was this change just in org.eclipse.swt.browser.AppFileLocProvider.java?

It looks like I may have to back-port this to our 3.3.2 packages in Fedora 9 (https://bugzilla.redhat.com/show_bug.cgi?id=446064).
Comment 6 Grant Gayed CLA 2008-05-12 12:32:32 EDT
Yes, that was the only change for this problem.
Comment 7 Raji Akella CLA 2008-07-10 14:44:03 EDT
Can you please post the patch for 3.3.1 ?
Comment 8 Grant Gayed CLA 2008-07-10 15:46:00 EDT
Created attachment 107133 [details]
patch for 3.3.1