summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2016-06-17 07:00:21 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2016-06-17 09:40:53 -0700
commit9d91d2c6b829bec8ff7781143346a2c2250747b4 (patch)
tree44de44e1713067f0be56565829e1ba75162d815b
parent552172b141e76365358fbdf16fbafa394ca3bf52 (diff)
downloadansible-9d91d2c6b829bec8ff7781143346a2c2250747b4.tar.gz
Use find instead of -R for recursive setfacl (#16340)
(-R is not present on Solaris or freebsd setfacl) Fixes #16322
-rw-r--r--lib/ansible/plugins/shell/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/plugins/shell/__init__.py b/lib/ansible/plugins/shell/__init__.py
index d0613beeb3..ef1c5bb929 100644
--- a/lib/ansible/plugins/shell/__init__.py
+++ b/lib/ansible/plugins/shell/__init__.py
@@ -90,10 +90,11 @@ class ShellBase(object):
mode = pipes.quote(mode)
user = pipes.quote(user)
- cmd = ['setfacl']
+ cmd = ['setfacl', '-m', 'u:%s:%s' % (user, mode)]
if recursive:
- cmd.append('-R')
- cmd.extend(('-m', 'u:%s:%s %s' % (user, mode, path)))
+ cmd = ['find', path, '-exec'] + cmd + ["'{}'", "';'"]
+ else:
+ cmd.append(path)
return ' '.join(cmd)