Bug #3208
closedxmlrpc is incompatible with development head
Description
=begin
Specifically "prefix + name" in xmlrpc/utils.rb throws an exception due to name being a symbol. The quick solution is to change these two lines to "prefix + name.to_s"
=end
Updated by luislavena (Luis Lavena) over 14 years ago
=begin
Hello HD Moore,
When reporting a new bug, provide a simple code sample and a full backtrace of the error.
Thank you.
=end
Updated by hdm (HD Moore) over 14 years ago
=begin
Sure thing - I'll attach the diff as well.
=end
Updated by hdm (HD Moore) over 14 years ago
=begin
Example trigger:
svn co https://metasploit.com/svn/framework3/trunk msf3/¶
cd msf3/¶
ruby msfrpcd -P test¶
[] XMLRPC starting on 0.0.0.0:55553 (SSL):Basic...
[] XMLRPC initializing...
[*] XMLRPC backgrounding...
/home/projects/metasploit/framework3/trunk/data/msfweb/vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb:25:in +': can't convert Symbol into String (TypeError) from /home/projects/metasploit/framework3/trunk/data/msfweb/vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb:25:in
add_with_safety'
from /home/hdm/.rvm/ruby-1.9.1-head/lib/ruby/1.9.1/xmlrpc/utils.rb:135:in block in get_methods' from /home/hdm/.rvm/ruby-1.9.1-head/lib/ruby/1.9.1/xmlrpc/utils.rb:134:in
collect'
from /home/hdm/.rvm/ruby-1.9.1-head/lib/ruby/1.9.1/xmlrpc/utils.rb:134:in get_methods' from /home/hdm/.rvm/ruby-1.9.1-head/lib/ruby/1.9.1/xmlrpc/server.rb:195:in
add_handler'
from /home/projects/metasploit/framework3/trunk/plugins/xmlrpc.rb:100:in run' from msfrpcd:94:in
'
This is a fairly typical XMLRPC implementation, the source can be seen at:
https://metasploit.com/svn/framework3/trunk/lib/msf/core/rpc/service.rb
The patch:
--- /home/hdm/.rvm/ruby-1.9.1-head/lib/ruby/1.9.1/xmlrpc/utils.rb 2010-04-27 11:45:29.709063880 -0700
+++ /home/hdm/.rvm/ruby-1.9.1-head/lib/ruby/1.9.1/xmlrpc/utils.rb.new 2010-04-27 11:45:05.818745153 -0700
@@ -112,7 +112,7 @@
def get_methods(obj, delim=".")
prefix = @prefix + delim
@methods.collect { |name, meth, sig, help|
-
[prefix + name, obj.method(meth).to_proc, sig, help]
-
end[prefix + name.to_s, obj.method(meth).to_proc, sig, help] }
@@ -132,7 +132,7 @@
def get_methods(obj, delim=".")
prefix = @prefix + delim
obj.class.public_instance_methods(false).collect { |name|
-
[prefix + name, obj.method(name).to_proc, nil, nil]
-
end[prefix + name.to_s, obj.method(name).to_proc, nil, nil] }
end
=end
Updated by JEG2 (James Gray) over 14 years ago
- Assignee set to JEG2 (James Gray)
=begin
It looks like there may be other failures in the tests. I'm seeing XML-RPC failures with regards to YAML and Delegator too. It may be that my Ruby is a little behind though.
=end
Updated by JEG2 (James Gray) over 14 years ago
=begin
Yeah, it looks like my Ruby was just behind. I rebuilt from HEAD and the tests are passing for me now. All that's left is to apply this patch, which I will do.
=end