Bug 91331 - dos2unix doesn't preserve mode
dos2unix doesn't preserve mode
Product: Red Hat Raw Hide
Classification: Retired
Component: dos2unix (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
Depends On:
Blocks: FC3Target 183627
  Show dependency treegraph
Reported: 2003-05-21 11:13 EDT by hjl
Modified: 2007-07-16 03:56 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-01-31 12:26:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description hjl 2003-05-21 11:13:04 EDT
[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 11:14:16 EDT
Created attachment 91860 [details]
A patch to preserve mode
Comment 2 Mike A. Harris 2003-05-21 11:29:50 EDT
*** Bug 55183 has been marked as a duplicate of this bug. ***
Comment 3 Anders Kaseorg 2003-11-05 23:03:36 EST
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 13:19:07 EST
*** Bug 112710 has been marked as a duplicate of this bug. ***
Comment 5 David Anderson 2004-08-10 13:39:34 EDT
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 05:04:58 EDT
*** Bug 132145 has been marked as a duplicate of this bug. ***
Comment 7 Mike A. Harris 2004-10-06 16:23:36 EDT
Thanks, added fix to dos2unix-3.1-20 in rawhide.
Comment 8 Tim Powers 2005-05-19 20:35:33 EDT
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 15:51:02 EDT
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 07:02:05 EDT
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.