Bug 19053 - Many programs from fileutils do not work when run with closed stdout
Many programs from fileutils do not work when run with closed stdout
Product: Red Hat Linux
Classification: Retired
Component: fileutils (Show other bugs)
All Linux
high Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2000-10-13 10:46 EDT by Jan "Yenya" Kasprzak
Modified: 2007-03-26 23:36 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-10-13 10:46:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan "Yenya" Kasprzak 2000-10-13 10:46:46 EDT
There is a problem in fileutils, which affects namely scripts. Scripts
run from some daemons, with closed standard output. However, fileutils
contains buggy code in lib/closeout.c, which causes programs from fileutils
to fail in the case of closed stdout.

Try to run the following on Red Hat 7.0 (under bash):

/bin/rm -f /some/file >&-

The result is an error condition (write error: bad file descriptor), and
of /some/file fails.

I have written a simple patch and a new spec-file, which are available
at http://ftp.linux.cz/pub/linux/people/jan_kasprzak/fileutils/. The patch
simply checks for errno value after fclose() and handles EBADF value
as if there was no error at all.

This bug can affect many shell scripts, and it is hard to detect..
Comment 1 Bernhard Rosenkraenzer 2000-10-13 10:54:28 EDT
This is fixed in 4.0.27-1 (rawhide).

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