Moodle

Mnet isn't work when the setting of mnet_dispatcher_mode is 'dangerous'.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 2.0
  • Component/s: MNet
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

There is a bug in /mnet/xmlrpc/server.php line 504

$includefile = $CFG->dirroot.'/'.$filename;

I think

$includefile = '/'.$filename;

is true;

First, $includefile is used in mnet_server_invoke_method line 506.
Then $includefile is called at mnet_permit_rpc_call at line 691.

The function, mnet_permit_rpc_call, is in /mnet/lib.php.

In /mnet/lib.php line 414,

The system checks whether there is the file you want to include or not.
But, $CFG->dirroot is atatched again, here.

So, if you want to call /filename, the system checks that whether $CFG->dirroot.$CFG->dirroot.'/filename' exists or not.(doubled!)

Moodle isn't work when you access some function that isn't suported as normal function at setting mnet_dispather_mode='dangerous'.
And it returns RPC_NOSUCHFILE error.

Please check!

Issue Links

Activity

Hide
Penny Leach added a comment -

Yep, it definitely seems that is incorrect, judging by the other ones.

Did you confirm that your fix solved the problem?

Show
Penny Leach added a comment - Yep, it definitely seems that is incorrect, judging by the other ones. Did you confirm that your fix solved the problem?
Hide
Penny Leach added a comment -

I've changed this code a lot in HEAD. Can you please test the latest 2.0 version from CVS and see if dangerous mode works for you?

Show
Penny Leach added a comment - I've changed this code a lot in HEAD. Can you please test the latest 2.0 version from CVS and see if dangerous mode works for you?
Hide
Penny Leach added a comment -

Closing because of lack of action & this should be fixed with the big refactor in Moodle 2.0. Please reopen if you still have trouble.

Show
Penny Leach added a comment - Closing because of lack of action & this should be fixed with the big refactor in Moodle 2.0. Please reopen if you still have trouble.
Hide
Jerome Jacobsen added a comment -

This is also broken in 1.9.8.

The patch that works for me is to change line 504
from:
$includefile = $CFG->dirroot.'/'.$filename;
to:
$includefile = '/'.$filename;

Show
Jerome Jacobsen added a comment - This is also broken in 1.9.8. The patch that works for me is to change line 504 from: $includefile = $CFG->dirroot.'/'.$filename; to: $includefile = '/'.$filename;

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: