From: Jason Voegele Date: 2002-04-19T04:48:04+09:00 Subject: Re: Object#send with $SAFE >= 1 > On Fri, Apr 19, 2002 at 04:26:21AM +0900, Jason Voegele wrote: >> Strange. I tried your example in irb and got following error. >> Perhaps my irb is broken? A bug in Ruby? > > I don't have a 1.6.6 to test on, but I tested on Ruby 1.7 (CVS), 1.6.7, > and 1.6.5. I've got 1.7 installed on my machine at home. I'll try it on that one when I get home. >> irb(main):002:0> class Foo; def foo; puts "foo!"; end; end >> SecurityError: Insecure operation - eval > > Looks like you are getting the SecurityError before the call to send(). > Perhaps you have modified your irb in some way? I'm not sure how I could have. I tried it on two different machines, one is the mswin32 version built by Andy (and Dave?), the other is a RedHat 7.1 machine for which I built Ruby 1.6.7 from the source. irb exhibits the same behavior on both of them, and I haven't done anything to my knowledge that would have modified irb. In my actual application, I only get these errors when using #send or #method. In irb, once I set $SAFE=1, it happens with nearly everything. My actual application is a CGI script, and I'm having trouble tracking down the error logs to get to the root cause. Using "printf debugging", I've tracked it down to the call to #send. -- Jason Voegele "We believe that we invent symbols. The truth is that they invent us." -- Gene Wolfe, The Shadow of the Torturer