From 6cb8fdeaf2e9c7c787fa42dcf92a4bc36913b365 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 28ded355ffc..3fb02113356 100644 --- a/lib/ansible/plugins/shell/__init__.py +++ b/lib/ansible/plugins/shell/__init__.py @@ -91,10 +91,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)