Skip to content

Commit

Permalink
(SIMP-3803) Set minimum length on sssd::domains (#48)
Browse files Browse the repository at this point in the history
Prior to this commit it was possible to set the parameter
`sssd::domains` to the empty array or an array containing the empty
string, neither of which is allowed according to the README.  The
resulting behavior in such a cases was undefined and generally
erroneous.  This commit sets a minimum length on the parameter's array
to 1, and requires the contained strings to be between 1 and 255
characters in accordance with RFC 2181.

SIMP-3803 #close
  • Loading branch information
lamawithonel authored and Nick Markowski committed Sep 25, 2017
1 parent d26770b commit 52ab72f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ before_script:
bundler_args: --without development system_tests --path .vendor
before_install: rm Gemfile.lock || true
script:
- bundle exec rake compare_latest_tag
- bundle exec rake test
notifications:
email: false
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Mon Sep 18 2017 Lucas Yamanishi <[email protected]> - 6.0.4-0
- Set minimum length on sssd::domains

* Mon Sep 11 2017 Judy Johnson <[email protected]> - 6.0.3-0
- Only enable 'try_inotify' if explicitly set

Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# @author https://github.com/simp/pupmod-simp-sssd/graphs/contributors
#
class sssd (
Array[String] $domains,
Array[String[1, 255], 1] $domains,
Optional[Sssd::DebugLevel] $debug_level = undef,
Boolean $debug_timestamps = true,
Boolean $debug_microseconds = false,
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-sssd",
"version": "6.0.3",
"version": "6.0.4",
"author": "SIMP Team",
"summary": "Manages SSSD",
"license": "Apache-2.0",
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@

end

context 'when domains is set to the empty array' do
let(:params) {{ domains: [] }}

it { is_expected.to compile.and_raise_error(/parameter 'domains' expects size to be at least 1/) }
end

context 'when domains contains the empty string' do
let(:params) {{ domains: [''] }}

it { is_expected.to compile.and_raise_error(/parameter 'domains' index 0 expects a String\[1, 255\] value, got String/) }
end

context 'try_inotify = ' do
context 'unset' do
it {
Expand Down

0 comments on commit 52ab72f

Please sign in to comment.