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?

Also, does this mean that all users will experience a delay 
first time after .autoreg is touched?  Can we avoid this?
Any way we can regenerate compreg.dat in /usr/lib/firefox
without running firefox itself?  Something we can do in a postrun
script maybe?

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);
> >   
> 


Reply via email to