Bug 91331

Summary: dos2unix doesn't preserve mode
Product: [Retired] Red Hat Raw Hide Reporter: hjl
Component: dos2unixAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: mudwa, ramasubbu_sk, redhat
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-01-31 17:26:53 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:    
Bug Blocks: 123268, 183627    
Attachments:
Description Flags
A patch to preserve mode none

Description hjl 2003-05-21 15:13:04 UTC
[hjl@gnu-d tmp]$ touch foo
[hjl@gnu-d tmp]$ chmod +x foo
[hjl@gnu-d tmp]$ ls -l foo
-rwxr-xr-x    1 hjl      hjl             0 May 21 08:14 foo
[hjl@gnu-d tmp]$ dos2unix foo
dos2unix: converting file foo to UNIX format ...
[hjl@gnu-d tmp]$ ls -l foo
-rw-------    1 hjl      hjl             0 May 21 08:14 foo

Comment 1 hjl 2003-05-21 15:14:16 UTC
Created attachment 91860 [details]
A patch to preserve mode

Comment 2 Mike A. Harris 2003-05-21 15:29:50 UTC
*** Bug 55183 has been marked as a duplicate of this bug. ***

Comment 3 Anders Kaseorg 2003-11-06 04:03:36 UTC
I think it's worth pointing out that the user and group aren't
preserved either, though that's probably harder to fix.

Comment 4 Miloslav Trmac 2004-02-06 18:19:07 UTC
*** Bug 112710 has been marked as a duplicate of this bug. ***

Comment 5 David Anderson 2004-08-10 17:39:34 UTC
This problem also occurs with the unix2dos program. I also noticed 
that it will sometimes create temporary files in /roots directory 
which seems like some strange activity for this kind of application?

Comment 6 Mike A. Harris 2004-09-26 09:04:58 UTC
*** Bug 132145 has been marked as a duplicate of this bug. ***

Comment 7 Mike A. Harris 2004-10-06 20:23:36 UTC
Thanks, added fix to dos2unix-3.1-20 in rawhide.

Comment 8 Tim Powers 2005-05-20 00:35:33 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-2005-195.html


Comment 10 Mahesh Tawari 2007-07-12 19:51:02 UTC
Looks like this bug is not fixed for new file created using  -n option

-rw-r--r--    1 xyz dvl            25 Jul 12 12:37 test.txt

unix2dos -n test.txt test2.txt

-rw-------    1 xyz  dvl            32 Jul 12 12:39 test2.txt

Read permission for other and group is missing for new file test2.

Comment 11 Tim Waugh 2007-07-13 11:02:05 UTC
I think this is a separate problem: when creating a new file it ought to set the
initial permissions to 0666 and let the kernel umask mask off the inappropriate
bits.  Please file a new bug report.