Bug 1483633
Summary: | Add option to force in-place conversion even if ownership cannot be preserved | |||
---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Filip Krska <fkrska> | |
Component: | dos2unix | Assignee: | Tim Waugh <twaugh> | |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 27 | CC: | praiskup, supercyper1, twaugh, waterlan | |
Target Milestone: | --- | Keywords: | FutureFeature | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | dos2unix-7.4.0-1.fc28 | Doc Type: | Enhancement | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1483637 (view as bug list) | Environment: | ||
Last Closed: | 2017-10-11 10:05:37 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1483637 |
Description
Filip Krska
2017-08-21 14:15:03 UTC
The explanation is in the manual. See option -o, --oldfile https://waterlan.home.xs4all.nl/dos2unix/dos2unix.htm#OPTIONS In an industry environment users can be member of many unix groups. It could happen that a user who is member of many groups changes unintended the group permission, and make the file unreadable for people with less group permissions. Also the file could be made readable for people who should not be able to read it. The original group permission must (or could) have been there for a reason. If you intentionally want to create a new file with your own user/group permission, use the -n (new file) option: dos2unix -n file file Is this sufficient for you? regards, Erwin The feature keep the original permissions was introduced in version 5.3.1 (2011-08-09), based on a bug report by Christopher Williams, McAfee, Inc. See https://sourceforge.net/p/dos2unix/bugs/7/ Dear Filip, These broken scripts, are these RedHat's own scripts, or did you get problem reports from RHEL customers? Is 'dos2unix -n file file' an acceptable solution, or do you really need a new option to change oldfile (in-place) mode behaviour? In both cases, using option -n or a new option, scripts need to be adapted. If you want exactly the old pre-5.3.1 behaviour you can add CFLAGS_USER=-DNO_CHOWN to the build make command line. Then there will be no script changes needed. The manual will not be in line with the behaviour then. The behaviour changed in 2011. Other people see the old behaviour as a bug. Going back to the old behaviour is not an option, but I will consider a new option as requested if it is really needed. best regards, Erwin Waterlander If it is hard to explain show them that running these commands: chown $(whoami) /tmp/tmp/file chgrp $(id -gn) /tmp/tmp/file also fail. $ chown $(whoami) /tmp/tmp/file chown: changing ownership of '/tmp/tmp/file': Operation not permitted $ chgrp $(id -gn) /tmp/tmp/file chgrp: changing group of '/tmp/tmp/file': Operation not permitted And when you change the file with an editor the owner and group permissions do not change. Only when you delete the original file and create a new file you can change ownership and group. The downside of the -n option is that you can't use wild cards. Converting multiple files in-place with -n requires extra scripting. In the next dos2unix version I will add an option which makes dos2unix continue if the original owner/group properties can't be restored. A message will be printed to notify the user. Option -V will show if dos2unix was compiled with -DNO_CHOWN or not. A beta version of dos2unix is available which has a new option --allow-chown. https://waterlan.home.xs4all.nl/dos2unix/dos2unix-7.3.6-beta2.tar.gz Today I released dos2unix 7.4.0 which has a new option --allow-chown. |