Hi All,
To fully fix this bug, we need to make change both in code file
nsXPComInit.cpp(part 1) and spec file SUNWfirefox.spec(part 2).
Here comes the patch for SUNWfirefox.spec. The patch works like this,
the file ".autoreg" will be delivered in SUNWfirefox,
SUNWfirefox-apoc-adapter's postremove script will touch .autoreg right
after apoc removal, then when Firefox starts up next time, it will
detect this file is newer than "components/compreg.dat" and call the
registration program to update component registration information.
Dave.
Brian Lu wrote:
> Fix the bug CR 6521792: Firefox cannot start,after removing apoc
> adapter,with user account setup when apoc adapter installed
> ------------------------------------------------------------------------
>
> --- mozilla/xpcom/build/nsXPComInit.cpp.old 2006-08-05 01:50:52.000000000
> +0800
> +++ mozilla/xpcom/build/nsXPComInit.cpp 2007-03-09 11:05:45.166807000
> +0800
> @@ -262,6 +262,7 @@
> // compreg.dat file. If the .autoreg file is newer, we autoregister.
> static PRBool CheckUpdateFile()
> {
> + PRBool ret;
> nsresult rv;
> nsCOMPtr<nsIFile> file;
> rv = nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
> @@ -297,8 +298,13 @@
> PRInt64 compregModTime, autoregModTime;
> compregFile->GetLastModifiedTime(&compregModTime);
> file->GetLastModifiedTime(&autoregModTime);
> -
> - return LL_CMP(autoregModTime, >, compregModTime);
> +
> + ret = LL_CMP(autoregModTime, >, compregModTime);
> + if (ret)
> + {
> + compregFile->Remove(PR_FALSE);
> + }
> + return ret;
> }
>
>
> @@ -622,6 +628,7 @@
> for (int i = 0; i < components_length; i++)
> RegisterGenericFactory(registrar, &components[i]);
> }
> + CheckUpdateFile();
> rv = nsComponentManagerImpl::gComponentManager->ReadPersistentRegistry();
> #ifdef DEBUG
> if (NS_FAILED(rv)) {
> @@ -629,7 +636,7 @@
> }
> #endif
>
> - if ( NS_FAILED(rv) || CheckUpdateFile()) {
> + if ( NS_FAILED(rv)) {
> // if we find no persistent registry, we will try to autoregister
> // the default components directory.
> nsComponentManagerImpl::gComponentManager->AutoRegister(nsnull);
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SUNWfirefox-fix-apoc-removal-crash.diff
Type: text/x-patch
Size: 1424 bytes
Desc: not available
URL:
<http://mail.opensolaris.org/pipermail/jds-review/attachments/20070314/2f00fb98/attachment.bin>