Bug 187819

Summary: dos2unix segmentation fault on long filenames
Product: [Fedora] Fedora Reporter: Gabe da Silveira <gabe>
Component: dos2unixAssignee: Tim Waugh <twaugh>
Status: CLOSED WORKSFORME QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-15 12:12:45 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:

Description Gabe da Silveira 2006-04-03 19:26:55 UTC
Description of problem:

dos2unix segfaults on long filenames.  I believe this is due to a recent patch, as we had a script running 
for years that broke when we had to recently re-install the latest version of Fedora Core.  I'm not sure 
how recently or how frequently dos2unix itself has been patched.

Here is a transcript.  As you can see dos2unix fails when given the full path to the file but works fine 
when given the relative path.  I believe this is due to filename length.

[root@www quickIdxProperty_sfarCommercialBuilding_1142689503]# pwd
/tmp/quickIdxProperty_sfarCommercialBuilding_1142689503
[root@www quickIdxProperty_sfarCommercialBuilding_1142689503]# ls
listings-commercial building.txt
[root@www quickIdxProperty_sfarCommercialBuilding_1142689503]# dos2unix /tmp/
quickIdxProperty_sfarCommercialBuilding_1142689503/listings-commercial\ building.txt
dos2unix: converting file /tmp/quickIdxProperty_sfarCommercialBuilding_1142689503/listings-
commercial building.txt to UNIX format ...
Segmentation fault
[root@www quickIdxProperty_sfarCommercialBuilding_1142689503]# dos2unix listings-commercial\ 
building.txt 
dos2unix: converting file listings-commercial building.txt to UNIX format ...
[root@www quickIdxProperty_sfarCommercialBuilding_1142689503]# 

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

3.1

How reproducible:

Easily reproducible on my system.  Unfortunately I haven't tested on any other systems...

Comment 1 Gabe da Silveira 2006-04-03 19:50:50 UTC
Upon further testing this is false.  The command works as long as I do not use an absolute path...  That 
is:

cd /
dos2unix tmp/
quickIdxProperty_sfarCommercialBuilding_1142689503/listings-commercial\ building.txt

works, whereas 

dos2unix /dos2unix /tmp/
quickIdxProperty_sfarCommercialBuilding_1142689503/listings-commercial\ building.txt

does not work. unix2dos does not suffer from this problem.

Comment 2 Tim Waugh 2006-07-10 14:59:29 UTC
Are you still seeing this problem?  If so, please show me the output of 'rpm -q
dos2unix' so that I can see which release you're using.