Loading manifests/client.pp +4 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,10 @@ define freeradius::client ( $fr_basepath = $::freeradius::params::fr_basepath $fr_group = $::freeradius::params::fr_group if ($secret !~ /\A[^\n]+\z/) { fail('Secrets cannot have newlines in them') } file { "${fr_basepath}/clients.d/${shortname}.conf": ensure => $ensure, mode => '0640', Loading spec/defines/client_spec.rb +12 −0 Original line number Diff line number Diff line Loading @@ -24,4 +24,16 @@ describe 'freeradius::client' do .that_requires('File[/etc/raddb/clients.d]') .that_requires('Group[radiusd]') end context 'with secret containing a newline' do let(:params) do super().merge( secret: "foo\nbar", ) end it do is_expected.to compile.and_raise_error(%r{Secrets cannot have newlines in them}) end end end Loading
manifests/client.pp +4 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,10 @@ define freeradius::client ( $fr_basepath = $::freeradius::params::fr_basepath $fr_group = $::freeradius::params::fr_group if ($secret !~ /\A[^\n]+\z/) { fail('Secrets cannot have newlines in them') } file { "${fr_basepath}/clients.d/${shortname}.conf": ensure => $ensure, mode => '0640', Loading
spec/defines/client_spec.rb +12 −0 Original line number Diff line number Diff line Loading @@ -24,4 +24,16 @@ describe 'freeradius::client' do .that_requires('File[/etc/raddb/clients.d]') .that_requires('Group[radiusd]') end context 'with secret containing a newline' do let(:params) do super().merge( secret: "foo\nbar", ) end it do is_expected.to compile.and_raise_error(%r{Secrets cannot have newlines in them}) end end end