Bug 131324

Summary: MAKEDEV segmentation fault
Product: [Fedora] Fedora Reporter: cac
Component: MAKEDEVAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 3.9-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-31 15:24:15 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 cac 2004-08-31 00:20:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040625

Description of problem:
MAKEDEV crashes when creating links.

For example:

[root@rsh /dev]# ./MAKEDEV sound
Segmentation fault (core dumped)



Version-Release number of selected component (if applicable):
MAKEDEV-3.8.1-1

How reproducible:
Always

Steps to Reproduce:
1. cd /dev
2. ./MAKEDEV sound

    

Actual Results:  Segmentation fault

Expected Results:  No segmentation fault

Additional info:

MAKEDEV is incorrectly attempting to lookup uid/gid with getpwnam when
processing a link entry from the makedev.d configuation files.

Link entries are created with the symlink call (cf MAKEDEV.c, line
358),  and are created with the processes uid/gid.

getpwnam is called to translate user and group names in the makedev.d
configuration files to uid/gid numbers, but link entries in the files
do not specify names as they are irrelevent. The situation is handled
corrently for 'alias' entries. MAKEDEV.c, lines 215-216:

    /* Determine the IDs of the owner and her group, if we'll need
them. */
            if ((flags & MANIFEST) || (entry->type == ALIAS) ||
(entry->type == LINK)) {

Adding " || (entry-type == LINK)" to the above line fixes the problem.

        if ((flags & MANIFEST) || (entry->type == ALIAS) ||
(entry->type == LINK)) {

Comment 1 Nalin Dahyabhai 2004-08-31 15:24:15 UTC
Please retry with 3.9, and reopen if you find that this still happens
(I'm fairly certain it's been fixed).  Thanks!