Bug 91331 - dos2unix doesn't preserve mode
Summary: dos2unix doesn't preserve mode
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: dos2unix
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
Depends On:
Blocks: FC3Target 183627
TreeView+ depends on / blocked
Reported: 2003-05-21 15:13 UTC by hjl
Modified: 2007-07-16 07:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-01-31 17:26:53 UTC

Attachments (Terms of Use)
A patch to preserve mode (847 bytes, patch)
2003-05-21 15:14 UTC, hjl
no flags Details | Diff

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:195 low SHIPPED_LIVE dos2unix and unix2dos bug fix update 2005-05-19 04:00:00 UTC

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.


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.

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