diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2016-06-17 07:00:21 -0700 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-06-17 09:40:53 -0700 |
commit | 9d91d2c6b829bec8ff7781143346a2c2250747b4 (patch) | |
tree | 44de44e1713067f0be56565829e1ba75162d815b | |
parent | 552172b141e76365358fbdf16fbafa394ca3bf52 (diff) | |
download | ansible-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__.py | 7 |
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) |