Bug 59709 - rpm segfaults when trying to unpack files with users from LDAP
rpm segfaults when trying to unpack files with users from LDAP
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.1
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks: 89122
  Show dependency treegraph
 
Reported: 2002-02-11 18:48 EST by Johannes Erdfelt
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-02-11 18:50:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case 1. User exists in LDAP. Segfault is result (595 bytes, text/plain)
2002-02-11 18:48 EST, Johannes Erdfelt
no flags Details
Testcase 2. User exists in /etc/passwd. Everything is fine (588 bytes, text/plain)
2002-02-11 18:49 EST, Johannes Erdfelt
no flags Details
Testcase 3. User doesn't exist anywhere. Segfault (596 bytes, text/plain)
2002-02-11 18:50 EST, Johannes Erdfelt
no flags Details

  None (edit)
Description Johannes Erdfelt 2002-02-11 18:48:03 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20020104

Description of problem:
rpm segfaults when trying unpack files with ownership of a user which is in
LDAP. If I change the ownership (using %defattr or %attr) everything works fine.
It will also segfault if the user doesn't exist.

I've created 3 test cases, the first and third will segfault, the second won't.


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

monaco:~# rpm -q rpm
rpm-4.0.3-1.03

How reproducible:
Always

Steps to Reproduce:
1. Setup system to use LDAP as directory service
2. Rebuild testcase RPM's
3. Try installing them :)
	

Actual Results:  monaco:~# rpm -i ~jerdfelt/build/RPMS/i386/test-0.1-1.i386.rpm 
zsh: segmentation fault (core dumped)  rpm -i
/home/jerdfelt/build/RPMS/i386/test-0.1-1.i386.rpm

monaco:~# rpm -i ~jerdfelt/build/RPMS/i386/test3-0.1-1.i386.rpm 
zsh: segmentation fault (core dumped)  rpm -i
/home/jerdfelt/build/RPMS/i386/test3-0.1-1.i386.rpm

Expected Results:  monaco:~# rpm -i ~jerdfelt/build/RPMS/i386/test2-0.1-1.i386.rpm 
monaco:~# rpm -e test2

Additional info:

If LDAP is *not* configured on the server, everything works as expected:

daytona:~# rpm -i ~jerdfelt/test3-0.1-1.i386.rpm 
user nonexist does not exist - using root
group nonexist does not exist - using root
Comment 1 Johannes Erdfelt 2002-02-11 18:48:56 EST
Created attachment 45343 [details]
Test case 1. User exists in LDAP. Segfault is result
Comment 2 Johannes Erdfelt 2002-02-11 18:49:49 EST
Created attachment 45344 [details]
Testcase 2. User exists in /etc/passwd. Everything is fine
Comment 3 Johannes Erdfelt 2002-02-11 18:50:43 EST
Created attachment 45345 [details]
Testcase 3. User doesn't exist anywhere. Segfault
Comment 4 Jeff Johnson 2002-02-12 08:53:04 EST
There's a linkage loop deep in PAM LDAP modules that affects
only statically linked executables like rpm. The voo-doo fix is to
run nscd (which changes the manner in which LDAP is linked).
Comment 5 mattb 2002-10-12 03:00:23 EDT
The nscd "trick" doesn't always work:

5334 kanga(pts/0):[~]# /etc/rc.d/init.d/nscd status
nscd (pid 27000 26999 26998 26997 26996 26995 26992) is running...
5335 kanga(pts/0):[~]# rpm -Uhvv ~matt/scratch/tcm-dynmotif-2.01-1.i386.rpm
D: ============== /home/matt/scratch/tcm-dynmotif-2.01-1.i386.rpm
D: Expected size:      2911046 = lead(96)+sigs(68)+pad(4)+data(2910878)
D:   Actual size:      2911046
D: opening  db environment /var/lib/rpm/Packages create:mpool
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name create mode=0x42
D: 	added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ tcm-dynmotif-2.01-1
D: opening  db index       /var/lib/rpm/Depends create mode=0x42
D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
D:  Requires: /bin/sh                                       YES (db files)
D: opening  db index       /var/lib/rpm/Providename create mode=0x42
D:  Requires: ld-linux.so.2                                 YES (db provides)
D:  Requires: libc.so.6                                     YES (db provides)
D:  Requires: libICE.so.6                                   YES (db provides)
D:  Requires: libm.so.6                                     YES (db provides)
D:  Requires: libSM.so.6                                    YES (db provides)
D:  Requires: libstdc++-libc6.1-1.so.2                      YES (db provides)
D:  Requires: libX11.so.6                                   YES (db provides)
D:  Requires: libXext.so.6                                  YES (db provides)
D:  Requires: libXm.so.1                                    YES (db provides)
D:  Requires: libXt.so.6                                    YES (db provides)
D:  Requires: /usr/bin/perl                                 YES (db files)
D:  Requires: libc.so.6(GLIBC_2.0)                          YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.1)                          YES (db provides)
D:  Requires: libm.so.6(GLIBC_2.1)                          YES (db provides)
D: opening  db index       /var/lib/rpm/Conflictname create mode=0x42
D: closed   db index       /var/lib/rpm/Depends
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0    1    0    0  tcm-dynmotif-2.01-1
D: installing binary packages
Preparing...                ########################################### [100%]
D: Expected size:      2911046 = lead(96)+sigs(68)+pad(4)+data(2910878)
D:   Actual size:      2911046
D:   install: tcm-dynmotif-2.01-1 has 354 files, test = 0
D:   install: running %pre script(s) (if any)
zsh: segmentation fault  rpm -Uhvv ~matt/scratch/tcm-dynmotif-2.01-1.i386.rpm
5336 kanga(pts/0):[~]# /etc/rc.d/init.d/nscd status                        
nscd (pid 27000 26999 26998 26997 26996 26995 26992) is running...
5337 kanga(pts/0):[~]# uname -a
Linux kanga.priv.bogosian.net 2.4.18-10 #1 Wed Aug 7 11:39:21 EDT 2002 i686 unknown

I'm running RedHat 7.3.

This is *REALLY* frustrating.

Here's the test RPM:
http://wwwhome.cs.utwente.nl/~tcm/software.html
ftp://ftp.cs.utwente.nl/pub/tcm/tcm-dynmotif-2.01-1.i386.rpm

Incidentally, this also happens with the RedHat-distributed apache-*.rpm files
as well.
Comment 6 mattb 2002-10-12 03:08:50 EDT
Incidentally, I tried this again after doing an 'rpm --rebuilddb' and it still
results in the same behavior.
Comment 7 Jeff Johnson 2002-10-12 09:05:54 EDT
FWIW, I can install the package w/o segfaulting, but
then I don't use LDAP.

Yes, --rebuilddb won't help or hurt, the problem
is not in rpm.

You can always change your packaging to use root
rather than tcm. Equivalently, you can use a lookup
other than LDAP for the user tcm.

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