Bug 169193 - sed -i segfaults in readonly target directory
Summary: sed -i segfaults in readonly target directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: sed
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Machata
QA Contact: Ben Levenson
URL:
Whiteboard: RHEL3U7NAK
Depends On:
Blocks: RHEL3U8CanFix
TreeView+ depends on / blocked
 
Reported: 2005-09-24 11:53 UTC by Neil Prockter
Modified: 2015-05-05 01:32 UTC (History)
1 user (show)

Fixed In Version: RHBA-2006-0362
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-20 15:06:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sed-4.0.7-i-mkstemp.patch (775 bytes, patch)
2005-09-27 14:58 UTC, Jakub Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0362 0 normal SHIPPED_LIVE sed bug fix update 2006-07-19 19:16:00 UTC

Description Neil Prockter 2005-09-24 11:53:37 UTC
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)

Comment 1 Jakub Jelinek 2005-09-27 14:58:21 UTC
Created attachment 119298 [details]
sed-4.0.7-i-mkstemp.patch

Fix.

Comment 8 Bob Johnson 2006-04-11 15:50:25 UTC
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.

Comment 13 Red Hat Bugzilla 2006-07-20 15:06:34 UTC
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



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