Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10214

Mnet : wrong error message "Your IP address does not match..." for test client

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8, 1.8.1
    • Fix Version/s: 1.8.4, 1.9, 2.0
    • Component/s: MNet
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      Wrong error message in log file while trying out mnet/testclient.php when remote_wwwroot is not set in the XML that the client sent.
      XMLRPC Error Response 7017 Your IP address does not match the address we have on record. in /applis/Internet/MOODLE_17_DEV/mnet/xmlrpc/server.php on line 286
      The right message should be:
      XMLRPC Error Response 7020 [[wrong-wwwroot]] in /applis/Internet/MOODLE_17_DEV/mnet/xmlrpc/server.php on line 286

      It's because:

      • record "All Hosts" exists in mnet_host table ; with wwwroot logically not set
      • function set_wwwroot of mnet/peer.php get this record when looking for an EMPTY remote_wwwroot
      • function mnet_server_strip_wrappers of mnet/xmlrpc/server.php believes that this host exists:
        $host_record_exists = $MNET_REMOTE_CLIENT->set_wwwroot($crypt_parser->remote_wwwroot);
      • there is logically no IP address for "All hosts" therefore that doesn't match with the IP of the client which sent the XML

      Here is a very simple fix:
      Index: server.php
      ===================================================================
      RCS file: /cvsroot/moodle/moodle/mnet/xmlrpc/server.php,v
      retrieving revision 1.10.2.1
      diff -u -r1.10.2.1 server.php
      — server.php 20 Feb 2007 02:05:31 -0000 1.10.2.1
      +++ server.php 21 Jun 2007 09:29:08 -0000
      @@ -122,7 +122,11 @@
      $crypt_parser->parse($HTTP_RAW_POST_DATA);

      // Make sure we know who we're talking to

      • $host_record_exists = $MNET_REMOTE_CLIENT->set_wwwroot($crypt_parser->remote_wwwroot);
        + if (empty($crypt_parser->remote_wwwroot)) { + $host_record_exists = false; + }

        else

        { + $host_record_exists = $MNET_REMOTE_CLIENT->set_wwwroot($crypt_parser->remote_wwwroot); + }

      if (false == $host_record_exists) {
      exit(mnet_server_fault(7020, 'wrong-wwwroot', $crypt_parser->remote_wwwroot));

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jan/08