[Fontconfig] Sigh. What to do about per-user fonts...

Frederic Crozat fcrozat at mandriva.com
Wed May 10 01:23:26 PDT 2006


Le lundi 08 mai 2006 à 13:38 -0400, Patrick Lam a écrit :
> Keith Packard wrote:
> > On Wed, 2006-05-03 at 23:09 -0400, Patrick Lam wrote:
> > 
> >> I noticed one problem which occurs when you run fc-cache as root and 
> >> have HOME set to a user directory.  I'll have more details (hopefully a 
> >> fix) when I next have free time on Friday or something.  Right now I'm 
> >> preparing lecture notes...
> > 
> > I'm not quite sure what to do about that; one option is to strip all ~
> > relative path names when getuid() != geteuid() from the font path, cache
> > path and other configurable names.
> > 
> > I was thinking that we already bailed on writing out cache files in this
> > case though. In which case, the only issue is with sudo. One possible
> > fix here is to use getpwuid (getuid()) instead of getenv ("HOME").
> 
> We don't write global cache files in the getuid() != geteuid() case, but 
> we do write local cache files.  So getpwuid(getuid()) seems like it 
> should work.

Just a side note :

The getpwuid(getuid()) would be way much better than getenv("HOME"),
which used to be in older version of fontconfig and caused crashes when
HOME was not set (we had that problem at installation time with old
Mandriva Linux releases.

-- 
Frederic Crozat <fcrozat at mandriva.com>
Mandriva



More information about the Fontconfig mailing list