Skip to content

Commit

Permalink
Prevent spec/ directory symlink recursion (#174)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
op-ct authored Mar 10, 2022
1 parent a4ed105 commit 6e9b42d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/simp/beaker_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ')

Expand Down

0 comments on commit 6e9b42d

Please sign in to comment.