[Rails] Re: breakpoint not working
Florian Groß
florgro at gmail.com
Sat Jan 29 17:13:05 GMT 2005
Florian Groß wrote:
> Does the problem still occur when you use something else instead of
> WEBrick? I think I've traced this whole thing to the handlers being run
> in a $SAFE=4 context so far. But I don't know why such a thing would
> happen.
I think I've traced this further. If you use .call on a tainted method
it will be run inside a $SAFE=4 context. I still don't know why the
methods should be tainted, but you can try these changes and report the
result:
Index: C:/dev.svn/ruby/breakpoint/breakpoint.rb
===================================================================
--- C:/dev.svn/ruby/breakpoint/breakpoint.rb (revision 41)
+++ C:/dev.svn/ruby/breakpoint/breakpoint.rb (working copy)
@@ -122,6 +122,7 @@
# in the context of the client.
class Client
def initialize(eval_handler) # :nodoc:
+ eval_handler.untaint
@eval_handler = eval_handler
end
@@ -288,6 +289,8 @@
def collision
sleep(0.5) until @collision_handler
+ @collision_handler.untaint
@collision_handler.call
end
@@ -299,6 +302,7 @@
sleep(0.5) until @handler
+ @handler.untaint
@handler.call(workspace, message)
end
Index: C:/dev.svn/ruby/breakpoint/breakpoint_client.rb
===================================================================
--- C:/dev.svn/ruby/breakpoint/breakpoint_client.rb (revision 40)
+++ C:/dev.svn/ruby/breakpoint/breakpoint_client.rb (working copy)
@@ -149,9 +149,15 @@
service = DRbObject.new(nil, Options[:ServerURI])
begin
- service.eval_handler = Handlers.method(:eval_handler)
- service.collision_handler = Handlers.method(:collision_handler)
- service.handler = Handlers.method(:breakpoint_handler)
+ ehandler = Handlers.method(:eval_handler)
+ p [ehandler, ehandler.tainted?]; ehandler.untaint
+ chandler = Handlers.method(:collision_handler)
+ p [chandler, chandler.tainted?]; chandler.untaint
+ handler = Handlers.method(:breakpoint_handler)
+ p [handler, handler.tainted?]; handler.untaint
+ service.eval_handler = ehandler
+ service.collision_handler = chandler
+ service.handler = handler
reconnecting = false
if Options[:Verbose] then
More information about the Rails
mailing list