Bug 133116 - segmentation fault inside initgroups() when ldap is configured
Summary: segmentation fault inside initgroups() when ldap is configured
Status: CLOSED DUPLICATE of bug 132850
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc   
(Show other bugs)
Version: 3.0
Hardware: ia64
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2004-09-21 19:11 UTC by XC Support
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-21 19:05:45 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description XC Support 2004-09-21 19:11:58 UTC
Description of problem:

When you set "group: files ldap" in "/etc/nsswitch.conf" and you have 
a statically build application, a call to "initgroups()" call cause a 
segmentation fault.

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


How reproducible:

Steps to Reproduce:
1. Set "group: files ldap" in "/etc/nsswitch.conf"
2. Use the following reproducer program. The user is "mysql", but you 
can choose another.

#include <stdio.h>
#include <grp.h>
#include <pwd.h>
#include <errno.h>

       struct passwd *pw_ptr;

       char *user = "mysql";

       pw_ptr = getpwnam(user);

       printf("pw_ptr->pw_gid = %d\n", pw_ptr->pw_gid);

       initgroups((char*) user, pw_ptr->pw_gid);

3. Compile with "cc filename.c -static"
4. Run "a.out".

Actual results:

# ./a.out
pw_ptr->pw_gid = 101
Segmentation fault

Expected results:

# ./a.out
pw_ptr->pw_gid = 101

Additional info:

This only happens when compiling with "-static".

Comment 1 XC Support 2004-09-21 19:14:16 UTC

*** This bug has been marked as a duplicate of 132850 ***

Comment 2 Red Hat Bugzilla 2006-02-21 19:05:45 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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