Bug 133116

Summary: segmentation fault inside initgroups() when ldap is configured
Product: Red Hat Enterprise Linux 3 Reporter: XC Support <xc_support>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 14:05:45 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description XC Support 2004-09-21 15:11:58 EDT
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):

glibc-2.3.2-95.20

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>

main()
{
       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 15:14:16 EDT

*** This bug has been marked as a duplicate of 132850 ***
Comment 2 Red Hat Bugzilla 2006-02-21 14:05:45 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.