summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Bode <bodepd@gmail.com>2010-11-02 09:50:56 -0500
committerDan Bode <bodepd@gmail.com>2010-11-02 09:50:56 -0500
commit6ee92b1ec04ed4cf7d50c3f68b4aeabdaf1b21c3 (patch)
tree52dd9c4e4b03413ef19962dfd563738438ee4eb0
parent59e44507db4bc4d446f369b1f02cd99d031dd433 (diff)
Check that name for aliases matches pattern
-rw-r--r--lib/puppet/type/sudoers.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/type/sudoers.rb b/lib/puppet/type/sudoers.rb
index 73810e9..890bffa 100644
--- a/lib/puppet/type/sudoers.rb
+++ b/lib/puppet/type/sudoers.rb
@@ -187,6 +187,9 @@ Defaults@host x=y,one=1,two=2
checkprops(SUDOERS_DEFAULT)
elsif self.value(:type) == 'alias'
checkprops(SUDOERS_ALIAS)
+ unless self[:name] =~ /^[A-Z]([A-Z]|[0-9]|_)*$/
+ raise Puppet::Error, "alias names #{self[:name]} does not match [A-Z]([A-Z][0-9]_)*"
+ end
elsif self.value(:type) == 'user_spec'
checkprops(SUDOERS_SPEC)
elsif ! self[:type]