summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/file_serving/configuration/parser.rb19
-rw-r--r--lib/puppet/network/authconfig.rb2
2 files changed, 7 insertions, 14 deletions
diff --git a/lib/puppet/file_serving/configuration/parser.rb b/lib/puppet/file_serving/configuration/parser.rb
index 334201d37..83b75e28f 100644
--- a/lib/puppet/file_serving/configuration/parser.rb
+++ b/lib/puppet/file_serving/configuration/parser.rb
@@ -24,9 +24,10 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile
when /^\s*$/; next # skip blank lines
when /\[([-\w]+)\]/
mount = newmount($1)
- when /^\s*(\w+)\s+(.+)$/
+ when /^\s*(\w+)\s+(.+?)(\s*#.*)?$/
var = $1
value = $2
+ value.strip!
raise(ArgumentError, "Fileserver configuration file does not use '=' as a separator") if value =~ /^=/
case var
when "path"
@@ -58,12 +59,8 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile
begin
mount.info "allowing #{val} access"
mount.allow(val)
- rescue AuthStoreError => detail
-
- raise ArgumentError.new(
- detail.to_s,
-
- @count, file)
+ rescue Puppet::AuthStoreError => detail
+ raise ArgumentError.new(detail.to_s, @count, file)
end
}
end
@@ -75,12 +72,8 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile
begin
mount.info "denying #{val} access"
mount.deny(val)
- rescue AuthStoreError => detail
-
- raise ArgumentError.new(
- detail.to_s,
-
- @count, file)
+ rescue Puppet::AuthStoreError => detail
+ raise ArgumentError.new(detail.to_s, @count, file)
end
}
end
diff --git a/lib/puppet/network/authconfig.rb b/lib/puppet/network/authconfig.rb
index 61fb24ded..1e486a2f9 100644
--- a/lib/puppet/network/authconfig.rb
+++ b/lib/puppet/network/authconfig.rb
@@ -102,7 +102,7 @@ module Puppet
name = $3 if $2 == "path"
name.chomp!
right = newrights.newright(name, count, @file)
- when /^\s*(allow|deny|method|environment|auth(?:enticated)?)\s+(.+)$/
+ when /^\s*(allow|deny|method|environment|auth(?:enticated)?)\s+(.+?)(\s*#.*)?$/
parse_right_directive(right, $1, $2, count)
else
raise ConfigurationError, "Invalid line #{count}: #{line}"