Sounds good, thanks.
Laca
On Fri, 2007-03-16 at 19:10 +0800, Dave Lin wrote:
> Hi Laca,
> Laszlo (Laca) Peter wrote:
> > Hi Dave, Brian,
> >
> > A few questions about this.
> > If I understand correctly from the code fragment in the patch,
> > the .autoreg is not deleted, instead the code checks if
> > the compreg.dat file is older or not.
> > So what happens when a non-privileged user runs firefox after
> > .autoreg is touched? I suspect that a compreg.dat is created
> > in their ~/.mozilla? Does the code check if this is newer
> > than .autoreg or does it check /usr/lib/firefox only or both?
> > Can you explain in more detail please?
> >
> >
> The registration mechanism changed from Mozilla to Firefox, the registry
> files are treated as a kind of profiles and locate at profile
> directory(~/.mozilla) for all user including "root", so Firefox will
> check it there regardless compreg.dat at /usr/lib/firefox.
>
> > Also, does this mean that all users will experience a delay
> > first time after .autoreg is touched?
> Yes, but this cost is much small and this scenario is only for user
> removing apoc adapter after initial installation which probably would
> not happen.
> > Can we avoid this?
> > Any way we can regenerate compreg.dat in /usr/lib/firefox
> >
> this doesn't work due to the reason above.
> > without running firefox itself? Something we can do in a postrun
> > script maybe?
> >
> Thanks,
> Dave
> > Thanks,
> > Laca
> >
> > On Wed, 2007-03-14 at 15:09 +0800, Dave Lin wrote:
> >
> >> 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);
> >>>
> >>>
> >
> >
>