Skip to content

Instantly share code, notes, and snippets.

@kbarber
Created April 17, 2012 20:52
Show Gist options
  • Select an option

  • Save kbarber/2408979 to your computer and use it in GitHub Desktop.

Select an option

Save kbarber/2408979 to your computer and use it in GitHub Desktop.
we allow this?
[ken@kb puppet]# cat /tmp/foo2.rb ruby-1.8.7-p352@puppet
require 'puppet'
module Puppet::Parser::Functions
newfunction(:'bad&function', :type => :statement) do |args|
puts "This should not fucking work"
end
end
puts Puppet::Parser::Functions.function("bad&function".to_sym)
scope = Puppet::Parser::Scope.new
scope.send("function_bad&function".to_sym, [])
[ken@kb puppet]# ruby /tmp/foo2.rb ruby-1.8.7-p352@puppet
function_bad&function
This should not fucking work
[ken@kb puppet]#
At least the grammar stops it:
[ken@kb puppet]# ./bin/puppet apply -e 'bad&function()' ruby-1.8.7-p352@puppet
err: Could not parse for environment production: Could not match &function() at line 1 on node kb.local
err: Could not parse for environment production: Could not match &function() at line 1 on node kb.local
[ken@kb puppet]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment