From 9d91d2c6b829bec8ff7781143346a2c2250747b4 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 17 Jun 2016 07:00:21 -0700 Subject: [PATCH] Use find instead of -R for recursive setfacl (#16340) (-R is not present on Solaris or freebsd setfacl) Fixes #16322 --- lib/ansible/plugins/shell/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/shell/__init__.py b/lib/ansible/plugins/shell/__init__.py index d0613beeb33..ef1c5bb9291 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)