Page MenuHomeFeedback Tracker

remoteExec does not execute a function that is not defined on the caller's computer
Closed, ResolvedPublic

Description

When I try to call a function under the following conditions using remoteExec:

  • Params array for the remoteExec command is more than 2 elements.
  • The function specified is not defined (nil) on my computer.

The function will not be called on any computer and seems to hit a dead end. I'm not sure if this is by design or not, but this is extremely limiting to those of us that have server side addons with functions that need to be called by clients for security purposes.

Details

Legacy ID
1704142444
Severity
None
Resolution
Fixed
Reproducibility
Have Not Tried
Category
Scripting
Steps To Reproduce

Start a dedicated server.
Join and login as administrator.
Once loaded open the console.
Enter "myfunc = {diag_log _this};" into the console and press "SERVER EXEC".
Now enter "[1,2,3] remoteExec ['myfunc', 2];" into the console and press "LOCAL EXEC".
Check the server log and notice nothing was logged.
Now try entering "[1,2] remoteExec ['myfunc', 2];" into the console and press "LOCAL EXEC".
Check the server log once again and notice that it was logged successfully this time.
Enter "myfunc = {};" into the console and press "LOCAL EXEC".
Enter "[1,2,3] remoteExec ['myfunc', 2];" into the console and press "LOCAL EXEC" and once again notice that it was logged successfully on the server.

Event Timeline

Nimrod edited Steps To Reproduce. (Show Details)Jul 25 2015, 10:08 PM
Nimrod set Category to Scripting.
Nimrod set Reproducibility to Have Not Tried.
Nimrod set Severity to None.
Nimrod set Resolution to Fixed.
Nimrod set Legacy ID to 1704142444.May 8 2016, 12:26 PM
Nimrod added a subscriber: Nimrod.May 8 2016, 12:26 PM

You seem to have the wrong end of the stick. I want to call a function on the server machine from a client machine where the function does not exist.

...using remoteExec obviously. It's not uncommon to have functions that are defined server side only that can be called by clients using BIS_fnc_MP for example.

ye I got it in wrong order,
of course when the function is defined on server
then it should be callable on server from client via RE
if enabled (allowed) to run RE from client on server
(not sure about specific-password protection in that case)
must always think about the possible security risk involved

Currently you are still able to call any white listed functions on the server (regardless if they are defined client aide or not) but only if you provide 2 or less params in an array.

This will work:
[1,2] remoteExec ["serverfnc",2];

This will not:
[1,2,3] remoteExec ["serverfnc",2];

Could you post your CfgRemoteExec as well, please? Thank you.

Confirmed. Array of of params 3+ elements stops command from executing, forget about the function. The command returns NOTHING, while under 3 it returns ""

Tested without CfgRemoteExec class

Also tested without CfgRemoteExec (mode 2).

Confirmed. Array of of params 3+ elements stops command from executing, forget about the function. The command returns NOTHING, while under 3 it returns "" <<

Have you ever seen a command in Arma taking more than 2 parameters? :) They accept either none, one or two. In order to be able to send more parameters you make them an array.
"[1,2,3] remoteExec ["someCmd"]" does actually translate into "1 remoteExec 2,3". This is wrong syntax. If you check your rpt you should be able to see an error about remoteExec being called with a wrong number of arguments.
The right way to call it would be [1,[2,3]] remoteExec ["someCmd"] (or [[1,2],3]] / 1,2,3 depending on your command).

Im not calling command am I? Im calling FUNCTION so array should be treated as single argument on any length. I do understand what you mean, which is irrelevant regarding to custom functions because custom function IS NOT a command and takes only 1 argument. You can see how this is confusing already. Sorry Richard, your reply is just... meh.

Richard, if you would follow Steps To Reproduce you would clearly understand the problem.
If even that is unclear, then a repo mission could be made I guess.

remoteExec and remoteExecCall is essentially useless in many scenarios unless this is fixed before 1.50.

My reply was targeting Killzone_Kid. He mentioned commands and forgetting about the function and got me confused there. I'm sorry for that.

We already have this issue fixed internally and it will be available in the dev branch as soon as possible. Thank you.

Excellent news, thank you for fixing this so quickly :)

Yeah sorry, I meant remoteExec as command not commamd you pass to remoteExec

As of today's dev build, this issue is still not fixed. Was the fix you mentioned pushed today or expected later?

It's not there yet

Confirmed, fixed in today's dev branch update. Thanks again.