Bug 205134 - sed failes to update link files which are not a full path link.
Summary: sed failes to update link files which are not a full path link.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: sed
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Petr Machata
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On: 205122
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-09-04 15:18 UTC by Petr Machata
Modified: 2015-05-05 01:32 UTC (History)
1 user (show)

Fixed In Version: RHBA-2007-0298
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-01 22:44:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0298 0 normal SHIPPED_LIVE sed bug fix update 2007-04-28 18:38:52 UTC

Description Petr Machata 2006-09-04 15:18:43 UTC
+++ This bug was initially created as a clone of Bug #205122 +++

Description of problem:
sed failes to update link files which are not a full path link.

Version-Release number of selected component (if applicable):
sed-4.1.5-4.fc5

How reproducible:
Every time

Steps to Reproduce:
1. cd /root
2. mkdir test
3. echo zzz > test/test.txt
4. ln -s test/test.txt test.link
5. cd /tmp
6. sed -i -e 's/zzz/aaa/g' /root/test.link
sed: ck_follow_symlink: couldn't lstat test/test.txt: No such file or directory

Actual results:
sed: ck_follow_symlink: couldn't lstat test/test.txt: No such file or directory

Expected results:


Additional info:
The same command works on FedoraC4: sed-4.1.2-4

-- Additional comment from pmachata on 2006-09-04 11:16 EST --
Created an attachment (id=135502)
Fix

sed now looks if the symlinks begins with '/', and if not, it does relative
path traversal. It was applied to devel cvs tree and will appear in rawhide.

Comment 4 Petr Machata 2006-09-05 14:18:11 UTC
Created attachment 135562 [details]
Test case.

Automated testcase.  Usage:
$ sh test-symlink.sh ./sed-4.1.5/sed/sed
test-symlink.sh: line 32: ./sed-4.1.5/sed/sed: No such file or directory
Test failed: sed doesn't follow symlinks.
$ sh test-symlink.sh ./sed-4.1.5-pm/sed/sed
Test passed.

Comment 9 Red Hat Bugzilla 2007-05-01 22:44:25 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-2007-0298.html



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