From 901d349f459b2ca97e483224da9d2097ba4c2204 Mon Sep 17 00:00:00 2001 From: Paul Calabro Date: Thu, 28 Jan 2016 13:05:10 -0700 Subject: [PATCH] Adding a hyphen in the perms pattern section, since doing something like go=- is a quick way to strip all permissions for non-owners. --- lib/ansible/module_utils/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index b420f18e6e..3ba19886b2 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -929,7 +929,7 @@ class AnsibleModule(object): def _symbolic_mode_to_octal(self, path_stat, symbolic_mode): new_mode = stat.S_IMODE(path_stat.st_mode) - mode_re = re.compile(r'^(?P[ugoa]+)(?P[-+=])(?P[rwxXst]*|[ugo])$') + mode_re = re.compile(r'^(?P[ugoa]+)(?P[-+=])(?P[rwxXst-]*|[ugo])$') for mode in symbolic_mode.split(','): match = mode_re.match(mode) if match: