Ensure that filenames from archives are not expanded

This fixes #21795
This commit is contained in:
Dag Wieers 2017-02-24 01:12:55 +01:00 committed by Toshio Kuratomi
parent 7966beb6c9
commit 237411613d
2 changed files with 38 additions and 30 deletions

View file

@ -865,10 +865,10 @@ def main():
for filename in handler.files_in_archive:
file_args['path'] = os.path.join(dest, filename)
try:
res_args['changed'] = module.set_fs_attributes_if_different(file_args, res_args['changed'])
res_args['changed'] = module.set_fs_attributes_if_different(file_args, res_args['changed'], expand=False)
except (IOError, OSError):
e = get_exception()
module.fail_json(msg="Unexpected error when accessing exploded file: %s" % str(e), **res_args)
module.fail_json(msg="Unexpected error when accessing exploded file: %s" % e, **res_args)
if module.params['list_files']:
res_args['files'] = handler.files_in_archive