Skip to content

Commit dc3cfd3

Browse files
committed
Fix detection of insecure interpolations in unless parameter
When using the `unless` parameter of an `exec` resource with unsafe string interpolation, the linter should warn about the issue. It happen that it currently doesn't because unless is also a keyword. Adjust the linter to cope with this.
1 parent 4c96ff3 commit dc3cfd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet-lint/plugins/check_unsafe_interpolations.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def check_unsafe_title(title)
3333
def check_unsafe_interpolations(command_resources)
3434
command_resources[:tokens].each do |token|
3535
# Skip iteration if token isn't a command of type :NAME
36-
next unless COMMANDS.include?(token.value) && token.type == :NAME
36+
next unless COMMANDS.include?(token.value) && (token.type == :NAME || token.type == :UNLESS)
3737
# Don't check the command if it is parameterised
3838
next if parameterised?(token)
3939

0 commit comments

Comments
 (0)