From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050909 Fedora/1.0.6-1.2.fc4 Firefox/1.0.6 Description of problem: sed -i segfaults when the target file is in a readonly directory Version-Release number of selected component (if applicable): sed-4.0.7-3 How reproducible: Always Steps to Reproduce: 1. mkdir -p testcases/sed 2. cd testcases/sed 3. mkdir readonly 4. echo hello\\nhello again > readonly/testfile 5. chmod 500 readonly 6. sed -i -e 2d readonly/testfile Actual Results: Segmentation fault Expected Results: at least sed: couldn't open temporary file readonly//sedEpzma8: Permission denied at best use a temp file elsewhere Additional info: rhel4 with sed-4.1.2-4 more correctly gives sed: couldn't open temporary file readonly//sedEpzma8: Permission denied (but why not make a tempfile somewhere else in this case)
Created attachment 119298 [details] sed-4.0.7-i-mkstemp.patch Fix.
This issue is on Red Hat Engineering's list of planned work items for the upcoming Red Hat Enterprise Linux 3.8 release. Engineering resources have been assigned and barring unforeseen circumstances, Red Hat intends to include this item in the 3.8 release.
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-2006-0362.html