Bug 169554

Summary: seg fault if /etc/inittab can't be opened
Product: [Fedora] Fedora Reporter: Robert Haas <robertmhaas>
Component: kudzuAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 1.2.10-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-29 17:32:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robert Haas 2005-09-29 16:54:48 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

Description of problem:
The checkInittab() function in hwdata.c calls fopen() on /etc/inittab but does not check whether the operation succeeds.  As a result, if the file does not exist or otherwise can't be opened, fgets() is invoked with a NULL pointer as its third argument, which causes kudzu to die with a segmentation fault.

Version-Release number of selected component (if applicable):
kudzu-1.1.116.2-2

How reproducible:
Always

Steps to Reproduce:
1. Remove (or rename) /etc/inittab.
2. Run kudzu.  

Actual Results:  Kudzu crashes.

Expected Results:  Kudzu prints an error message and then either dies or soldiers on.

Additional info:

Comment 1 Bill Nottingham 2005-09-29 17:32:20 UTC
Fixed in CVS, will be in 1.2.10-1 - thanks!

Out of curiosity, was it failing due to SELinux prohibiting the open, or had you
switched to non-SysV init?

Comment 2 Robert Haas 2005-09-30 02:11:07 UTC
It wasn't SELinux.  I had built a stripped down environment with a very small,
special purpose custom init that doesn't use any configuration files, so
/etc/inittab just didn't exist.