ansible/test
David Shrewsbury 0ae4dac65a
Fix copy module file perms with remote_src (#69993)
When using 'remote_src: yes' and 'mode: preserve', the code handling
the file modes has to be handled on the remote node because it's
the one that has access to the source files. This means that the
copy module itself must handle this, rather than the copy action
plugin (which is where all that logic exists). The copy module
handles this when we copy a single file over. But when it is a
directory as the src parameter value, the mode of the files
beneath it are not considered. Subdirectories are copied with
shutil.copytree() which will preserve permissions automatically.
Individual files are copied with shutil.copyfile() which does NOT
preserve permissions. We need to add some calls to shutil.copymode()
to correct that.

Note: This *always* retains individial file permissions. Specifying
a 'mode' other than 'preserve' when giving a source directory for
the 'src' param does not make sense so will be ignored in that case
only.

Fixes #69783

* Add changelog and test
2020-06-11 15:18:59 -04:00
..
ansible_test
integration Fix copy module file perms with remote_src (#69993) 2020-06-11 15:18:59 -04:00
lib/ansible_test Fix changelog sanity test config detection. 2020-06-11 11:57:58 -07:00
sanity Use antsibull-changelog instead of packaged changelog generator (#69313) 2020-06-11 11:21:21 -07:00
support Deprecation revisited (#69926) 2020-06-09 15:21:19 -07:00
units config: singular ANSIBLE_COLLECTIONS_PATH (#70007) 2020-06-11 11:40:13 -07:00
utils/shippable Use antsibull-changelog instead of packaged changelog generator (#69313) 2020-06-11 11:21:21 -07:00