In xmlrpcs.inc, xmlrpc() provides for two different types of structures of callbacks, one that allows for introspection services and the other that does not.

For the latter, when initializing the callbacks for the server, it executes this line of code:
$xmlrpc_server->signatures[$key] = '';

Later on, if system.methodSignature is invoked for one of the methods, it executes this code:

  if (!is_array($xmlrpc_server->signatures[$methodname])) {
    return xmlrpc_error(-32601, t('Server error. Requested method @methodname signature not specified.', array("@methodname" => $methodname)));
  }

This is contrary to the specification at http://xmlrpc-c.sourceforge.net/introspection.html :

Errors

The RPC fails if the server does not have a method by the indicated name, or does not want to admit that it does. But if the method name appears in the response to system.listMethods, the RPC does not fail this way.

This suggests that the response should be the “I don’t know” response, rather than a failure.

This patch provides that response.

Closely related, I preserved this code fragment, which seems dubious:

  $return = array();
  foreach ($xmlrpc_server->signatures[$methodname] as $type) {
    $return[] = $type;
  }

It is different from the following if the input array is associative, but that seems unlikely:

$return = $xmlrpc_server->signatures[$methodname]

Also see:
#839330: XML-RPC introspection protocol is broken

CommentFileSizeAuthor
xmlrpcs.inc_.patch1.22 KBDaniel Norton

Comments

fgm’s picture

Status: Needs review » Active
Daniel Norton’s picture

I don't imagine it’s a dup as it’s not restricted to 8.x and there's no dev release for 8.x., yet.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.