Description of problem: When I want to close a filehandle in current shell (exec NUM<&-), it suddenly stopped to work with rhel5betas. It worked just fine with rhel4 and with fedora core 2 & 3, stopped to work in fc6 too. How reproducible: 100% reproducible, this simple script demonstrates the issue: exec 101< /etc/passwd ; ls -la /proc/$$/fd ; exec 101<&- ; ls -la /proc/$$/fd On rhel5beta I get total 5 dr-x------ 2 green green 0 Nov 27 20:44 . dr-xr-xr-x 4 green green 0 Nov 27 20:44 .. lrwx------ 1 green green 64 Nov 27 20:44 0 -> /dev/pts/22 lrwx------ 1 green green 64 Nov 27 20:44 1 -> /dev/pts/22 lr-x------ 1 green green 64 Nov 27 20:44 101 -> /etc/passwd lrwx------ 1 green green 64 Nov 27 20:44 2 -> /dev/pts/22 lrwx------ 1 green green 64 Nov 27 20:44 255 -> /dev/pts/22 total 5 dr-x------ 2 green green 0 Nov 27 20:44 . dr-xr-xr-x 4 green green 0 Nov 27 20:44 .. lrwx------ 1 green green 64 Nov 27 20:44 0 -> /dev/pts/22 lrwx------ 1 green green 64 Nov 27 20:44 1 -> /dev/pts/22 lr-x------ 1 green green 64 Nov 27 20:44 101 -> /etc/passwd lrwx------ 1 green green 64 Nov 27 20:44 2 -> /dev/pts/22 lrwx------ 1 green green 64 Nov 27 20:44 255 -> /dev/pts/22 Where correct output is this (note how /etc/passwd is not show in second ls output) (this example is from fc2): total 5 dr-x------ 2 green green 0 Nov 27 17:12 . dr-xr-xr-x 3 green green 0 Nov 27 17:12 .. lrwx------ 1 green green 64 Nov 27 20:38 0 -> /dev/pts/1 lrwx------ 1 green green 64 Nov 27 20:38 1 -> /dev/pts/1 lr-x------ 1 green green 64 Nov 27 20:38 101 -> /etc/passwd lrwx------ 1 green green 64 Nov 27 20:38 2 -> /dev/pts/1 lrwx------ 1 green green 64 Nov 27 20:38 255 -> /dev/pts/1 total 4 dr-x------ 2 green green 0 Nov 27 17:12 . dr-xr-xr-x 3 green green 0 Nov 27 17:12 .. lrwx------ 1 green green 64 Nov 27 20:38 0 -> /dev/pts/1 lrwx------ 1 green green 64 Nov 27 20:38 1 -> /dev/pts/1 lrwx------ 1 green green 64 Nov 27 20:38 2 -> /dev/pts/1 lrwx------ 1 green green 64 Nov 27 20:38 255 -> /dev/pts/1 Additional info: This must be some generic bash bug, as SLES10 also has this problem.
This seems to be fixed in latest bash, at least this entry at http://tiswww.tis.case.edu/~chet/bash/CHANGES eems to be related: ii. Fixed a bug that could cause file descriptors > 10 to not be closed even when closed explicitly by a script.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Since this bugzilla is in a component that is not approved for the current release, it has been closed with resolution deferred. You may reopen this bugzilla for consideration in the next release.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
Which versions of Bash does this bug effect?
Only 3.1, I think. Isn't this a duplicate of bug 345181?
(or the other way round, probably, I should've closed the other one)
*** Bug 345181 has been marked as a duplicate of this bug. ***
The Bug description ist wrong. Should be Product: Red Hat Enterprise Linux Version: 5(.1) On our site we have to rewrite Shell Scripts, which do not work anymore after upgrade from RHEL4. A quick fix whould be very appreciated. Kind Regards, Roland
I know, we're fixing this in EL 5.2.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2008-0380.html