Bug 169045

Summary: dos2unix resets file owner, ACLs
Product: Red Hat Enterprise Linux 4 Reporter: Josh Kelley <joshkel>
Component: dos2unixAssignee: Tim Waugh <twaugh>
Status: CLOSED WONTFIX QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: jhutar, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-12 10:47:12 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:

Description Josh Kelley 2005-09-22 14:42:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

Description of problem:
When dos2unix or unix2dos is run on a file, it resets the file owner and group to the current user and clears out any ACLs defined on that file.

Version-Release number of selected component (if applicable):
3.1-21

How reproducible:
Always

Steps to Reproduce:
1. Create a file as root.
2. Change the owner and group on that file to non-root.
3. Define an ACL on that file.
4. Run "dos2unix file" or "unix2dos file".

Actual Results:  File is owned by root:root, no ACLs.

Expected Results:  File retains its owner, group and ACL information.

Additional info:

Comment 1 Jan Hutaƙ 2007-10-29 18:50:48 UTC
Seems to be still valid in F8 (unix2dos-2.2-29.fc8):

# ls -al test
-rw-rwxr-- 1 pok pok 8 2007-10-29 19:33 test
# unix2dos test
unix2dos: converting file test to DOS format ...
# ls -al test 
-rw-rwxr-- 1 root root 10 2007-10-29 19:42 test

Please note when I run the "unix2dos" as a "pok" user, owner and group is not changed.

Comment 4 RHEL Program Management 2008-10-31 16:39:30 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 5 Tim Waugh 2009-11-12 10:47:12 UTC
To preserve this information use dos2unix in this manner:

dos2unix -n infile outfile
cat outfile > infile
rm -f outfile

(and similarly for unix2dos)