Skip to content

file(WRITE): Avoid toggling permissions between 644 and 664

David Faure requested to merge dfaure/cmake:fix_chmod into master

On systems with umask 022, this function would set permissions to 664 and restore them to 644 at the end, every single time it was called (which is many times on e.g. install_manifest.txt).

The intent of the code was to make non-writable files temporarily writable and to restore permissions in the end, but really, if it's already user-writable there's no point in toggling this back and forth.

Topic-rename: file-WRITE-chmod

Edited by Brad King

Merge request reports