Red Hat Bugzilla – Bug 437465
"dos2unix -n" creates files with overly restrictive permissions
Last modified: 2013-04-15 04:55:13 EDT
Description of problem:
"dos2unix -n" creates its new file with an overly restrictive mode: in fact the
new file is always created with mode 600. This differs from "dos2unix -a" where
the mode of the file is retained and "cp" which keeps the source file mode,
modulo the umask.
Version-Release number of selected component (if applicable): 3.1-21.2 (also
present in several other versions, including those on RHEL4 and Fedora8)
How reproducible: always
Steps to Reproduce:
1. touch xxx
2. dos2unix -n xxx yyy
3. ls -l xxx yyy
Assuming your umask is 002, xxx has permissions 664 but yyy has permissions 600
yyy should have the same permissions as xxx (modulo the umask)
I would expect similar permissions to those obtained from "cp xxx yyy" The
attached patch does exactly that: the temporary file created for the conversion
has its permissions change to match the source file with the bits from the
current umask masked off.
Created attachment 298043 [details]
The same patch can be applied to dos2unix from both RHEL4 and Fedora8
Thanks for the patch.
See also 437469
Proposing for RHEL-5.3 and granting Devel ACK.
Read ya, Phil
If bug #437469 is a FasTrack candidate, this bug should be as well.
As per comment #7 proposing bug for RHEL-5.3 FasTrack.
Read ya, Phil
This bugzilla was reviewed by QE as a non-FasTrack request.
It has since been proposed for FasTrack. The qa_ack has
been reset. QE needs to re-review this bugzilla for FasTrack.
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 therefore 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.