Bug 490473

Summary: sed does not handle inline edits of symlinks with no dir portion
Product: Red Hat Enterprise Linux 5 Reporter: Martin Poole <mpoole>
Component: sedAssignee: Vojtech Vitek <vvitek>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: hripps, michele.marcionelli, ovasik, pbonzini, rvokal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-30 07:55:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 502934    
Bug Blocks:    
Attachments:
Description Flags
patch to find basename using basename rather than dirname
none
Patch based on upstream sed-4.2.1 and comment #7
none
Patch based on upstream sed-4.2.1 and comment #7 none

Description Martin Poole 2009-03-16 16:18:41 UTC
Created attachment 335365 [details]
patch to find basename using basename rather than dirname

Description of problem:

When executing on a symlink in present working directory, sed does not build the original path correctly, thus failing to follow the symlink.

Version-Release number of selected component (if applicable):

sed-4.1.5-5.fc6

How reproducible:

Always.

Steps to Reproduce:
1. echo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" >1
2. ln -s 1 2
3. sed -i -e 's/z/a/g' 2

Actual results:

sed: ck_follow_symlink: couldn't lstat 2/1: Not a directory

Expected results:

All z's in the file should be replaced with a's.  


Additional info:

Comment 1 RHEL Program Management 2009-03-16 16:21:47 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.

Comment 2 Jiri Moskovcak 2009-06-16 08:37:01 UTC
Are you sure this is the correct version from el5, it has the fc6 dist tag.

Comment 3 Issue Tracker 2009-06-16 08:50:53 UTC
Event posted on 06-16-2009 04:50am EDT by spoyarek

Yes, verified once again from RHN. It's in the "Red Hat Enterprise Linux
(v. 5 for $arch)" channels.


This event sent from IssueTracker by spoyarek 
 issue 276041

Comment 5 Radek Vokál 2009-06-16 09:07:15 UTC
Ok, so this problem is in RHEL5 since GA. Than I don't understand why it is marked as regression. Since the patch looks simple enough, I'm removing the regression flag and proposing this bug for 5.5 fastrack.

Comment 6 Issue Tracker 2009-06-16 09:21:29 UTC
Event posted on 06-16-2009 05:21am EDT by spoyarek

It is a regression of the latest patch (Fix handling of relative symlinks
(#205122)), which is why I marked it as such. I accidentally overlooked
the fact that it was the first RHEL-5 released package.


This event sent from IssueTracker by spoyarek 
 issue 276041

Comment 15 Vojtech Vitek 2011-03-09 12:11:22 UTC
Created attachment 483178 [details]
Patch based on upstream sed-4.2.1 and comment #7

Comment 16 Vojtech Vitek 2011-03-09 12:35:30 UTC
Created attachment 483199 [details]
Patch based on upstream sed-4.2.1 and comment #7

Sorry, there was some unnecessary mess in previous attachment.

Comment 20 errata-xmlrpc 2011-03-30 07:55: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 therefore 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-2011-0397.html