[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
Created attachment 91860 [details] A patch to preserve mode
*** Bug 55183 has been marked as a duplicate of this bug. ***
I think it's worth pointing out that the user and group aren't preserved either, though that's probably harder to fix.
*** Bug 112710 has been marked as a duplicate of this bug. ***
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?
*** Bug 132145 has been marked as a duplicate of this bug. ***
Thanks, added fix to dos2unix-3.1-20 in rawhide.
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
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.
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.