Skip to content

Commit 824eec1

Browse files
raybellistraylenator
authored andcommitted
escape comments
1 parent b5ad38b commit 824eec1

File tree

1 file changed

+2
-1
lines changed
  • lib/puppet/provider/sshd_config_match

1 file changed

+2
-1
lines changed

lib/puppet/provider/sshd_config_match/augeas.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ def create
127127

128128
def comment
129129
augopen do |aug|
130+
name = Regexp.escape(resource[:name])
130131
comment = aug.get('$resource/Settings/#comment[1]')
131-
comment&.sub!(%r{^#{resource[:name]}:\s*}i, '')
132+
comment&.sub!(%r{^#{name}:\s*}i, '')
132133
comment || ''
133134
end
134135
end

0 commit comments

Comments
 (0)