Bug 22

Summary: fontconfig crashes if $HOME is not set
Product: fontconfig Reporter: Frederic Crozat <fcrozat>
Component: libraryAssignee: Keith Packard <keithp>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: 2.1   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch to use $HOME only as fallback

Description Frederic Crozat 2003-02-06 01:34:31 UTC
Fontconfig crashes if HOME variable is not set (it can
be the case when using usermode to get root access)..

The attached patch fixes this problem and only relies on $HOME
variable presence when getpwuid doesn't give any info (this is the glib2 way..)
Comment 1 Frederic Crozat 2003-02-06 01:35:38 UTC
Created attachment 16 [details] [review]
Patch to use $HOME only as fallback
Comment 2 Keith Packard 2003-02-06 07:45:49 UTC
I would prefer to use $HOME and fall back to getpwuid only if that's not set, or
perhaps if the application is setuid.  getpwuid seems a bit expensive to use in
every application.
Comment 3 Frederic Crozat 2003-02-06 08:30:09 UTC
I don't have any strong feelings for any approaches.. Since I didn't knew which
one was better, I choose the glib2 way
Comment 4 Keith Packard 2003-02-06 11:30:52 UTC
I've made a minimal patch that solves the immediate problem.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.