From 6e9b42d1dc46d9f83b9b2d0df1da48376505b3ee Mon Sep 17 00:00:00 2001 From: op-ct Date: Thu, 10 Mar 2022 09:33:35 -0500 Subject: [PATCH] Prevent `spec/` directory symlink recursion (#174) Before this patch, the `tar` operation in `copy_fixture_modules_to` could get stuck on an endless recursive directory loop when the `spec/fixtures/modules/` directory contained a symlink to the module itself. The `spec/` directory is only used for spec testing and is not required by SUTs to compile the module's code and data. This patch prevents tar from recursing module fixtures entirely by adding `spec/` to the directories that `tar` excludes. Fixes #173 --- CHANGELOG.md | 3 ++- lib/simp/beaker_helpers.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcaf052..089a9f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -### 1.24.2 / 2022-02-20 +### 1.24.2 / 2022-03-09 * Fixed: + * Prevent `spec/` directory symlink recursion in `copy_fixture_modules_to` * Update the derivatives workaround to insert an inert line instead of commenting out the previous line to allow for logic updates * Addressed a bug where passing an empty exceptions array would produce an diff --git a/lib/simp/beaker_helpers.rb b/lib/simp/beaker_helpers.rb index 76d423d..8854945 100644 --- a/lib/simp/beaker_helpers.rb +++ b/lib/simp/beaker_helpers.rb @@ -411,7 +411,7 @@ def copy_fixture_modules_to( suts = hosts, opts = {}) begin tarfile = "#{Simp::BeakerHelpers.tmpname}.tar" - excludes = PUPPET_MODULE_INSTALL_IGNORE.map do |x| + excludes = (PUPPET_MODULE_INSTALL_IGNORE + ['spec']).map do |x| x = "--exclude '*/#{x}'" end.join(' ')