Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included length check of vas_conf_client_addrs #91

Merged
merged 1 commit into from
Feb 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@
validate_absolute_path($vas_group_override_path)
}

# client-addrs has a limit of 1024 and vasypd will fail completely
# if this limit is exceeded!!
if $vas_conf_client_addrs != 'UNSET' {
validate_slength($vas_conf_client_addrs,1024)
}

if $vas_conf_disabled_user_pwhash != undef {
validate_string($vas_conf_disabled_user_pwhash)
}
Expand Down
21 changes: 21 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,27 @@
end
end

context 'with vas_conf_client_addrs set to a string too long (>1024 bytes)' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
:lsbmajdistrelease => '6',
:operatingsystemmajrelease => '6',
:fqdn => 'host.example.com',
:domain => 'example.com',
:vas_version => '4.1.0.21518',
}
end
let :params do
{ :vas_conf_client_addrs => '100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100 100.100.100.100' }
end

it 'should fail' do
expect { should contain_class('vas') }.to raise_error(Puppet::Error, /validate_slength/)
end
end

context 'with users_allow_entries specified as an array on osfamily redhat with lsbmajdistrelease 6' do
let :facts do
{
Expand Down