When trying to create a handler to access a SOAP server in an embedded
ruby file (.rhtml) I am unable to get anything done unless I decrease
the safe level for ruby to 0. The code is the following:
<%
require ‘soap/wsdlDriver’
require ‘soap/rpc/rpc’
require ‘cgi’
require ‘logger’
log = Logger.new(STDERR)
log.info $SAFE
file = ‘QBXMLRemote.wsdl’
soapFactory = SOAP::WSDLDriverFactory.new(file)
soap = soapFactory.create_rpc_driver
connectString = soap.openConnectionAndBeginSession ‘u’, ‘p’ , ‘’,
‘someName’, ‘’, ‘multiUser’
puts connectString
%>
When it runs at $SAFE = 1 I get the following stack trace:
[Wed Jun 21 09:06:45 2006] [error] mod_ruby: error in ruby
[Wed Jun 21 09:06:45 2006] [error] mod_ruby:
/usr/lib/ruby/1.8/http-access2.rb:1283:in initialize': Insecure operation - initialize (SecurityError) [Wed Jun 21 09:06:45 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/http-access2.rb:1283:increate_socket’
[Wed Jun 21 09:06:45 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/http-access2.rb:1252:in connect' [Wed Jun 21 09:06:45 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/timeout.rb:56:intimeout’
[Wed Jun 21 09:06:45 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/timeout.rb:76:in timeout' [Wed Jun 21 09:06:45 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/http-access2.rb:1251:inconnect’
[Wed Jun 21 09:06:45 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/http-access2.rb:1111:in query' [Wed Jun 21 09:06:45 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/http-access2.rb:833:inquery’
[Wed Jun 21 09:06:45 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/http-access2.rb:383:in do_get_block' [Wed Jun 21 09:06:45 2006] [error] mod_ruby: ... 9 levels... [Wed Jun 21 09:06:45 2006] [error] mod_ruby: from /var/www/qBooks/qBooks.rhtml:17 [Wed Jun 21 09:06:45 2006] [error] mod_ruby: from (eval):0 [Wed Jun 21 09:06:45 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/apache/eruby-run.rb:116:inrun’
[Wed Jun 21 09:06:45 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/eruby-run.rb:72:in `handler’
Any clues as to why running at $SAFE = 1 isn’t working for me? I’m
geussing that perhaps when I load the external .WSDL file it is marked
as tainted?
Thanks