summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorMichael Scherer <misc@ephaone.org>2014-09-29 18:02:42 -0400
committerMichael Scherer <misc@ephaone.org>2014-09-29 18:02:42 -0400
commit9cbd4d0faddf4f1f692f7a7ee7189c8bb1f901e6 (patch)
treef2e1871cde5c19fe94b46cde121907771cf31b47 /files
parentdb5668b84c3a19498b843d0bfe34574aef40c193 (diff)
downloadansible-modules-core-9cbd4d0faddf4f1f692f7a7ee7189c8bb1f901e6.tar.gz
Fix old ticket #9092 where a playbook can enter in recursion
This can be tested with this command : ansible -c local -m copy -a 'src=/etc/group dest=foo/' all This is a corner case of the algorithm used to find how we should copy recursively a folder, and this commit detect it and avoid it. Check https://github.com/ansible/ansible/issues/9092 for the story
Diffstat (limited to 'files')
-rw-r--r--files/copy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/files/copy.py b/files/copy.py
index eff46dae..203a36b5 100644
--- a/files/copy.py
+++ b/files/copy.py
@@ -176,7 +176,7 @@ def main():
if original_basename and dest.endswith("/"):
dest = os.path.join(dest, original_basename)
dirname = os.path.dirname(dest)
- if not os.path.exists(dirname):
+ if not os.path.exists(dirname) and '/' in dirname:
(pre_existing_dir, new_directory_list) = split_pre_existing_dir(dirname)
os.makedirs(dirname)
directory_args = module.load_file_common_arguments(module.params)