diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2011-05-30 20:17:11 +0200 |
|---|---|---|
| committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-07-26 14:04:28 -0700 |
| commit | 0c385f1fb436ab6f667693d347f711470305a019 (patch) | |
| tree | 55729107ceff5b3f3062cfdac524696e69c4018b /spec | |
| parent | 8da0486c36e095e9a08b6f5a79abf3cabeba6603 (diff) | |
| download | puppet-0c385f1fb436ab6f667693d347f711470305a019.tar.gz puppet-0c385f1fb436ab6f667693d347f711470305a019.tar.xz puppet-0c385f1fb436ab6f667693d347f711470305a019.zip | |
Fix #5010 - Allow leading whitespace in auth.conf
The regex used to detect ACE is too lax and would allow trailing
spaces to sneak in, which in turn would confuse the ACE parser.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/integration/network/rest_authconfig_spec.rb | 1 | ||||
| -rwxr-xr-x | spec/unit/network/authconfig_spec.rb | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/spec/integration/network/rest_authconfig_spec.rb b/spec/integration/network/rest_authconfig_spec.rb index dc4d3282b..7c50d8970 100644 --- a/spec/integration/network/rest_authconfig_spec.rb +++ b/spec/integration/network/rest_authconfig_spec.rb @@ -119,7 +119,6 @@ describe Puppet::Network::RestAuthConfig do end it "should support trailing whitespace" do - pending('bug #5010') add_rule('allow host.domain.com ') @auth.should allow(request) diff --git a/spec/unit/network/authconfig_spec.rb b/spec/unit/network/authconfig_spec.rb index c47b2e0c5..f33de7872 100755 --- a/spec/unit/network/authconfig_spec.rb +++ b/spec/unit/network/authconfig_spec.rb @@ -184,6 +184,18 @@ describe Puppet::Network::AuthConfig do @authconfig.read end + it "should strip whitespace around ACE" do + acl = stub 'acl', :info + + @fd.stubs(:each).multiple_yields('[puppetca]', ' allow 127.0.0.1 , 172.16.10.0 ') + @rights.stubs(:newright).with("[puppetca]", 1, 'dummy').returns(acl) + + acl.expects(:allow).with('127.0.0.1') + acl.expects(:allow).with('172.16.10.0') + + @authconfig.read + end + it "should create an allow ACE on each subsequent allow" do acl = stub 'acl', :info |
