diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-11-04 17:32:11 -0700 |
---|---|---|
committer | Jesse Wolfe <jes5199@gmail.com> | 2010-11-09 10:26:13 -0800 |
commit | 5c2457952660e3e531e085757fd85c382676a96e (patch) | |
tree | edd18d37fe28c42a81dbe461977e0fb112139394 | |
parent | 555d6bc671a1a9c128d6f66b2d85b011c84761ba (diff) | |
download | puppet-5c2457952660e3e531e085757fd85c382676a96e.tar.gz puppet-5c2457952660e3e531e085757fd85c382676a96e.tar.xz puppet-5c2457952660e3e531e085757fd85c382676a96e.zip |
maint: prevent fork bombs by disabling ActiveSupport's Kernel.daemonize
ActiveSupport provides a "daemonize" method on all objects that causes
the ruby process to fork to the background. This is extremely surprising
and dangerous, and some of our spec tests could trigger this
accidentally.
This patch adds a "daemonize" method to Object which shadows the
ActiveSupport version, preventing it from ever being called.
-rw-r--r-- | lib/puppet/util/monkey_patches.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb index 6b5af8350..bdce5ec1d 100644 --- a/lib/puppet/util/monkey_patches.rb +++ b/lib/puppet/util/monkey_patches.rb @@ -48,3 +48,11 @@ if RUBY_VERSION == '1.8.7' end end +class Object + # ActiveSupport 2.3.x mixes in a dangerous method + # that can cause rspec to fork bomb + # and other strange things like that. + def daemonize + raise NotImplementedError, "Kernel.daemonize is too dangerous, please don't try to use it." + end +end |