From e81b02cae85f7c3e402fcb1cc1512da5ee3bcf35 Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Mon, 6 Nov 2023 15:41:25 -0500 Subject: [PATCH] Add lib symlink to bwrap call (#1312) * add lib symlink to bwrap call --- src/ansible_runner/config/runner.py | 1 + test/unit/config/test_runner.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/ansible_runner/config/runner.py b/src/ansible_runner/config/runner.py index 8523b30a..0633a23f 100644 --- a/src/ansible_runner/config/runner.py +++ b/src/ansible_runner/config/runner.py @@ -345,6 +345,7 @@ def wrap_args_for_sandbox(self, args): '--ro-bind', '/etc', '/etc', '--ro-bind', '/usr', '/usr', '--ro-bind', '/opt', '/opt', + '--symlink', 'usr/lib', '/lib', '--symlink', 'usr/lib64', '/lib64', ]) diff --git a/test/unit/config/test_runner.py b/test/unit/config/test_runner.py index 73d9b875..ea4ca97f 100644 --- a/test/unit/config/test_runner.py +++ b/test/unit/config/test_runner.py @@ -547,6 +547,7 @@ def test_bwrap_process_isolation_defaults(mocker): '--ro-bind', '/etc', '/etc', '--ro-bind', '/usr', '/usr', '--ro-bind', '/opt', '/opt', + '--symlink', 'usr/lib', '/lib', '--symlink', 'usr/lib64', '/lib64', '--bind', '/', '/', '--chdir', '/project', @@ -601,6 +602,7 @@ def isfile(self, _): '--ro-bind', '/etc', '/etc', '--ro-bind', '/usr', '/usr', '--ro-bind', '/opt', '/opt', + '--symlink', 'usr/lib', '/lib', '--symlink', 'usr/lib64', '/lib64', '--bind', '/', '/', '--chdir', os.path.realpath(rc.directory_isolation_path), @@ -639,6 +641,7 @@ def test_process_isolation_settings(mocker, tmp_path): '--ro-bind', '/etc', '/etc', '--ro-bind', '/usr', '/usr', '--ro-bind', '/opt', '/opt', + '--symlink', 'usr/lib', '/lib', '--symlink', 'usr/lib64', '/lib64', ] index = len(expected)