Bug 19053 - Many programs from fileutils do not work when run with closed stdout
Summary: Many programs from fileutils do not work when run with closed stdout
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: fileutils
Version: 7.0
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
URL: ftp://ftp.linux.cz/pub/linux/people/j...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-13 14:46 UTC by Jan "Yenya" Kasprzak
Modified: 2007-03-27 03:36 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-10-13 14:46:52 UTC
Embargoed:


Attachments (Terms of Use)

Description Jan "Yenya" Kasprzak 2000-10-13 14:46:46 UTC
There is a problem in fileutils, which affects namely scripts. Scripts
often
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
removal
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 14:54:28 UTC
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.