Bug 59382 - rpm leaks fds when it runs script (e.g. %post)
rpm leaks fds when it runs script (e.g. %post)
Status: CLOSED DUPLICATE of bug 61198
Product: Red Hat Linux
Classification: Retired
Component: openssh (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Mraz
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-06 13:45 EST by Pavel Kankovsky
Modified: 2007-04-18 12:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-02-03 05:44:38 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)

  None (edit)
Description Pavel Kankovsky 2002-02-06 13:45:22 EST
Description of Problem:
Scripts invoked by rpm appear to inherit various file descriptors used by rpm
internally (including the file of a package being installed).

Example: OpenSSH 3.0.2p2's sshd started from %post after upgrade:

[root@kunhuta i386]# /sbin/service sshd status
sshd (pid 9106) is running...
[root@kunhuta i386]# ls -l /proc/9106/fd/
total 0
lrwx------    1 root     root           64 Feb  6 19:17 0 -> /dev/null
lrwx------    1 root     root           64 Feb  6 19:17 1 -> /dev/null
lr-x------    1 root     root           64 Feb  6 19:17 11 ->
/home/sw/rh/RPMS/i386/openssh-server-3.0.2p1-1loc62.i386.rpm
lrwx------    1 root     root           64 Feb  6 19:17 12 -> /dev/pts/1
lrwx------    1 root     root           64 Feb  6 19:17 2 -> /dev/null
l-wx------    1 root     root           64 Feb  6 19:17 21 -> /dev/null
lrwx------    1 root     root           64 Feb  6 19:17 3 -> socket:[520909]
lr-x------    1 root     root           64 Feb  6 19:17 7 -> pipe:[520908]
l-wx------    1 root     root           64 Feb  6 19:17 8 -> pipe:[520908]

Fds 11 and 12 should not be there. Well, they wouldn't be there if sshd did the
right thing (or the wrong thing according to the wise men of OpenBSD) and closed
all its unused fds upon startup but you get the point.

Version-Release number of selected component (if applicable):
rpm-4.0.2-6x

How Reproducible:
Easily.

Steps to Reproduce:
1. cat <<EOF >test.spec
Summary: The test package
Name: test
Version: 1
Release: 1
Group: Test
License: public domain
Packager: peak
%description
This is a test.
%prep
%build
%install
%post
ls -l /proc/$$/fd
%files
EOF
2. rpmbuild test.spec
3. rpm -i test-1-1.i386.rpm

Actual Results:
total 0
lr-x------    1 root     root           64 Feb  6 19:37 0 -> pipe:[521125]
lrwx------    1 root     root           64 Feb  6 19:37 1 -> /dev/pts/1
lr-x------    1 root     root           64 Feb  6 19:37 11 ->
/home/sw/rh/RPMS/i386/test-1-1.i386.rpm
lrwx------    1 root     root           64 Feb  6 19:37 12 -> /dev/pts/1
lrwx------    1 root     root           64 Feb  6 19:37 2 -> /dev/pts/1
lr-x------    1 root     root           64 Feb  6 19:37 3 -> /tmp/rpm-tmp.14470

Expected Results:
perhaps something like this...
total 0
lr-x------    1 root     root           64 Feb  6 19:37 0 -> pipe:[521125]
lrwx------    1 root     root           64 Feb  6 19:37 1 -> /dev/pts/1
lrwx------    1 root     root           64 Feb  6 19:37 2 -> /dev/pts/1
lr-x------    1 root     root           64 Feb  6 19:37 3 -> /tmp/rpm-tmp.14470

Additional Information:
N/a.
Comment 1 Jeff Johnson 2002-02-06 16:41:44 EST
Will be fixed in rpm-4.0.4-0.30 (and rpm-4.0.4 final.

Off to openssh to get the daemon repaired as well (sorry Nalin)
Comment 2 Pavel Kankovsky 2002-02-12 13:26:11 EST
While browsing bugs for openssh (!), I have found bugs #18988 (1.5 years old),
#27749 (1 year old) describing the same problem. I hope you are going to fix rpm
for real this time... ;)
Comment 3 Tomas Mraz 2005-02-03 05:44:38 EST

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

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