Skip to content

Commit

Permalink
escape comments
Browse files Browse the repository at this point in the history
  • Loading branch information
raybellis authored and traylenator committed Aug 6, 2024
1 parent 9f225bb commit 5b87fe9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/puppet/provider/sshd_config_match/augeas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ def create

def comment
augopen do |aug|
name = Regexp.escape(resource[:name])
comment = aug.get('$resource/Settings/#comment[1]')
comment&.sub!(%r{^#{resource[:name]}:\s*}i, '')
comment&.sub!(%r{^#{name}:\s*}i, '')
comment || ''
end
end
Expand Down

0 comments on commit 5b87fe9

Please sign in to comment.