Bug 169554 - seg fault if /etc/inittab can't be opened
Summary: seg fault if /etc/inittab can't be opened
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kudzu
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-09-29 16:54 UTC by Robert Haas
Modified: 2014-03-17 02:56 UTC (History)
1 user (show)

Fixed In Version: 1.2.10-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-29 17:32:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.