Project

General

Profile

Actions

Bug #3208

closed

xmlrpc is incompatible with development head

Added by hdm (HD Moore) over 14 years ago. Updated over 13 years ago.

Status:
Closed
ruby -v:
ruby 1.9.2dev (2010-04-27 trunk 27509) [i386-mingw32]
[ruby-core:29821]

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

Actions #1

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

Actions #2

Updated by hdm (HD Moore) over 14 years ago

=begin
Sure thing - I'll attach the diff as well.
=end

Actions #3

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]
    
  •    [prefix + name.to_s, obj.method(meth).to_proc, sig, help]
     }
    
    end

@@ -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]
    
  •    [prefix + name.to_s, obj.method(name).to_proc, nil, nil]
     }
    
    end
    end

=end

Actions #4

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

Actions #5

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

Actions #6

Updated by JEG2 (James Gray) over 14 years ago

  • Status changed from Open to Closed

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0